随笔- 136  文章- 0  评论- 8  阅读- 26万 

1.总配置文件(其中都有注释)

复制代码
#公共配置
server:
    port: 80
    tomcat:
      uri-encoding: UTF-8

spring:
    #激活哪一个环境的配置文件
    profiles:
      active: dev
    #视图配置
    mvc:
      static-path-pattern: /static/**
  jackson: default-property-inclusion: non_null # 全局jackson配置
aop: proxy-target-class: true # devtools: # restart: # enabled: true #设置开启热部署 # additional-paths: src/main/java #重启目录 # exclude: WEB-INF/** thymeleaf: cache: false # datasource: # jdbc-url: jdbc:mysql://localhost:3306/comadmin?useUnicode=true&characterEncoding=utf8 # username: root # password: forever10000 # driver-class-name: com.mysql.jdbc.Driver # maximum-pool-size: 30 datasource: url: jdbc:oracle:thin:@192.168.137.200:1521:orcl username: sjzhc password: sjzhc driver-class-name: oracle.jdbc.driver.OracleDriver maximum-pool-size: 30 #mybatisPlu mybatis-plus: mapper-locations: classpath:/mapper/**/*Mapper.xml typeAliasesPackage: com.kexin.admin.entity.table global-config: key-generator: com.baomidou.mybatisplus.incrementer.OracleKeyGenerator db-config: #主键类型 mysql AUTO:"数据库ID自增", INPUT:"用户输入ID",ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; #主键类型 oracle 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", # id-type: AUTO #主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID"; id-type: 1 # Sequence序列接口实现类配置 # key-generator: com.baomidou.mybatisplus.incrementer.OracleKeyGenerator # id-type: UUID #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" field-strategy: not_empty #驼峰下划线转换 column-underline: true db-type: oracle # db-type: mysql #刷新mapper refresh-mapper: true #原生配置 configuration: #开启驼峰功能 map-underscore-to-camel-case: true cache-enabled: false jdbc-type-for-null: varchar #日志 logging: config: classpath:logback.xml path: D:\logs\comadmin --- #开发环境配置 spring: profiles: dev #自定义配置属性 #视图配置 mvc: static-path-pattern: /static/** aop: proxy-target-class: true # datasource: # url: jdbc:mysql://localhost:3306/comadmin?useUnicode=true&characterEncoding=utf8 # username: root # password: forever10000 # driver-class-name: com.mysql.jdbc.Driver # maximum-pool-size: 30 datasource: url: jdbc:oracle:thin:@192.168.137.200:1521:orcl username: sjzhc password: sjzhc driver-class-name: oracle.jdbc.driver.OracleDriver maximum-pool-size: 30 server: #端口 port: 80 --- #测试环境配置 spring: profiles: test #自定义配置属性 #视图配置 mvc: static-path-pattern: /static/** aop: proxy-target-class: true datasource: url: jdbc:mysql://localhost:3306/comadmin?useUnicode=true&characterEncoding=utf8 username: root password: cmh199410 driver-class-name: com.mysql.jdbc.Driver maximum-pool-size: 30 server: #端口 port: 8085 --- #生产环境配置 spring: profiles: pro datasource: url: jdbc:mysql://localhost:3306/comadmin?useUnicode=true&characterEncoding=utf8 username: root password: cmh199410 driver-class-name: com.mysql.jdbc.Driver maximum-pool-size: 30 server: port: 8080
复制代码

 

 posted on   wu小强  阅读(8218)  评论(0编辑  收藏  举报
编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
点击右上角即可分享
微信分享提示