application.yml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. # 开发环境配置
  2. server:
  3. # 服务器的HTTP端口,默认为80
  4. port: 8094
  5. tomcat:
  6. # tomcat的URI编码
  7. uri-encoding: UTF-8
  8. # tomcat最大线程数,默认为200
  9. max-threads: 800
  10. # Tomcat启动初始化的线程数,默认值25
  11. min-spare-threads: 30
  12. #超时时间
  13. connection-timeout: 600000
  14. accesslog:
  15. enabled: true
  16. buffered: true
  17. prefix: access_log
  18. file-date-format: .yyyy-MM-dd
  19. mvc:
  20. pathmatch:
  21. matching-strategy: ant_path_matcher
  22. # 日志配置
  23. logging:
  24. console.enabled: ${CONSOLE_ENABLED:true}
  25. file.enabled: ${FILE_ENABLED:false}
  26. level:
  27. com.poyee: debug
  28. fluentd:
  29. enabled: ${FLUENTD_ENABLED:false}
  30. host: ${FLUENTD_HOST:127.0.0.1}
  31. port: ${FLUENTD_PORT:24225}
  32. audit:
  33. enabled: ${AUDIT_ENABLED:false}
  34. host: ${AUDIT_HOST:192.168.1.51}
  35. port: ${AUDIT_PORT:24225}
  36. bee:
  37. enabled: true
  38. # Spring配置
  39. spring:
  40. application:
  41. name: ratingRecommend
  42. datasource:
  43. type: com.alibaba.druid.pool.DruidDataSource
  44. driverClassName: org.postgresql.Driver
  45. # url: jdbc:postgresql://192.168.50.8:5432/test01
  46. url: jdbc:postgresql://192.168.77.80:5432/mongo_grade?useUnicode=true&characterEncoding=UTF-8
  47. username: postgres
  48. password: 123456
  49. druid:
  50. # 初始连接数
  51. initialSize: 5
  52. # 最小连接池数量
  53. minIdle: 10
  54. # 最大连接池数量
  55. maxActive: 50
  56. # 配置获取连接等待超时的时间
  57. maxWait: 60000
  58. # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
  59. timeBetweenEvictionRunsMillis: 60000
  60. # 配置一个连接在池中最小生存的时间,单位是毫秒
  61. minEvictableIdleTimeMillis: 300000
  62. # 配置一个连接在池中最大生存的时间,单位是毫秒
  63. maxEvictableIdleTimeMillis: 900000
  64. # 配置检测连接是否有效
  65. validationQuery: SELECT 1
  66. testWhileIdle: true
  67. testOnBorrow: false
  68. testOnReturn: false
  69. webStatFilter:
  70. enabled: true
  71. statViewServlet:
  72. enabled: true
  73. # 设置白名单,不填则允许所有访问
  74. allow:
  75. url-pattern: /druid/*
  76. # 控制台管理用户名和密码
  77. login-username:
  78. login-password:
  79. filter:
  80. stat:
  81. enabled: true
  82. # 慢SQL记录
  83. log-slow-sql: true
  84. slow-sql-millis: 500
  85. merge-sql: true
  86. wall:
  87. config:
  88. multi-statement-allow: true
  89. redis:
  90. # database: 1
  91. # host: 192.168.50.8
  92. # port: 26379
  93. # sentinel:
  94. # master: ${SENTINEL_MASTER:poyee-master}
  95. # nodes: ${SENTINEL_NODES:192.168.50.8:26379}
  96. # password: Pass2010 # 密码(默认为空)
  97. # timeout: 60000 # 连接超时时长(毫秒)
  98. # pool:
  99. # max-active: 100 # 连接池最大连接数(使用负值表示没有限制)
  100. # max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
  101. # max-idle: 50 # 连接池中的最大空闲连接
  102. # min-idle: 20 # 连接池中的最小空闲连接
  103. # 单机Redis配置
  104. host: 192.168.77.80
  105. port: 6379
  106. # 如果你的Redis有密码,写你的密码,没有就注释掉这行
  107. password: Pass2025
  108. database: 0
  109. timeout: 60000
  110. # Lettuce连接池配置(解决空闲连接被Redis服务端断开导致Connection reset by peer)
  111. lettuce:
  112. pool:
  113. max-active: 1000 # 连接池最大连接数(使用负值表示没有限制)
  114. max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
  115. max-idle: 10 # 连接池中的最大空闲连接
  116. min-idle: 5 # 连接池中的最小空闲连接
  117. #mq
  118. rabbitmq:
  119. host: 192.168.77.80
  120. port: 5672
  121. username: order
  122. password: Pass2025
  123. #确认消息已发送到交换机(Exchange)
  124. publisher-confirms: true
  125. #确认消息已发送到队列(Queue)
  126. publisher-returns: true
  127. virtual-host: /order
  128. template:
  129. retry:
  130. enabled: true
  131. mandatory: true
  132. listener:
  133. simple:
  134. acknowledge-mode: manual
  135. #并发消费者初始化值
  136. #concurrency: 10
  137. #并发消费者的最大值
  138. #max-concurrency: 20
  139. #每个消费者每次监听时可拉取处理的消息数量
  140. prefetch: 5
  141. direct:
  142. retry:
  143. enabled: true
  144. max-attempts: 1
  145. flyway:
  146. # 是否启用flyway
  147. enabled: true
  148. # 指定表
  149. table: flyway_schema_history_admin
  150. # 禁止清理数据库表
  151. clean-disabled: true
  152. # 编码格式,默认UTF-8
  153. encoding: UTF-8
  154. # 迁移sql脚本文件存放路径,默认db/migration
  155. locations: classpath:db/migration
  156. # 迁移sql脚本文件名称的前缀,默认V
  157. sql-migration-prefix: V
  158. # 迁移sql脚本文件名称的分隔符,默认2个下划线__
  159. sql-migration-separator: _
  160. # 迁移sql脚本文件名称的后缀
  161. sql-migration-suffixes: .sql
  162. # 迁移时是否进行校验,默认true
  163. # validate-on-migrate: true
  164. # 当迁移发现数据库非空且存在没有元数据的表时,自动执行基准迁移,新建schema_version表
  165. baseline-on-migrate: true
  166. url: ${DB_URL:jdbc:postgresql://192.168.77.80:5432/mongo_grade}
  167. user: ${DB_USERNAME:postgres}
  168. password: ${DB_PASSWORD:123456}
  169. # 禁用描述校验(避免mismatch报错)
  170. validate-migration-naming: false
  171. # 或禁用整体校验(不推荐,会跳过版本/描述等所有校验)
  172. validate-on-migrate: false
  173. # MyBatis
  174. mybatis:
  175. # 搜索指定包别名
  176. typeAliasesPackage: com.poyee.common.po,com.poyee.**.domain
  177. # 配置mapper的扫描,找到所有的mapper.xml映射文件
  178. mapperLocations: classpath*:mapper/**/*Mapper.xml
  179. management:
  180. endpoints:
  181. web:
  182. exposure:
  183. include: "*" # 使用通配符启用所有端点
  184. base-path: /actuator
  185. endpoint:
  186. health:
  187. show-details: always
  188. enabled: true
  189. metrics:
  190. enabled: true
  191. prometheus:
  192. enabled: true
  193. info:
  194. enabled: true
  195. metrics:
  196. export:
  197. prometheus:
  198. enabled: true
  199. step: 30s
  200. descriptions: true
  201. enable:
  202. jvm: true
  203. system: true
  204. logback: true
  205. processor: true
  206. http: true
  207. hikaricp: true
  208. tags:
  209. application: order
  210. health:
  211. defaults.enabled: false
  212. db.enabled: true
  213. diskspace.enabled: true
  214. # knife4j 配置
  215. knife4j:
  216. # 是否开启 knife4j
  217. enabled: true
  218. #生产模式屏蔽
  219. production: true
  220. basic: #是否需要登录
  221. enable: true
  222. username: admin
  223. password: 123456
  224. pay:
  225. #微信支付
  226. wxpay:
  227. app:
  228. appID: wx8ee47a255776f241
  229. # 腾讯云COS配置
  230. tencent:
  231. cos:
  232. secret-id: ${TENCENT_COS_SECRET_ID:AKIDeCb2X834B3yz4EUdpzyoQoCRWUcm1JgT}
  233. secret-key: ${TENCENT_COS_SECRET_KEY:dXUSPLGHLSd58C6nGUTJySiyFUgrz236}
  234. region: ${TENCENT_COS_REGION:ap-shanghai}
  235. bucket-name: ${TENCENT_COS_BUCKET_NAME:ranking-1309648802}
  236. domain: ${TENCENT_COS_DOMAIN:https://your-domain.com}
  237. prefix: ${TENCENT_COS_PREFIX:/mongoo/rating/images/}
  238. max-file-size: ${TENCENT_COS_MAX_FILE_SIZE:10485760}
  239. allow-file-types: ${TENCENT_COS_ALLOW_FILE_TYPES:jpg,jpeg,png,gif,bmp,webp}
  240. generate-server-url:
  241. report: http://192.168.77.249:7755/api/rating/generate
  242. report-status: http://192.168.77.249:7755/api/cards/review_state
  243. score: http://192.168.77.249:7755/api/cards/card_list_filter
  244. batch-score: http://192.168.77.249:7755/api/cards/batch_query/id_score
  245. camera-server-url:
  246. start-task: http://192.168.31.191:7961/api/monitor/start_task
  247. stop-task: http://192.168.31.191:7961/api/monitor/stop_task
  248. query-task: http://192.168.31.191:7961/api/monitor/query_task
  249. # Feign客户端服务URL配置
  250. camera-service:
  251. url: http://192.168.31.191:7961
  252. generate-service:
  253. url: http://grade-service
  254. pay-service:
  255. url: http://192.168.77.249:7756
  256. coupon-service:
  257. url: http://coupon
  258. order-service:
  259. url: http://order
  260. # Feign配置
  261. feign:
  262. client:
  263. config:
  264. default:
  265. connectTimeout: 60000
  266. readTimeout: 60000
  267. loggerLevel: full
  268. # 物流api
  269. express:
  270. resultUrl: https://m2-dev.hobbystocks.cn/expressInfo/result
  271. flushTokenUrl: http://delivery/expressInfo/flushToken
  272. flushOrderUrl: http://delivery/expressInfo/flushOrder
  273. # Shiro
  274. shiro:
  275. user:
  276. # 登录地址
  277. loginUrl: /login
  278. # 权限认证失败地址
  279. unauthorizedUrl: /unauth
  280. # 首页地址
  281. indexUrl: /index
  282. # 验证码开关
  283. captchaEnabled: false
  284. # 验证码类型 math 数组计算 char 字符
  285. captchaType: math
  286. cookie:
  287. # 设置Cookie的域名 默认空,即当前访问的域名
  288. domain:
  289. # 设置cookie的有效访问路径
  290. path: /
  291. # 设置HttpOnly属性
  292. httpOnly: true
  293. # 设置Cookie的过期时间,天为单位
  294. maxAge: 30
  295. # 设置密钥,务必保持唯一性(生成方式,直接拷贝到main运行即可)KeyGenerator keygen = KeyGenerator.getInstance("AES"); SecretKey deskey = keygen.generateKey(); System.out.println(Base64.encodeToString(deskey.getEncoded()));
  296. cipherKey: zSyK5Kp6PZAAjlT+eeNMlg==
  297. session:
  298. # Session超时时间,-1代表永不过期(默认30分钟)
  299. expireTime: 480
  300. # 同步session到数据库的周期(默认1分钟)
  301. dbSyncPeriod: 1
  302. # 相隔多久检查一次session的有效性,默认就是10分钟
  303. validationInterval: 10
  304. # 同一个用户最大会话数,比如2的意思是同一个账号允许最多同时两个人登录(默认-1不限制)
  305. maxSession: 10
  306. # 踢出之前登录的/之后登录的用户,默认踢出之前登录的用户
  307. kickoutAfter: false
  308. # AI 智能助手
  309. ai:
  310. base-url: ${AI_GATEWAY_BASE_URL:https://sub2api.hobbystocks.cn}
  311. api-key: ${AI_GATEWAY_API_KEY:replace-me}
  312. model: ${AI_MODEL:claude-opus-4-8}
  313. max-tokens: 4096
  314. session-ttl-minutes: 30
  315. max-iterations: 5
  316. connect-timeout-ms: 10000
  317. read-timeout-ms: 120000
  318. # ratingApp 业务服务地址(AI 助手通过 Feign 远程调其订单/物流接口)
  319. rating-app:
  320. url: ${RATING_APP_URL:192.168.31.111:8091}
  321. # 评级时效推荐功能配置
  322. recommend:
  323. default-efficiency: 1
  324. batch-max: 50
  325. time-limit-mapping:
  326. "普通": 1
  327. "快速": 2
  328. "闪评": 3