server: port: 8989 spring: datasource: type: com.alibaba.druid.pool.DruidDataSource driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://rm-2vc2zl1990od9qvg0eo.mysql.cn-chengdu.rds.aliyuncs.com:3306/zs_electric?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: root password: 1KQaNI+vPz8^xfYcb%l6 data: redis: database: 6 host: 47.109.18.141 port: 6379 password: BXyzm3RKR2nA9vn5ZkeP timeout: 10s lettuce: pool: # 连接池最大连接数 默认8 ,负数表示没有限制 max-active: 8 # 连接池最大阻塞等待时间(使用负值表示没有限制) 默认-1 max-wait: -1 # 连接池中的最大空闲连接 默认8 max-idle: 8 # 连接池中的最小空闲连接 默认0 min-idle: 0 cache: enabled: false # 缓存类型 redis、none(不使用缓存) type: redis # 缓存时间(单位:ms) redis: time-to-live: 3600000 # 缓存null值,防止缓存穿透 cache-null-values: true caffeine: spec: initialCapacity=50,maximumSize=1000,expireAfterWrite=600s # 邮件配置 mail: host: smtp.youlai.tech port: 587 username: your-email@example.com password: 123456 properties: mail: smtp: auth: true starttls: enable: true # 邮件发送者 from: youlaitech@163.com # 第三方认证配置 third-party: jwt: secret: "vgct1TZ4ZikKjaaeIiq3LUwIvpmcgYa6ABCD1234EFGH5678IJKL9012MNOP3456" expire: 7200 mybatis-plus: mapper-locations: classpath*:/mapper/**/*.xml global-config: db-config: # 主键ID类型 id-type: none # 逻辑删除对应的全局属性名(注意:须是对象属性名,不能是表字段名,如 isDeleted 而非 is_deleted,否则逻辑删除失效) logic-delete-field: isDeleted # 逻辑删除-删除值 logic-delete-value: 1 # 逻辑删除-未删除值 logic-not-delete-value: 0 configuration: # 驼峰下划线转换 map-underscore-to-camel-case: true # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用 log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 异步线程池配置 async: thread-pool: core-pool-size: 10 max-pool-size: 50 queue-capacity: 1000 keep-alive-seconds: 60 thread-name-prefix: "business-async-" allow-core-thread-timeout: false await-termination-seconds: 30 # 安全配置 security: session: type: jwt # 会话方式 jwt/redis-token access-token-time-to-live: 7200 # 访问令牌 有效期(单位:秒),默认 2 小时,-1 表示永不过期 refresh-token-time-to-live: 604800 # 刷新令牌有效期(单位:秒),默认 7 天,-1 表示永不过期 jwt: secret-key: SecretKey012345678901234567890123456789012345678901234567890123456789 # JWT密钥(HS256算法至少32字符) redis-token: allow-multi-login: true # 是否允许多设备登录 # 安全白名单路径,仅跳过 AuthorizationFilter 过滤器,还是会走 Spring Security 的其他过滤器(CSRF、CORS等) ignore-urls: - /api/v1/auth/login/** # 登录接口(账号密码登录、手机验证码登录和微信登录) - /api/v1/auth/captcha # 验证码获取接口 - /api/v1/auth/refresh-token # 刷新令牌接口 - /api/v1/auth/logout # 开放退出登录 - /api/v1/auth/wx/** # 微信相关所有接口 - /ws/** # WebSocket接口 - /applet/v1/homePage/** # 用户端分页查询站点信息 # 非安全端点路径,完全绕过 Spring Security 的安全控制 unsecured-urls: - ${springdoc.swagger-ui.path} - /doc.html - /swagger-ui/** - /v3/api-docs/** - /webjars/** - /favicon.ico - /charge-business/v1/linkData/** - /applet/v1/homePage/** # 用户端分页查询站点信息 # 只走第三方过滤器、不走其他安全链 third-party-urls: - /charge-business/v1/linkData/notification_start_charge_result - /charge-business/v1/linkData/notification_equip_charge_status - /charge-business/v1/linkData/notification_stop_charge_result - /charge-business/v1/linkData/notification_charge_order_info - /charge-business/v1/linkData/notification_stationStatus # XSS 和 SQL 注入防护过滤器配置 filter: # 是否启用 XSS 防护 xss-enabled: true # 是否启用 SQL 注入防护 sql-injection-enabled: true # SQL 注入检测严格模式 # true: 严格模式,可能误判一些正常输入 # false: 宽松模式,减少误判但可能漏掉一些攻击 sql-strict-mode: true # 排除的 URL 路径(不进行安全检查,注意:默认已经排除了 /doc.html、/swagger-ui 等接口文档相关路径) exclude-urls: - /api/v1/auth/captcha # 验证码接口 # 额外需要检查的请求头(默认已检查 User-Agent、Referer、X-Forwarded-For) check-headers: - Referer - X-Forwarded-For okhttp: connect-timeout: 30s read-timeout: 120s write-timeout: 60s retry-on-connection-failure: true max-retry-count: 2 connection-pool: max-idle-connections: 200 keep-alive-duration: 300s # 文件存储配置 oss: # OSS 类型 (目前支持aliyun、minio、local) type: aliyun # MinIO 对象存储服务 minio: # MinIO 服务地址 endpoint: http://localhost:9000 # 访问凭据 access-key: minioadmin # 凭据密钥 secret-key: minioadmin # 存储桶名称 bucket-name: zsElectric # (可选) 自定义域名:配置后,文件 URL 会使用该域名格式 custom-domain: # 阿里云OSS对象存储服务 aliyun: # 服务Endpoint endpoint: oss-cn-beijing.aliyuncs.com # 访问凭据` access-key-id: LTAI5tJscqbev7wSugGCrEtt # 凭据密钥 access-key-secret: xJkoJR1ILpXNSF2ERnxNq71UZTQNcB # 存储桶名称 bucket-name: national-motion # 本地存储 local: # 文件存储路径 请注意下,mac用户请使用 /Users/your-username/your-path/,否则会有权限问题,windows用户请使用 D:/your-path/ storage-path: /Users/theo/home/ # 短信配置 sms: # 阿里云短信 aliyun: accessKeyId: xxx accessKeySecret: xxx domain: dysmsapi.aliyuncs.com regionId: cn-shanghai signName: 中数未来 templates: # 注册短信验证码模板 register: SMS_22xxx771 # 登录短信验证码模板 login: SMS_22xxx772 # 修改手机号短信验证码模板 change-mobile: SMS_22xxx773 # springdoc配置: https://springdoc.org/properties.html springdoc: swagger-ui: path: /swagger-ui.html operations-sorter: alpha tags-sorter: alpha api-docs: path: /v3/api-docs group-configs: - group: "系统管理" paths-to-match: "/**" packages-to-scan: - com.zsElectric.boot.auth.controller - com.zsElectric.boot.system.controller - com.zsElectric.boot.platform.file.controller - com.zsElectric.boot.platform.codegen.controller - com.zsElectric.boot.charging.controller - com.zsElectric.boot.business.controller - com.zsElectric.boot.business.controller.applet default-flat-param-object: true # knife4j 接口文档配置 knife4j: # 是否开启 Knife4j 增强功能 enable: true # 设置为 true 表示开启增强功能 # 生产环境配置 production: false # 设置为 true 表示在生产环境中不显示文档,为 false 表示显示文档(通常在开发环境中使用) setting: language: zh_cn # xxl-job 定时任务配置 xxl: job: # 定时任务开关 enabled: false admin: # 调度中心地址,多个逗号分隔 addresses: http://127.0.0.1:8080/xxl-job-admin accessToken: default_token # 执行器配置 executor: appname: xxl-job-executor-${spring.application.name} # 执行器AppName address: # 执行器注册地址,默认为空,多网卡时可手动设置 ip: # 执行器IP,默认为空,多网卡时可手动设置 port: 9999 # 执行器通讯端口 logpath: /data/applogs/xxl-job/jobhandler # 任务运行日志文件存储磁盘路径 logretentiondays: 30 # 日志保存天数,值大于3时生效 # 验证码配置 captcha: # 验证码类型 circle-圆圈干扰验证码|gif-Gif验证码|line-干扰线验证码|shear-扭曲干扰验证码 type: circle # 验证码宽度 width: 120 # 验证码高度 height: 40 # 验证码干扰元素个数 interfere-count: 2 # 文本透明度(0.0-1.0) text-alpha: 0.8 # 验证码字符配置 code: # 验证码字符类型 math-算术|random-随机字符 type: math # 验证码字符长度,type=算术时,表示运算位数(1:个位数运算 2:十位数运算);type=随机字符时,表示字符个数 length: 1 # 验证码字体 font: # 字体名称 Dialog|DialogInput|Monospaced|Serif|SansSerif name: SansSerif # 字体样式 0-普通|1-粗体|2-斜体 weight: 1 # 字体大小 size: 24 # 验证码有效期(秒) expire-seconds: 120 # 微信小程序配置 wx: miniapp: # 微信小程序 AppID(在微信公众平台获取) app-id: wx9894a01b9e92c368 # 微信小程序 AppSecret(在微信公众平台获取) app-secret: b1e83dbcf83af310c38c0a138739ddcf # ==================== AI 命令系统配置 ==================== ai: # 是否启用 AI 功能 enabled: false # 当前使用的提供商:qwen、deepseek、openai provider: qwen # 所有提供商配置(统一管理,扩展性强) providers: # 阿里通义千问(推荐:有免费额度) qwen: # API Key(https://bailian.console.aliyun.com/ 获取) api-key: ${QWEN_API_KEY:sk-c2941d05bf2f411ca80424fcxxxxxxxx} # Base URL(OpenAI 兼容端点) base-url: https://dashscope.aliyuncs.com/compatible-mode/v1 # 模型:qwen-plus(推荐)、qwen-turbo、qwen-max、qwen-long model: qwen-plus # 显示名称 display-name: 阿里通义千问 # 超时时间(秒) timeout: 30 # DeepSeek deepseek: api-key: ${DEEPSEEK_API_KEY:} base-url: https://api.deepseek.com/v1 model: deepseek-chat display-name: DeepSeek timeout: 30 # OpenAI(添加新提供商只需配置,无需修改代码) openai: api-key: ${OPENAI_API_KEY:} base-url: https://api.openai.com/v1 model: gpt-4 display-name: OpenAI GPT-4 timeout: 60 # 安全配置 security: enable-audit: true dangerous-operations-confirm: true function-whitelist: - deleteUser - updateUser - queryUsers - assignRole sensitive-params: - password - idCard - bankCard - token # 限流配置 rate-limit: max-executions-per-minute: 10 max-executions-per-day: 100