潘志宝
9 天以前 f93760ef25c2a15259b567c87db1f4900b0a42c2
提交 | 用户 | 时间
de0c05 1 --- #################### 注册中心 + 配置中心相关配置 ####################
a6de49 2 spring:
H 3   application:
bbc1ee 4     name: model-server
a6de49 5
H 6   profiles:
bbc1ee 7     active: @profiles.active@
4a47e4 8   cloud:
H 9     nacos:
10       server-addr: @nacos.server@ # Nacos 服务器地址
11       username: @nacos.username@
12       password: @nacos.password@
13       discovery: # 【配置中心】配置项
de0c05 14         namespace: @profiles.active@
4a47e4 15         group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
H 16         metadata:
17           version: @nacos.metadata.version@ # 服务实例的版本号,可用于灰度发布
18       config: # 【注册中心】配置项
de0c05 19         namespace: @profiles.active@
4a47e4 20         group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
a6de49 21
H 22   main:
23     allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。
24     allow-bean-definition-overriding: true # 允许 Bean 覆盖,例如说 Feign 等会存在重复定义的服务
25
26   config:
27     import:
28       - optional:classpath:application-${spring.profiles.active}.yaml # 加载【本地】配置
29       - optional:nacos:${spring.application.name}-${spring.profiles.active}.yaml # 加载【Nacos】的配置
30
31   # Servlet 配置
32   servlet:
33     # 文件上传相关配置项
34     multipart:
35       max-file-size: 16MB # 单个文件大小
36       max-request-size: 32MB # 设置总上传的文件大小
37   mvc:
38     pathmatch:
39       matching-strategy: ANT_PATH_MATCHER # 解决 SpringFox 与 SpringBoot 2.6.x 不兼容的问题,参见 SpringFoxHandlerProviderBeanPostProcessor 类
40
41   # Jackson 配置项
42   jackson:
43     serialization:
44       write-dates-as-timestamps: true # 设置 LocalDateTime 的格式,使用时间戳
45       write-date-timestamps-as-nanoseconds: false # 设置不使用 nanoseconds 的格式。例如说 1611460870.401,而是直接 1611460870401
46       write-durations-as-timestamps: true # 设置 Duration 的格式,使用时间戳
47       fail-on-empty-beans: false # 允许序列化无属性的 Bean
48
49   # Cache 配置项
50   cache:
51     type: REDIS
52     redis:
53       time-to-live: 1h # 设置过期时间为 1 小时
54
55 server:
56   port: 8983
57
58 logging:
59   file:
74191a 60     name: @log.path@/log/${spring.application.name}.log # 日志文件名,全路径
bbc1ee 61   level:
62     org:
63       springframework:
64         boot:
65           autoconfigure:
66             logging: info
a6de49 67
H 68 --- #################### 接口文档配置 ####################
69
70 springdoc:
71   api-docs:
72     enabled: true # 1. 是否开启 Swagger 接文档的元数据
73     path: /v3/api-docs
74   swagger-ui:
75     enabled: true # 2.1 是否开启 Swagger 文档的官方 UI 界面
76     path: /swagger-ui.html
bbc1ee 77   default-flat-param-object: true
a6de49 78
H 79 knife4j:
80   enable: true
81   basic:
82     enable: false
83     username: admin
84     password: admin
85   setting:
86     enableFooter: false
87
88 # MyBatis Plus 的配置项
89 mybatis-plus:
90   configuration:
91     map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
92   global-config:
93     db-config:
94       id-type: AUTO # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
95       #      id-type: AUTO # 自增 ID,适合 MySQL 等直接自增的数据库
96       #      id-type: INPUT # 用户输入 ID,适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库
97       #      id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解
98       logic-delete-value: 1 # 逻辑已删除值(默认为 1)
99       logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
100     banner: false # 关闭控制台的 Banner 打印
101   type-aliases-package: ${iailab.info.base-package}.*.entity
102   mapper-locations: classpath*:/mapper/**/*.xml
103   encryptor:
104     password: XDV71a+xqStEA3WH # 加解密的秘钥,可使用 https://www.imaegoo.com/2020/aes-key-generator/ 网站生成
105
106 mybatis-plus-join:
107   banner: false # 关闭控制台的 Banner 打印
108
109 # Spring Data Redis 配置
110 spring:
111   data:
112     redis:
113       repositories:
114         enabled: false # 项目未使用到 Spring Data Redis 的 Repository,所以直接禁用,保证启动速度
115
116 # VO 转换(数据翻译)相关
117 easy-trans:
118   is-enable-global: true # 启用全局翻译(拦截所有 SpringMVC ResponseBody 进行自动翻译 )。如果对于性能要求很高可关闭此配置,或通过 @IgnoreTrans 忽略某个接口
119   is-enable-cloud: false # 禁用 TransType.RPC 微服务模式
120
121 --- #################### RPC 远程调用相关配置 ####################
122
123 --- #################### 消息队列相关 ####################
124
125 # rocketmq 配置项,对应 RocketMQProperties 配置类
126 rocketmq:
127   # Producer 配置项
128   producer:
129     group: ${spring.application.name}_PRODUCER # 生产者分组
130
131 spring:
132   # Kafka 配置项,对应 KafkaProperties 配置类
133   kafka:
134     # Kafka Producer 配置项
135     producer:
136       acks: 1 # 0-不应答。1-leader 应答。all-所有 leader 和 follower 应答。
137       retries: 3 # 发送失败时,重试发送的次数
138       value-serializer: org.springframework.kafka.support.serializer.JsonSerializer # 消息的 value 的序列化
139     # Kafka Consumer 配置项
140     consumer:
141       auto-offset-reset: earliest # 设置消费者分组最初的消费进度为 earliest 。可参考博客 https://blog.csdn.net/lishuangzhe7047/article/details/74530417 理解
142       value-deserializer: org.springframework.kafka.support.serializer.JsonDeserializer
143       properties:
144         spring.json.trusted.packages: '*'
145     # Kafka Consumer Listener 监听器配置
146     listener:
147       missing-topics-fatal: false # 消费监听接口监听的主题不存在时,默认会报错。所以通过设置为 false ,解决报错
148
149
150 --- #################### 平台相关配置 ####################
151
152 iailab:
153   info:
154     version: 1.0.0
bbc1ee 155     base-package: com.iailab.module.model
a6de49 156   web:
H 157     admin-ui:
08e3e8 158       url:  # Admin 管理后台 UI 的地址
a6de49 159   swagger:
de0c05 160     title: 模型管理
161     description: 模型管理
a6de49 162     version: ${iailab.info.version}
H 163     base-package: ${iailab.info.base-package}
164   tenant: # 多租户相关配置项
bbc1ee 165     enable: true
166     ignore-tables:
167       - qrtz_blob_triggers
168       - qrtz_calendars
169       - qrtz_cron_triggers
170       - qrtz_fired_triggers
171       - qrtz_job_details
172       - qrtz_locks
173       - qrtz_paused_trigger_grps
174       - qrtz_scheduler_state
175       - qrtz_simple_triggers
176       - qrtz_simprop_triggers
177       - qrtz_triggers
178       - schedule_job
179       - schedule_job_log
c72ae4 180       - t_dm_module
181       - t_dm_module_item
182       - t_mm_item_output
183       - t_mm_item_type
184       - t_mm_model_arith_settings
185       - t_mm_model_param
186       - t_mm_model_resultstr
187       - t_mm_predict_item
188       - t_mm_predict_merge_item
189       - t_mm_predict_model
190       - t_mm_result_table
191       - t_mm_item_result_json
192       - t_mm_item_accuracy_rate
5b952f 193       - t_mm_item_accuracy_his
c72ae4 194       - t_mm_predict_alarm_config
195       - t_mm_predict_alarm_message
48c57b 196       - t_mm_sequence_num
c72ae4 197       - t_st_schedule_scheme
198       - t_st_schedule_model
199       - t_st_schedule_model_param
200       - t_st_schedule_model_setting
201       - t_st_schedule_suggest
202       - t_st_schedule_record
203       - t_st_schedule_record_detail
45952f 204       - t_st_schedule_model_out
77fc57 205       - t_st_adjust_config
L 206       - t_st_adjust_config_det
207       - t_st_adjust_result
de0c05 208       - t_mpk_file
209       - t_mpk_generator_code_history
210       - t_mpk_method_setting
211       - t_mpk_model_method
212       - t_mpk_project
213       - t_mpk_project_model
214       - t_mpk_project_package_history
215       - t_mpk_project_package_history_model
216       - t_mpk_setting_select
8b3ee3 217       - t_mpk_icon
218       - t_mpk_file_menu
219       - t_mpk_file_group
200ade 220       - t_chart_param
D 221       - t_chart
c7c5ab 222       - t_mpk_pack
4eb113 223       - t_mm_item_status
af72d8 224       - t_electricity_price_segmented
4218ec 225       - t_ml_model
D 226       - t_ml_model_method
227       - t_ml_model_method_setting
228       - t_ml_project
229       - t_ml_project_model
bbc1ee 230   app:
c72ae4 231     app-key: model
bbc1ee 232     app-secret: 85b0df7edc3df3611913df34ed695011
233     core-host: 127.0.0.1
a6de49 234
bbc1ee 235
236 debug: true