application-common.yml 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. server:
  2. # undertow 配置
  3. undertow:
  4. # HTTP post内容的最大大小。当值为-1时,默认值为大小是无限的
  5. max-http-post-size: -1
  6. # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
  7. # 每块buffer的空间大小,越小的空间被利用越充分
  8. buffer-size: 512
  9. # 是否分配的直接内存
  10. direct-buffers: true
  11. threads:
  12. # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
  13. io: 8
  14. # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
  15. worker: 256
  16. dubbo:
  17. application:
  18. logger: slf4j
  19. # 元数据中心 local 本地 remote 远程 这里使用远程便于其他服务获取
  20. metadataType: remote
  21. # 可选值 interface、instance、all,默认是 all,即接口级地址、应用级地址都注册
  22. register-mode: instance
  23. service-discovery:
  24. # FORCE_INTERFACE,只消费接口级地址,如无地址则报错,单订阅 2.x 地址
  25. # APPLICATION_FIRST,智能决策接口级/应用级地址,双订阅
  26. # FORCE_APPLICATION,只消费应用级地址,如无地址则报错,单订阅 3.x 地址
  27. migration: FORCE_APPLICATION
  28. qos-enable: false
  29. protocol:
  30. # 设置为 tri 即可使用 Triple 3.0 新协议
  31. # 性能对比 dubbo 协议并没有提升 但基于 http2 用于多语言异构等 http 交互场景
  32. # 使用 dubbo 协议通信
  33. name: dubbo
  34. # dubbo 协议端口(-1表示自增端口,从20880开始)
  35. port: -1
  36. # 指定dubbo协议注册ip
  37. # host: 192.168.0.100
  38. # 注册中心配置
  39. registry:
  40. address: nacos://${spring.cloud.nacos.server-addr}
  41. group: DUBBO_GROUP
  42. parameters:
  43. namespace: ${spring.profiles.active}
  44. # 消费者相关配置
  45. consumer:
  46. # 结果缓存(LRU算法)
  47. # 会有数据不一致问题 建议在注解局部开启
  48. cache: false
  49. # 支持校验注解
  50. validation: true
  51. # 超时时间
  52. timeout: 3000
  53. # 初始化检查
  54. check: false
  55. scan:
  56. # 接口实现类扫描
  57. base-packages: com.nexo.**.dubbo
  58. # 自定义配置
  59. custom:
  60. # 全局请求log
  61. request-log: true
  62. # info 基础信息 param 参数信息 full 全部
  63. log-level: info
  64. spring:
  65. # 资源信息
  66. messages:
  67. # 国际化资源文件路径
  68. basename: i18n/messages
  69. servlet:
  70. multipart:
  71. # 整个请求大小限制
  72. max-request-size: 20MB
  73. # 上传单个文件大小限制
  74. max-file-size: 10MB
  75. mvc:
  76. format:
  77. date-time: yyyy-MM-dd HH:mm:ss
  78. #jackson配置
  79. jackson:
  80. # 日期格式化
  81. date-format: yyyy-MM-dd HH:mm:ss
  82. serialization:
  83. # 格式化输出
  84. INDENT_OUTPUT: false
  85. # 忽略无法转换的对象
  86. fail_on_empty_beans: false
  87. deserialization:
  88. # 允许对象忽略json中不存在的属性
  89. fail_on_unknown_properties: false
  90. cloud:
  91. # sentinel 配置
  92. sentinel:
  93. # sentinel 开关
  94. enabled: false
  95. # 取消控制台懒加载
  96. eager: true
  97. transport:
  98. # dashboard控制台服务名 用于服务发现
  99. # 如无此配置将默认使用下方 dashboard 配置直接注册
  100. server-name: nexo-sentinel-dashboard
  101. # 客户端指定注册的ip 用于多网卡ip不稳点使用
  102. # client-ip:
  103. # 控制台地址 从1.3.0开始使用 server-name 注册
  104. # dashboard: localhost:8718
  105. # redis通用配置 子服务可以自行配置进行覆盖
  106. redis:
  107. host: api.x-oa.cn
  108. port: 16379
  109. # 密码(如没有密码请注释掉)
  110. password: dbfb58d33ffd4fed89969b0900130475
  111. database: 0
  112. timeout: 10s
  113. ssl: false
  114. # redisson 配置
  115. redisson:
  116. # redis key前缀
  117. keyPrefix:
  118. # 线程池数量
  119. threads: 4
  120. # Netty线程池数量
  121. nettyThreads: 8
  122. # 单节点配置
  123. singleServerConfig:
  124. # 客户端名称
  125. clientName: ${spring.application.name}
  126. # 最小空闲连接数
  127. connectionMinimumIdleSize: 8
  128. # 连接池大小
  129. connectionPoolSize: 32
  130. # 连接空闲超时,单位:毫秒
  131. idleConnectionTimeout: 10000
  132. # 命令等待超时,单位:毫秒
  133. timeout: 3000
  134. # 发布和订阅连接池大小
  135. subscriptionConnectionPoolSize: 50
  136. # 分布式锁 lock4j 全局配置
  137. lock4j:
  138. # 获取分布式锁超时时间,默认为 3000 毫秒
  139. acquire-timeout: 3000
  140. # 分布式锁的超时时间,默认为 30 秒
  141. expire: 30000
  142. # 暴露监控端点
  143. management:
  144. endpoints:
  145. web:
  146. exposure:
  147. include: '*'
  148. endpoint:
  149. health:
  150. show-details: ALWAYS
  151. logfile:
  152. external-file: ./logs/${spring.application.name}/console.log
  153. # 日志配置
  154. logging:
  155. level:
  156. org.springframework: warn
  157. org.apache.dubbo: warn
  158. com.alibaba.nacos: warn
  159. config: classpath:logback-plus.xml
  160. # Sa-Token配置
  161. sa-token:
  162. # token名称 (同时也是cookie名称)
  163. token-name: Authorization
  164. # token有效期 设为一天 (必定过期) 单位: 秒
  165. timeout: 86400
  166. # 多端不同 token 有效期 可查看 LoginHelper.loginByDevice 方法自定义
  167. # token最低活跃时间 (指定时间无操作就过期) 单位: 秒
  168. active-timeout: 1800
  169. # 允许动态设置 token 有效期
  170. dynamic-active-timeout: true
  171. # 开启内网服务调用鉴权
  172. check-same-token: true
  173. # Same-Token的有效期 (单位: 秒)(默认一天)
  174. # same-token-timeout: 600
  175. # 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
  176. is-concurrent: true
  177. # 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
  178. is-share: false
  179. # 是否尝试从header里读取token
  180. is-read-header: true
  181. # 是否尝试从cookie里读取token
  182. is-read-cookie: false
  183. # token前缀
  184. token-prefix: "Bearer"
  185. # jwt秘钥
  186. jwt-secret-key: abcdefghijklmnopqrstuvwxyz
  187. # MyBatisPlus配置
  188. # https://baomidou.com/config/
  189. mybatis-plus:
  190. # 不支持多包, 如有需要可在注解配置 或 提升扫包等级
  191. # 例如 com.**.**.mapper
  192. mapperPackage: com.nexo.**.mapper
  193. # 对应的 XML 文件位置
  194. mapperLocations: classpath*:mapper/**/*Mapper.xml
  195. # 实体扫描,多个package用逗号或者分号分隔
  196. typeAliasesPackage: com.nexo.**.domain
  197. # 启动时是否检查 MyBatis XML 文件的存在,默认不检查
  198. checkConfigLocation: false
  199. configuration:
  200. # 自动驼峰命名规则(camel case)映射
  201. mapUnderscoreToCamelCase: true
  202. # MyBatis 自动映射策略
  203. # NONE:不启用 PARTIAL:只对非嵌套 resultMap 自动映射 FULL:对所有 resultMap 自动映射
  204. autoMappingBehavior: PARTIAL
  205. # MyBatis 自动映射时未知列或未知属性处理策
  206. # NONE:不做处理 WARNING:打印相关警告 FAILING:抛出异常和详细信息
  207. autoMappingUnknownColumnBehavior: NONE
  208. # 更详细的日志输出 会有性能损耗 org.apache.ibatis.logging.stdout.StdOutImpl
  209. # 关闭日志记录 (可单纯使用 p6spy 分析) org.apache.ibatis.logging.nologging.NoLoggingImpl
  210. # 默认日志输出 org.apache.ibatis.logging.slf4j.Slf4jImpl
  211. logImpl: org.apache.ibatis.logging.nologging.NoLoggingImpl
  212. global-config:
  213. # 是否打印 Logo banner
  214. banner: true
  215. dbConfig:
  216. # 主键类型
  217. # AUTO 自增 NONE 空 INPUT 用户输入 ASSIGN_ID 雪花 ASSIGN_UUID 唯一 UUID
  218. idType: ASSIGN_ID
  219. # 逻辑已删除值
  220. logicDeleteValue: 2
  221. # 逻辑未删除值
  222. logicNotDeleteValue: 0
  223. insertStrategy: NOT_NULL
  224. updateStrategy: NOT_NULL
  225. where-strategy: NOT_NULL
  226. # 数据加密
  227. mybatis-encryptor:
  228. # 是否开启加密
  229. enable: false
  230. # 默认加密算法
  231. algorithm: BASE64
  232. # 编码方式 BASE64/HEX。默认BASE64
  233. encode: BASE64
  234. # 安全秘钥 对称算法的秘钥 如:AES,SM4
  235. password:
  236. # 公私钥 非对称算法的公私钥 如:SM2,RSA
  237. publicKey:
  238. privateKey:
  239. springdoc:
  240. api-docs:
  241. # 是否开启接口文档
  242. enabled: true
  243. # swagger-ui:
  244. # # 持久化认证数据
  245. # persistAuthorization: true
  246. info:
  247. # 标题
  248. title: '标题:nexo-Cloud-Plus微服务权限管理系统_接口文档'
  249. # 描述
  250. description: '描述:微服务权限管理系统, 具体包括XXX,XXX模块...'
  251. # 版本
  252. version: '版本号:系统版本...'
  253. # 作者信息
  254. contact:
  255. name: Lion Li
  256. email: crazylionli@163.com
  257. url: https://gitee.com/dromara/nexo-Cloud-Plus
  258. components:
  259. # 鉴权方式配置
  260. security-schemes:
  261. apiKey:
  262. type: APIKEY
  263. in: HEADER
  264. name: ${sa-token.token-name}
  265. # 服务文档路径映射 参考 gateway router 配置
  266. # 默认为服务名去除前缀转换为path 此处填特殊的配置
  267. service-mapping:
  268. nexo-gen: /code
  269. # seata配置
  270. seata:
  271. # 默认关闭,如需启用spring.datasource.dynami.seata需要同时开启
  272. enabled: true
  273. # Seata 应用编号,默认为 ${spring.application.name}
  274. application-id: ${spring.application.name}
  275. # Seata 事务组编号,用于 TC 集群名
  276. tx-service-group: ${spring.application.name}-group
  277. config:
  278. type: nacos
  279. nacos:
  280. server-addr: ${spring.cloud.nacos.server-addr}
  281. group: ${spring.cloud.nacos.config.group}
  282. namespace: ${spring.profiles.active}
  283. data-id: seata-server.properties
  284. registry:
  285. type: nacos
  286. nacos:
  287. application: nexo-seata-server
  288. server-addr: ${spring.cloud.nacos.server-addr}
  289. group: ${spring.cloud.nacos.discovery.group}
  290. namespace: ${spring.profiles.active}