application-prod.yml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. server:
  2. port: 8989
  3. spring:
  4. datasource:
  5. type: com.alibaba.druid.pool.DruidDataSource
  6. driver-class-name: com.mysql.cj.jdbc.Driver
  7. 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
  8. username: root
  9. password: 1KQaNI+vPz8^xfYcb%l6
  10. data:
  11. redis:
  12. database: 6
  13. host: 47.109.18.141
  14. port: 6379
  15. password: BXyzm3RKR2nA9vn5ZkeP
  16. timeout: 10s
  17. lettuce:
  18. pool:
  19. # 连接池最大连接数 默认8 ,负数表示没有限制
  20. max-active: 8
  21. # 连接池最大阻塞等待时间(使用负值表示没有限制) 默认-1
  22. max-wait: -1
  23. # 连接池中的最大空闲连接 默认8
  24. max-idle: 8
  25. # 连接池中的最小空闲连接 默认0
  26. min-idle: 0
  27. cache:
  28. enabled: false
  29. # 缓存类型 redis、none(不使用缓存)
  30. type: redis
  31. # 缓存时间(单位:ms)
  32. redis:
  33. time-to-live: 3600000
  34. # 缓存null值,防止缓存穿透
  35. cache-null-values: true
  36. caffeine:
  37. spec: initialCapacity=50,maximumSize=1000,expireAfterWrite=600s
  38. # 邮件配置
  39. mail:
  40. host: smtp.youlai.tech
  41. port: 587
  42. username: your-email@example.com
  43. password: 123456
  44. properties:
  45. mail:
  46. smtp:
  47. auth: true
  48. starttls:
  49. enable: true
  50. # 邮件发送者
  51. from: youlaitech@163.com
  52. # 第三方认证配置
  53. third-party:
  54. jwt:
  55. secret: "vgct1TZ4ZikKjaaeIiq3LUwIvpmcgYa6ABCD1234EFGH5678IJKL9012MNOP3456"
  56. expire: 7200
  57. mybatis-plus:
  58. mapper-locations: classpath*:/mapper/**/*.xml
  59. global-config:
  60. db-config:
  61. # 主键ID类型
  62. id-type: none
  63. # 逻辑删除对应的全局属性名(注意:须是对象属性名,不能是表字段名,如 isDeleted 而非 is_deleted,否则逻辑删除失效)
  64. logic-delete-field: isDeleted
  65. # 逻辑删除-删除值
  66. logic-delete-value: 1
  67. # 逻辑删除-未删除值
  68. logic-not-delete-value: 0
  69. configuration:
  70. # 驼峰下划线转换
  71. map-underscore-to-camel-case: true
  72. # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
  73. log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
  74. # 异步线程池配置
  75. async:
  76. thread-pool:
  77. core-pool-size: 10
  78. max-pool-size: 50
  79. queue-capacity: 1000
  80. keep-alive-seconds: 60
  81. thread-name-prefix: "business-async-"
  82. allow-core-thread-timeout: false
  83. await-termination-seconds: 30
  84. # 安全配置
  85. security:
  86. session:
  87. type: jwt # 会话方式 jwt/redis-token
  88. access-token-time-to-live: 7200 # 访问令牌 有效期(单位:秒),默认 2 小时,-1 表示永不过期
  89. refresh-token-time-to-live: 604800 # 刷新令牌有效期(单位:秒),默认 7 天,-1 表示永不过期
  90. jwt:
  91. secret-key: SecretKey012345678901234567890123456789012345678901234567890123456789 # JWT密钥(HS256算法至少32字符)
  92. redis-token:
  93. allow-multi-login: true # 是否允许多设备登录
  94. # 安全白名单路径,仅跳过 AuthorizationFilter 过滤器,还是会走 Spring Security 的其他过滤器(CSRF、CORS等)
  95. ignore-urls:
  96. - /api/v1/auth/login/** # 登录接口(账号密码登录、手机验证码登录和微信登录)
  97. - /api/v1/auth/captcha # 验证码获取接口
  98. - /api/v1/auth/refresh-token # 刷新令牌接口
  99. - /api/v1/auth/logout # 开放退出登录
  100. - /api/v1/auth/wx/** # 微信相关所有接口
  101. - /ws/** # WebSocket接口
  102. - /applet/v1/homePage/** # 用户端分页查询站点信息
  103. # 非安全端点路径,完全绕过 Spring Security 的安全控制
  104. unsecured-urls:
  105. - ${springdoc.swagger-ui.path}
  106. - /doc.html
  107. - /swagger-ui/**
  108. - /v3/api-docs/**
  109. - /webjars/**
  110. - /favicon.ico
  111. - /charge-business/v1/linkData/**
  112. - /applet/v1/homePage/** # 用户端分页查询站点信息
  113. # 只走第三方过滤器、不走其他安全链
  114. third-party-urls:
  115. - /charge-business/v1/linkData/notification_start_charge_result
  116. - /charge-business/v1/linkData/notification_equip_charge_status
  117. - /charge-business/v1/linkData/notification_stop_charge_result
  118. - /charge-business/v1/linkData/notification_charge_order_info
  119. - /charge-business/v1/linkData/notification_stationStatus
  120. # XSS 和 SQL 注入防护过滤器配置
  121. filter:
  122. # 是否启用 XSS 防护
  123. xss-enabled: true
  124. # 是否启用 SQL 注入防护
  125. sql-injection-enabled: true
  126. # SQL 注入检测严格模式
  127. # true: 严格模式,可能误判一些正常输入
  128. # false: 宽松模式,减少误判但可能漏掉一些攻击
  129. sql-strict-mode: true
  130. # 排除的 URL 路径(不进行安全检查,注意:默认已经排除了 /doc.html、/swagger-ui 等接口文档相关路径)
  131. exclude-urls:
  132. - /api/v1/auth/captcha # 验证码接口
  133. # 额外需要检查的请求头(默认已检查 User-Agent、Referer、X-Forwarded-For)
  134. check-headers:
  135. - Referer
  136. - X-Forwarded-For
  137. okhttp:
  138. connect-timeout: 30s
  139. read-timeout: 120s
  140. write-timeout: 60s
  141. retry-on-connection-failure: true
  142. max-retry-count: 2
  143. connection-pool:
  144. max-idle-connections: 200
  145. keep-alive-duration: 300s
  146. # 文件存储配置
  147. oss:
  148. # OSS 类型 (目前支持aliyun、minio、local)
  149. type: aliyun
  150. # MinIO 对象存储服务
  151. minio:
  152. # MinIO 服务地址
  153. endpoint: http://localhost:9000
  154. # 访问凭据
  155. access-key: minioadmin
  156. # 凭据密钥
  157. secret-key: minioadmin
  158. # 存储桶名称
  159. bucket-name: zsElectric
  160. # (可选) 自定义域名:配置后,文件 URL 会使用该域名格式
  161. custom-domain:
  162. # 阿里云OSS对象存储服务
  163. aliyun:
  164. # 服务Endpoint
  165. endpoint: oss-cn-beijing.aliyuncs.com
  166. # 访问凭据`
  167. access-key-id: LTAI5tJscqbev7wSugGCrEtt
  168. # 凭据密钥
  169. access-key-secret: xJkoJR1ILpXNSF2ERnxNq71UZTQNcB
  170. # 存储桶名称
  171. bucket-name: national-motion
  172. # 本地存储
  173. local:
  174. # 文件存储路径 请注意下,mac用户请使用 /Users/your-username/your-path/,否则会有权限问题,windows用户请使用 D:/your-path/
  175. storage-path: /Users/theo/home/
  176. # 短信配置
  177. sms:
  178. # 阿里云短信
  179. aliyun:
  180. accessKeyId: xxx
  181. accessKeySecret: xxx
  182. domain: dysmsapi.aliyuncs.com
  183. regionId: cn-shanghai
  184. signName: 中数未来
  185. templates:
  186. # 注册短信验证码模板
  187. register: SMS_22xxx771
  188. # 登录短信验证码模板
  189. login: SMS_22xxx772
  190. # 修改手机号短信验证码模板
  191. change-mobile: SMS_22xxx773
  192. # springdoc配置: https://springdoc.org/properties.html
  193. springdoc:
  194. swagger-ui:
  195. path: /swagger-ui.html
  196. operations-sorter: alpha
  197. tags-sorter: alpha
  198. api-docs:
  199. path: /v3/api-docs
  200. group-configs:
  201. - group: "系统管理"
  202. paths-to-match: "/**"
  203. packages-to-scan:
  204. - com.zsElectric.boot.auth.controller
  205. - com.zsElectric.boot.system.controller
  206. - com.zsElectric.boot.platform.file.controller
  207. - com.zsElectric.boot.platform.codegen.controller
  208. - com.zsElectric.boot.charging.controller
  209. - com.zsElectric.boot.business.controller
  210. - com.zsElectric.boot.business.controller.applet
  211. default-flat-param-object: true
  212. # knife4j 接口文档配置
  213. knife4j:
  214. # 是否开启 Knife4j 增强功能
  215. enable: true # 设置为 true 表示开启增强功能
  216. # 生产环境配置
  217. production: false # 设置为 true 表示在生产环境中不显示文档,为 false 表示显示文档(通常在开发环境中使用)
  218. setting:
  219. language: zh_cn
  220. # xxl-job 定时任务配置
  221. xxl:
  222. job:
  223. # 定时任务开关
  224. enabled: false
  225. admin:
  226. # 调度中心地址,多个逗号分隔
  227. addresses: http://127.0.0.1:8080/xxl-job-admin
  228. accessToken: default_token
  229. # 执行器配置
  230. executor:
  231. appname: xxl-job-executor-${spring.application.name} # 执行器AppName
  232. address: # 执行器注册地址,默认为空,多网卡时可手动设置
  233. ip: # 执行器IP,默认为空,多网卡时可手动设置
  234. port: 9999 # 执行器通讯端口
  235. logpath: /data/applogs/xxl-job/jobhandler # 任务运行日志文件存储磁盘路径
  236. logretentiondays: 30 # 日志保存天数,值大于3时生效
  237. # 验证码配置
  238. captcha:
  239. # 验证码类型 circle-圆圈干扰验证码|gif-Gif验证码|line-干扰线验证码|shear-扭曲干扰验证码
  240. type: circle
  241. # 验证码宽度
  242. width: 120
  243. # 验证码高度
  244. height: 40
  245. # 验证码干扰元素个数
  246. interfere-count: 2
  247. # 文本透明度(0.0-1.0)
  248. text-alpha: 0.8
  249. # 验证码字符配置
  250. code:
  251. # 验证码字符类型 math-算术|random-随机字符
  252. type: math
  253. # 验证码字符长度,type=算术时,表示运算位数(1:个位数运算 2:十位数运算);type=随机字符时,表示字符个数
  254. length: 1
  255. # 验证码字体
  256. font:
  257. # 字体名称 Dialog|DialogInput|Monospaced|Serif|SansSerif
  258. name: SansSerif
  259. # 字体样式 0-普通|1-粗体|2-斜体
  260. weight: 1
  261. # 字体大小
  262. size: 24
  263. # 验证码有效期(秒)
  264. expire-seconds: 120
  265. # 微信小程序配置
  266. wx:
  267. miniapp:
  268. # 微信小程序 AppID(在微信公众平台获取)
  269. app-id: wx9894a01b9e92c368
  270. # 微信小程序 AppSecret(在微信公众平台获取)
  271. app-secret: b1e83dbcf83af310c38c0a138739ddcf
  272. # ==================== AI 命令系统配置 ====================
  273. ai:
  274. # 是否启用 AI 功能
  275. enabled: false
  276. # 当前使用的提供商:qwen、deepseek、openai
  277. provider: qwen
  278. # 所有提供商配置(统一管理,扩展性强)
  279. providers:
  280. # 阿里通义千问(推荐:有免费额度)
  281. qwen:
  282. # API Key(https://bailian.console.aliyun.com/ 获取)
  283. api-key: ${QWEN_API_KEY:sk-c2941d05bf2f411ca80424fcxxxxxxxx}
  284. # Base URL(OpenAI 兼容端点)
  285. base-url: https://dashscope.aliyuncs.com/compatible-mode/v1
  286. # 模型:qwen-plus(推荐)、qwen-turbo、qwen-max、qwen-long
  287. model: qwen-plus
  288. # 显示名称
  289. display-name: 阿里通义千问
  290. # 超时时间(秒)
  291. timeout: 30
  292. # DeepSeek
  293. deepseek:
  294. api-key: ${DEEPSEEK_API_KEY:}
  295. base-url: https://api.deepseek.com/v1
  296. model: deepseek-chat
  297. display-name: DeepSeek
  298. timeout: 30
  299. # OpenAI(添加新提供商只需配置,无需修改代码)
  300. openai:
  301. api-key: ${OPENAI_API_KEY:}
  302. base-url: https://api.openai.com/v1
  303. model: gpt-4
  304. display-name: OpenAI GPT-4
  305. timeout: 60
  306. # 安全配置
  307. security:
  308. enable-audit: true
  309. dangerous-operations-confirm: true
  310. function-whitelist:
  311. - deleteUser
  312. - updateUser
  313. - queryUsers
  314. - assignRole
  315. sensitive-params:
  316. - password
  317. - idCard
  318. - bankCard
  319. - token
  320. # 限流配置
  321. rate-limit:
  322. max-executions-per-minute: 10
  323. max-executions-per-day: 100