--- #################### 注册ä¸å¿ƒ + é…ç½®ä¸å¿ƒç›¸å…³é…ç½® #################### spring: application: name: model-server profiles: active: @profiles.active@ cloud: nacos: server-addr: @nacos.server@ # Nacos æœåŠ¡å™¨åœ°å€ username: @nacos.username@ password: @nacos.password@ discovery: # ã€é…ç½®ä¸å¿ƒã€‘é…置项 namespace: @profiles.active@ group: DEFAULT_GROUP # 使用的 Nacos é…置分组,默认为 DEFAULT_GROUP metadata: version: @nacos.metadata.version@ # æœåŠ¡å®žä¾‹çš„版本å·ï¼Œå¯ç”¨äºŽç°åº¦å‘布 config: # ã€æ³¨å†Œä¸å¿ƒã€‘é…置项 namespace: @profiles.active@ group: DEFAULT_GROUP # 使用的 Nacos é…置分组,默认为 DEFAULT_GROUP main: allow-circular-references: true # å…许循环ä¾èµ–ï¼Œå› ä¸ºé¡¹ç›®æ˜¯ä¸‰å±‚æž¶æž„ï¼Œæ— æ³•é¿å…这个情况。 allow-bean-definition-overriding: true # å…许 Bean 覆盖,例如说 Feign ç‰ä¼šå˜åœ¨é‡å¤å®šä¹‰çš„æœåŠ¡ config: import: - optional:classpath:application-${spring.profiles.active}.yaml # åŠ è½½ã€æœ¬åœ°ã€‘é…ç½® - optional:nacos:${spring.application.name}-${spring.profiles.active}.yaml # åŠ è½½ã€Nacos】的é…ç½® # Servlet é…ç½® servlet: # æ–‡ä»¶ä¸Šä¼ ç›¸å…³é…置项 multipart: max-file-size: 16MB # å•ä¸ªæ–‡ä»¶å¤§å° max-request-size: 32MB # è®¾ç½®æ€»ä¸Šä¼ çš„æ–‡ä»¶å¤§å° mvc: pathmatch: matching-strategy: ANT_PATH_MATCHER # 解决 SpringFox 与 SpringBoot 2.6.x ä¸å…¼å®¹çš„问题,å‚è§ SpringFoxHandlerProviderBeanPostProcessor ç±» # Jackson é…置项 jackson: serialization: write-dates-as-timestamps: true # 设置 LocalDateTime çš„æ ¼å¼ï¼Œä½¿ç”¨æ—¶é—´æˆ³ write-date-timestamps-as-nanoseconds: false # 设置ä¸ä½¿ç”¨ nanoseconds çš„æ ¼å¼ã€‚例如说 1611460870.401,而是直接 1611460870401 write-durations-as-timestamps: true # 设置 Duration çš„æ ¼å¼ï¼Œä½¿ç”¨æ—¶é—´æˆ³ fail-on-empty-beans: false # å…许åºåˆ—åŒ–æ— å±žæ€§çš„ Bean # Cache é…置项 cache: type: REDIS redis: time-to-live: 1h # 设置过期时间为 1 å°æ—¶ server: port: 8983 logging: file: name: @log.path@/logs/${spring.application.name}.log # 日志文件å,全路径 level: org: springframework: boot: autoconfigure: logging: info --- #################### 接å£æ–‡æ¡£é…ç½® #################### springdoc: api-docs: enabled: true # 1. 是å¦å¼€å¯ Swagger æŽ¥æ–‡æ¡£çš„å…ƒæ•°æ® path: /v3/api-docs swagger-ui: enabled: true # 2.1 是å¦å¼€å¯ Swagger 文档的官方 UI ç•Œé¢ path: /swagger-ui.html default-flat-param-object: true knife4j: enable: true basic: enable: false username: admin password: admin setting: enableFooter: false # MyBatis Plus çš„é…置项 mybatis-plus: configuration: map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。 global-config: db-config: id-type: AUTO # “智能â€æ¨¡å¼ï¼ŒåŸºäºŽ IdTypeEnvironmentPostProcessor + æ•°æ®æºçš„类型,自动适é…æˆ AUTOã€INPUT 模å¼ã€‚ # id-type: AUTO # 自增 IDï¼Œé€‚åˆ MySQL ç‰ç›´æŽ¥è‡ªå¢žçš„æ•°æ®åº“ # id-type: INPUT # 用户输入 IDï¼Œé€‚åˆ Oracleã€PostgreSQLã€Kingbaseã€DB2ã€H2 æ•°æ®åº“ # id-type: ASSIGN_ID # åˆ†é… ID,默认使用雪花算法。注æ„,Oracleã€PostgreSQLã€Kingbaseã€DB2ã€H2 æ•°æ®åº“时,需è¦åŽ»é™¤å®žä½“类上的 @KeySequence 注解 logic-delete-value: 1 # é€»è¾‘å·²åˆ é™¤å€¼(默认为 1) logic-not-delete-value: 0 # é€»è¾‘æœªåˆ é™¤å€¼(默认为 0) banner: false # å…³é—控制å°çš„ Banner æ‰“å° type-aliases-package: ${iailab.info.base-package}.*.entity mapper-locations: classpath*:/mapper/**/*.xml encryptor: password: XDV71a+xqStEA3WH # åŠ è§£å¯†çš„ç§˜é’¥ï¼Œå¯ä½¿ç”¨ https://www.imaegoo.com/2020/aes-key-generator/ ç½‘ç«™ç”Ÿæˆ mybatis-plus-join: banner: false # å…³é—控制å°çš„ Banner æ‰“å° # Spring Data Redis é…ç½® spring: data: redis: repositories: enabled: false # 项目未使用到 Spring Data Redis çš„ Repository,所以直接ç¦ç”¨ï¼Œä¿è¯å¯åŠ¨é€Ÿåº¦ # VO 转æ¢ï¼ˆæ•°æ®ç¿»è¯‘)相关 easy-trans: is-enable-global: true # å¯ç”¨å…¨å±€ç¿»è¯‘(拦截所有 SpringMVC ResponseBody 进行自动翻译 )。如果对于性能è¦æ±‚很高å¯å…³é—æ¤é…置,或通过 @IgnoreTrans 忽略æŸä¸ªæŽ¥å£ is-enable-cloud: false # ç¦ç”¨ TransType.RPC å¾®æœåŠ¡æ¨¡å¼ --- #################### RPC 远程调用相关é…ç½® #################### --- #################### 消æ¯é˜Ÿåˆ—相关 #################### # rocketmq é…置项,对应 RocketMQProperties é…置类 rocketmq: # Producer é…置项 producer: group: ${spring.application.name}_PRODUCER # 生产者分组 spring: # Kafka é…置项,对应 KafkaProperties é…置类 kafka: # Kafka Producer é…置项 producer: acks: 1 # 0-ä¸åº”ç”。1-leader 应ç”。all-所有 leader å’Œ follower 应ç”。 retries: 3 # å‘é€å¤±è´¥æ—¶ï¼Œé‡è¯•å‘é€çš„次数 value-serializer: org.springframework.kafka.support.serializer.JsonSerializer # 消æ¯çš„ value çš„åºåˆ—化 # Kafka Consumer é…置项 consumer: auto-offset-reset: earliest # 设置消费者分组最åˆçš„消费进度为 earliest 。å¯å‚考åšå®¢ https://blog.csdn.net/lishuangzhe7047/article/details/74530417 ç†è§£ value-deserializer: org.springframework.kafka.support.serializer.JsonDeserializer properties: spring.json.trusted.packages: '*' # Kafka Consumer Listener 监å¬å™¨é…ç½® listener: missing-topics-fatal: false # 消费监å¬æŽ¥å£ç›‘å¬çš„主题ä¸å˜åœ¨æ—¶ï¼Œé»˜è®¤ä¼šæŠ¥é”™ã€‚所以通过设置为 false ,解决报错 --- #################### å¹³å°ç›¸å…³é…ç½® #################### iailab: info: version: 1.0.0 base-package: com.iailab.module.model web: admin-ui: url: # Admin 管ç†åŽå° UI çš„åœ°å€ swagger: title: æ¨¡åž‹ç®¡ç† description: æ¨¡åž‹ç®¡ç† version: ${iailab.info.version} base-package: ${iailab.info.base-package} tenant: # 多租户相关é…置项 enable: true ignore-tables: - qrtz_blob_triggers - qrtz_calendars - qrtz_cron_triggers - qrtz_fired_triggers - qrtz_job_details - qrtz_locks - qrtz_paused_trigger_grps - qrtz_scheduler_state - qrtz_simple_triggers - qrtz_simprop_triggers - qrtz_triggers - schedule_job - schedule_job_log - t_dm_module - t_dm_module_item - t_mm_item_output - t_mm_item_result - t_mm_item_type - t_mm_model_arith_settings - t_mm_model_param - t_mm_model_resultstr - t_mm_predict_item - t_mm_predict_merge_item - t_mm_predict_model - t_mm_result_table - t_mm_item_result_json - t_mm_item_result_last_point - t_mm_item_accuracy_rate - t_mm_predict_alarm_config - t_mm_predict_alarm_message - t_mm_sequence_num - t_st_schedule_scheme - t_st_schedule_model - t_st_schedule_model_param - t_st_schedule_model_setting - t_st_schedule_suggest - t_st_schedule_record - t_st_schedule_record_detail - t_mpk_file - t_mpk_generator_code_history - t_mpk_method_setting - t_mpk_model_method - t_mpk_project - t_mpk_project_model - t_mpk_project_package_history - t_mpk_project_package_history_model - t_mpk_setting_select - t_mpk_icon - t_mpk_file_menu - t_mpk_file_group - t_chart_param - t_chart - t_mpk_pack - t_mm_item_status app: app-key: model app-secret: 85b0df7edc3df3611913df34ed695011 core-host: 127.0.0.1 debug: true