application.yaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. spring:
  2. application:
  3. name: yudao-server
  4. profiles:
  5. active: local
  6. main:
  7. allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。
  8. # Servlet 配置
  9. servlet:
  10. # 文件上传相关配置项
  11. multipart:
  12. max-file-size: 16MB # 单个文件大小
  13. max-request-size: 32MB # 设置总上传的文件大小
  14. # Jackson 配置项
  15. jackson:
  16. serialization:
  17. write-dates-as-timestamps: true # 设置 Date 的格式,使用时间戳
  18. write-date-timestamps-as-nanoseconds: false # 设置不使用 nanoseconds 的格式。例如说 1611460870.401,而是直接 1611460870401
  19. write-durations-as-timestamps: true # 设置 Duration 的格式,使用时间戳
  20. fail-on-empty-beans: false # 允许序列化无属性的 Bean
  21. # Cache 配置项
  22. cache:
  23. type: REDIS
  24. redis:
  25. time-to-live: 1h # 设置过期时间为 1 小时
  26. server:
  27. servlet:
  28. encoding:
  29. enabled: true
  30. charset: UTF-8 # 必须设置 UTF-8,避免 WebFlux 流式返回(AI 场景)会乱码问题
  31. force: true
  32. --- #################### 接口文档配置 ####################
  33. springdoc:
  34. api-docs:
  35. enabled: true
  36. path: /v3/api-docs
  37. swagger-ui:
  38. enabled: true
  39. path: /swagger-ui
  40. default-flat-param-object: true # 参见 https://doc.xiaominfo.com/docs/faq/v4/knife4j-parameterobject-flat-param 文档
  41. knife4j:
  42. enable: true
  43. setting:
  44. language: zh_cn
  45. # 工作流 Flowable 配置
  46. flowable:
  47. # 1. false: 默认值,Flowable 启动时,对比数据库表中保存的版本,如果不匹配。将抛出异常
  48. # 2. true: 启动时会对数据库中所有表进行更新操作,如果表存在,不做处理,反之,自动创建表
  49. # 3. create_drop: 启动时自动创建表,关闭时自动删除表
  50. # 4. drop_create: 启动时,删除旧表,再创建新表
  51. database-schema-update: true # 设置为 false,可通过 https://github.com/flowable/flowable-sql 初始化
  52. db-history-used: true # flowable6 默认 true 生成信息表,无需手动设置
  53. check-process-definitions: false # 设置为 false,禁用 /resources/processes 自动部署 BPMN XML 流程
  54. history-level: audit # full:保存历史数据的最高级别,可保存全部流程相关细节,包括流程流转各节点参数
  55. # MyBatis Plus 的配置项
  56. mybatis-plus:
  57. configuration:
  58. map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
  59. global-config:
  60. db-config:
  61. id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
  62. # id-type: AUTO # 自增 ID,适合 MySQL 等直接自增的数据库
  63. # id-type: INPUT # 用户输入 ID,适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库
  64. # id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解
  65. logic-delete-value: 1 # 逻辑已删除值(默认为 1)
  66. logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
  67. banner: false # 关闭控制台的 Banner 打印
  68. type-aliases-package: ${yudao.info.base-package}.module.*.dal.dataobject
  69. encryptor:
  70. password: XDV71a+xqStEA3WH # 加解密的秘钥,可使用 https://www.imaegoo.com/2020/aes-key-generator/ 网站生成
  71. mybatis-plus-join:
  72. banner: false # 是否打印 mybatis plus join banner,默认true
  73. sub-table-logic: true # 全局启用副表逻辑删除,默认true。关闭后关联查询不会加副表逻辑删除
  74. ms-cache: true # 拦截器MappedStatement缓存,默认 true
  75. table-alias: t # 表别名(默认 t)
  76. logic-del-type: on # 副表逻辑删除条件的位置,支持 WHERE、ON,默认 ON
  77. # Spring Data Redis 配置
  78. spring:
  79. data:
  80. redis:
  81. repositories:
  82. enabled: false # 项目未使用到 Spring Data Redis 的 Repository,所以直接禁用,保证启动速度
  83. # VO 转换(数据翻译)相关
  84. easy-trans:
  85. is-enable-global: true # 启用全局翻译(拦截所有 SpringMVC ResponseBody 进行自动翻译 )。如果对于性能要求很高可关闭此配置,或通过 @IgnoreTrans 忽略某个接口
  86. --- #################### 验证码相关配置 ####################
  87. aj:
  88. captcha:
  89. jigsaw: classpath:images/jigsaw # 滑动验证,底图路径,不配置将使用默认图片;以 classpath: 开头,取 resource 目录下路径
  90. pic-click: classpath:images/pic-click # 滑动验证,底图路径,不配置将使用默认图片;以 classpath: 开头,取 resource 目录下路径
  91. cache-type: redis # 缓存 local/redis...
  92. cache-number: 1000 # local 缓存的阈值,达到这个值,清除缓存
  93. timing-clear: 180 # local定时清除过期缓存(单位秒),设置为0代表不执行
  94. type: blockPuzzle # 验证码类型 default两种都实例化。 blockPuzzle 滑块拼图 clickWord 文字点选
  95. water-mark: 芋道源码 # 右下角水印文字(我的水印),可使用 https://tool.chinaz.com/tools/unicode.aspx 中文转 Unicode,Linux 可能需要转 unicode
  96. interference-options: 0 # 滑动干扰项(0/1/2)
  97. req-frequency-limit-enable: false # 接口请求次数一分钟限制是否开启 true|false
  98. req-get-lock-limit: 5 # 验证失败 5 次,get接口锁定
  99. req-get-lock-seconds: 10 # 验证失败后,锁定时间间隔
  100. req-get-minute-limit: 30 # get 接口一分钟内请求数限制
  101. req-check-minute-limit: 60 # check 接口一分钟内请求数限制
  102. req-verify-minute-limit: 60 # verify 接口一分钟内请求数限制
  103. --- #################### 消息队列相关 ####################
  104. # rocketmq 配置项,对应 RocketMQProperties 配置类
  105. rocketmq:
  106. # Producer 配置项
  107. producer:
  108. group: ${spring.application.name}_PRODUCER # 生产者分组
  109. spring:
  110. # Kafka 配置项,对应 KafkaProperties 配置类
  111. kafka:
  112. # Kafka Producer 配置项
  113. producer:
  114. acks: 1 # 0-不应答。1-leader 应答。all-所有 leader 和 follower 应答。
  115. retries: 3 # 发送失败时,重试发送的次数
  116. value-serializer: org.springframework.kafka.support.serializer.JsonSerializer # 消息的 value 的序列化
  117. # Kafka Consumer 配置项
  118. consumer:
  119. auto-offset-reset: earliest # 设置消费者分组最初的消费进度为 earliest 。可参考博客 https://blog.csdn.net/lishuangzhe7047/article/details/74530417 理解
  120. value-deserializer: org.springframework.kafka.support.serializer.JsonDeserializer
  121. properties:
  122. spring.json.trusted.packages: '*'
  123. # Kafka Consumer Listener 监听器配置
  124. listener:
  125. missing-topics-fatal: false # 消费监听接口监听的主题不存在时,默认会报错。所以通过设置为 false ,解决报错
  126. --- #################### AI 相关配置 ####################
  127. spring:
  128. ai:
  129. vectorstore: # 向量存储
  130. redis:
  131. index: default-index
  132. prefix: "default:"
  133. embedding:
  134. transformer:
  135. onnx:
  136. model-uri: https://raw.gitcode.com/yudaocode/yudao-demo/raw/master/yudao-static/ai/model.onnx
  137. tokenizer:
  138. uri: https://raw.gitcode.com/yudaocode/yudao-demo/raw/master/yudao-static/ai/tokenizer.json
  139. qianfan: # 文心一言
  140. api-key: x0cuLZ7XsaTCU08vuJWO87Lg
  141. secret-key: R9mYF9dl9KASgi5RUq0FQt3wRisSnOcK
  142. zhipuai: # 智谱 AI
  143. api-key: 32f84543e54eee31f8d56b2bd6020573.3vh9idLJZ2ZhxDEs
  144. openai: # OpenAI 官方
  145. api-key: sk-yzKea6d8e8212c3bdd99f9f44ced1cae37c097e5aa3BTS7z
  146. base-url: https://api.gptsapi.net
  147. azure: # OpenAI 微软
  148. openai:
  149. endpoint: https://eastusprejade.openai.azure.com
  150. api-key: xxx
  151. ollama:
  152. base-url: http://127.0.0.1:11434
  153. chat:
  154. model: llama3
  155. stabilityai:
  156. api-key: sk-e53UqbboF8QJCscYvzJscJxJXoFcFg4iJjl1oqgE7baJETmx
  157. cloud:
  158. ai:
  159. tongyi: # 通义千问
  160. tongyi:
  161. api-key: sk-Zsd81gZYg7
  162. yudao:
  163. ai:
  164. deep-seek: # DeepSeek
  165. enable: true
  166. api-key: sk-e94db327cc7d457d99a8de8810fc6b12
  167. model: deepseek-chat
  168. xinghuo: # 讯飞星火
  169. enable: true
  170. appId: 13c8cca6
  171. appKey: cb6415c19d6162cda07b47316fcb0416
  172. secretKey: Y2JiYTIxZjA3MDMxMjNjZjQzYzVmNzdh
  173. model: generalv3.5
  174. midjourney:
  175. enable: true
  176. # base-url: https://api.holdai.top/mj-relax/mj
  177. base-url: https://api.holdai.top/mj
  178. api-key: sk-dZEPiVaNcT3FHhef51996bAa0bC74806BeAb620dA5Da10Bf
  179. notify-url: http://java.nat300.top/admin-api/ai/image/midjourney/notify
  180. suno:
  181. enable: true
  182. # base-url: https://suno-55ishh05u-status2xxs-projects.vercel.app
  183. base-url: http://127.0.0.1:3001
  184. --- #################### 芋道相关配置 ####################
  185. yudao:
  186. info:
  187. version: 1.0.0
  188. base-package: cn.iocoder.yudao
  189. web:
  190. admin-ui:
  191. url: http://dashboard.yudao.iocoder.cn # Admin 管理后台 UI 的地址
  192. xss:
  193. enable: false
  194. exclude-urls: # 如下两个 url,仅仅是为了演示,去掉配置也没关系
  195. - ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求
  196. - ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求
  197. security:
  198. permit-all_urls:
  199. - /admin-api/mp/open/** # 微信公众号开放平台,微信回调接口,不需要登录
  200. websocket:
  201. enable: true # websocket的开关
  202. path: /infra/ws # 路径
  203. sender-type: local # 消息发送的类型,可选值为 local、redis、rocketmq、kafka、rabbitmq
  204. sender-rocketmq:
  205. topic: ${spring.application.name}-websocket # 消息发送的 RocketMQ Topic
  206. consumer-group: ${spring.application.name}-websocket-consumer # 消息发送的 RocketMQ Consumer Group
  207. sender-rabbitmq:
  208. exchange: ${spring.application.name}-websocket-exchange # 消息发送的 RabbitMQ Exchange
  209. queue: ${spring.application.name}-websocket-queue # 消息发送的 RabbitMQ Queue
  210. sender-kafka:
  211. topic: ${spring.application.name}-websocket # 消息发送的 Kafka Topic
  212. consumer-group: ${spring.application.name}-websocket-consumer # 消息发送的 Kafka Consumer Group
  213. swagger:
  214. title: 芋道快速开发平台
  215. description: 提供管理后台、用户 App 的所有功能
  216. version: ${yudao.info.version}
  217. url: ${yudao.web.admin-ui.url}
  218. email: xingyu4j@vip.qq.com
  219. license: MIT
  220. license-url: https://gitee.com/zhijiantianya/ruoyi-vue-pro/blob/master/LICENSE
  221. codegen:
  222. base-package: ${yudao.info.base-package}
  223. db-schemas: ${spring.datasource.dynamic.datasource.master.name}
  224. front-type: 20 # 前端模版的类型,参见 CodegenFrontTypeEnum 枚举类
  225. tenant: # 多租户相关配置项
  226. enable: true
  227. ignore-urls:
  228. - /admin-api/system/tenant/get-id-by-name # 基于名字获取租户,不许带租户编号
  229. - /admin-api/system/tenant/get-by-website # 基于域名获取租户,不许带租户编号
  230. - /admin-api/system/captcha/get # 获取图片验证码,和租户无关
  231. - /admin-api/system/captcha/check # 校验图片验证码,和租户无关
  232. - /admin-api/infra/file/*/get/** # 获取图片,和租户无关
  233. - /admin-api/system/sms/callback/* # 短信回调接口,无法带上租户编号
  234. - /admin-api/pay/notify/** # 支付回调通知,不携带租户编号
  235. - /jmreport/* # 积木报表,无法携带租户编号
  236. - /admin-api/mp/open/** # 微信公众号开放平台,微信回调接口,无法携带租户编号
  237. ignore-tables:
  238. - system_tenant
  239. - system_tenant_package
  240. - system_dict_data
  241. - system_dict_type
  242. - system_error_code
  243. - system_menu
  244. - system_sms_channel
  245. - system_sms_template
  246. - system_sms_log
  247. - system_sensitive_word
  248. - system_oauth2_client
  249. - system_mail_account
  250. - system_mail_template
  251. - system_mail_log
  252. - system_notify_template
  253. - infra_codegen_column
  254. - infra_codegen_table
  255. - infra_config
  256. - infra_file_config
  257. - infra_file
  258. - infra_file_content
  259. - infra_job
  260. - infra_job_log
  261. - infra_job_log
  262. - infra_data_source_config
  263. - jimu_dict
  264. - jimu_dict_item
  265. - jimu_report
  266. - jimu_report_data_source
  267. - jimu_report_db
  268. - jimu_report_db_field
  269. - jimu_report_db_param
  270. - jimu_report_link
  271. - jimu_report_map
  272. - jimu_report_share
  273. - rep_demo_dxtj
  274. - rep_demo_employee
  275. - rep_demo_gongsi
  276. - rep_demo_jianpiao
  277. - tmp_report_data_1
  278. - tmp_report_data_income
  279. ignore-caches:
  280. - user_role_ids
  281. - permission_menu_ids
  282. - oauth_client
  283. - notify_template
  284. - mail_account
  285. - mail_template
  286. - sms_template
  287. sms-code: # 短信验证码相关的配置项
  288. expire-times: 10m
  289. send-frequency: 1m
  290. send-maximum-quantity-per-day: 10
  291. begin-code: 9999 # 这里配置 9999 的原因是,测试方便。
  292. end-code: 9999 # 这里配置 9999 的原因是,测试方便。
  293. trade:
  294. order:
  295. pay-expire-time: 2h # 支付的过期时间
  296. receive-expire-time: 14d # 收货的过期时间
  297. comment-expire-time: 7d # 评论的过期时间
  298. express:
  299. client: kd_niao
  300. kd-niao:
  301. api-key: cb022f1e-48f1-4c4a-a723-9001ac9676b8
  302. business-id: 1809751
  303. kd100:
  304. key: pLXUGAwK5305
  305. customer: E77DF18BE109F454A5CD319E44BF5177
  306. debug: false