From f18ab3381c0ba6b80f4eaef0240e91ec6fd7d5de Mon Sep 17 00:00:00 2001 From: Parker Date: Mon, 14 Sep 2020 17:50:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-beta.yaml | 76 ++++----------- .../src/main/resources/application-dev.yaml | 62 ++---------- .../main/resources/application-release.yaml | 78 ++++----------- opsli-web/src/main/resources/application.yaml | 94 +++++++++++++++---- 4 files changed, 117 insertions(+), 193 deletions(-) diff --git a/opsli-web/src/main/resources/application-beta.yaml b/opsli-web/src/main/resources/application-beta.yaml index 7cc0f42a..2708cdf6 100644 --- a/opsli-web/src/main/resources/application-beta.yaml +++ b/opsli-web/src/main/resources/application-beta.yaml @@ -1,42 +1,22 @@ -## ---- 测试环境 ---- ## - +## ---- 开发环境 ---- ## +opsli: + # 前缀 + prefix: api + # 版本 + version: v1 # 端口设置 server: - port: 91 + port: 8080 spring: - # 邮件设置 - mail: - host: smtp.qq.com - username: meet.parker@foxmail.com - password: ?? - properties: - mail: - smpt: - auth: true - starttls: - enable: true - required: true -# ## quartz定时任务,采用数据库方式 -# quartz: -# job-store-type: jdbc - #redis 配置 redis: database: 0 host: 127.0.0.1 - lettuce: - pool: - max-active: 8 #最大连接数据库连接数,设 0 为没有限制 - max-idle: 8 #最大等待连接中的数量,设 0 为没有限制 - max-wait: -1ms #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。 - min-idle: 0 #最小等待连接中的数量,设 0 为没有限制 - shutdown-timeout: 100ms password: '123456' port: 6379 - # 数据库配置 datasource: # 数据库连接池监控 @@ -51,35 +31,11 @@ spring: allow: # IP 黑名单,若白名单也存在,则优先使用 deny: - web-stat-filter: - enabled: true - url-pattern: /* - exclusions: .js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/* # 多数据源 dynamic: - druid: - # 连接池的配置信息 - # 初始化大小,最小,最大 - initial-size: 5 - min-idle: 5 - maxActive: 20 - # 配置获取连接等待超时的时间 - maxWait: 60000 - # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 - timeBetweenEvictionRunsMillis: 60000 - # 配置一个连接在池中最小生存的时间,单位是毫秒 - minEvictableIdleTimeMillis: 300000 - validationQuery: SELECT 1 FROM DUAL - testWhileIdle: true - testOnBorrow: false - testOnReturn: false - # 打开PSCache,并且指定每个连接上PSCache的大小 - poolPreparedStatements: true - maxPoolPreparedStatementPerConnectionSize: 20 - # 配置监控统计拦截的 Filter,去掉后监控界面 SQL 无法统计,wall 用于防火墙 - filters: stat,wall,slf4j - # 通过connectProperties属性来打开mergeSql功能;慢SQL记录 - connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 + #主数据源 + #设置默认的数据源或者数据源组,默认值即为master,如果你主从默认下主库的名称就是master可不定义此项。 + #primary: master datasource: master: url: jdbc:mysql://127.0.0.1:3306/opsli-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false @@ -87,17 +43,17 @@ spring: password: 12345678 driver-class-name: com.mysql.jdbc.Driver # 多数据源配置 - #multi-datasource1: + #slave-datasource: #url: jdbc:mysql://localhost:3306/opsli-boot?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true #username: root - #password: root + #password: 12345678 #driver-class-name: com.mysql.jdbc.Driver #Mybatis输出sql日志 -logging: - level: - org.opsli.modulars.system.mapper : debug +#logging: +# level: +# org.opsli.modulars.system.mapper : debug # swagger 配置 swagger: - production: true \ No newline at end of file + production: false \ No newline at end of file diff --git a/opsli-web/src/main/resources/application-dev.yaml b/opsli-web/src/main/resources/application-dev.yaml index 92bd9b85..f2bf9bcc 100644 --- a/opsli-web/src/main/resources/application-dev.yaml +++ b/opsli-web/src/main/resources/application-dev.yaml @@ -1,43 +1,22 @@ ## ---- 开发环境 ---- ## opsli: + # 前缀 prefix: api + # 版本 version: v1 - # 端口设置 server: port: 8080 spring: - # 邮件设置 - mail: - host: smtp.qq.com - username: meet.parker@foxmail.com - password: pamjnijkjkqdbbea - properties: - mail: - smpt: - auth: true - starttls: - enable: true - required: true -# ## quartz定时任务,采用数据库方式 -# quartz: -# job-store-type: jdbc - #redis 配置 redis: database: 0 host: 127.0.0.1 - lettuce: - pool: - max-active: 8 #最大连接数据库连接数,设 0 为没有限制 - max-idle: 8 #最大等待连接中的数量,设 0 为没有限制 - max-wait: -1ms #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。 - min-idle: 0 #最小等待连接中的数量,设 0 为没有限制 - shutdown-timeout: 100ms password: '123456' port: 6379 + # 数据库配置 datasource: # 数据库连接池监控 @@ -52,35 +31,8 @@ spring: allow: # IP 黑名单,若白名单也存在,则优先使用 deny: - web-stat-filter: - enabled: true - url-pattern: /* - exclusions: .js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/* # 多数据源 dynamic: - druid: - # 连接池的配置信息 - # 初始化大小,最小,最大 - initial-size: 5 - min-idle: 5 - maxActive: 20 - # 配置获取连接等待超时的时间 - maxWait: 60000 - # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 - timeBetweenEvictionRunsMillis: 60000 - # 配置一个连接在池中最小生存的时间,单位是毫秒 - minEvictableIdleTimeMillis: 300000 - validationQuery: SELECT 1 FROM DUAL - testWhileIdle: true - testOnBorrow: false - testOnReturn: false - # 打开PSCache,并且指定每个连接上PSCache的大小 - poolPreparedStatements: true - maxPoolPreparedStatementPerConnectionSize: 20 - # 配置监控统计拦截的 Filter,去掉后监控界面 SQL 无法统计,wall 用于防火墙 - filters: stat,wall,slf4j - # 通过connectProperties属性来打开mergeSql功能;慢SQL记录 - connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 #主数据源 #设置默认的数据源或者数据源组,默认值即为master,如果你主从默认下主库的名称就是master可不定义此项。 #primary: master @@ -91,16 +43,16 @@ spring: password: 12345678 driver-class-name: com.mysql.jdbc.Driver # 多数据源配置 - #multi-datasource1: + #slave-datasource: #url: jdbc:mysql://localhost:3306/opsli-boot?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true #username: root #password: 12345678 #driver-class-name: com.mysql.jdbc.Driver #Mybatis输出sql日志 -logging: - level: - org.opsli.modulars.system.mapper : debug +#logging: +# level: +# org.opsli.modulars.system.mapper : debug # swagger 配置 swagger: diff --git a/opsli-web/src/main/resources/application-release.yaml b/opsli-web/src/main/resources/application-release.yaml index de089cdf..2708cdf6 100644 --- a/opsli-web/src/main/resources/application-release.yaml +++ b/opsli-web/src/main/resources/application-release.yaml @@ -1,42 +1,22 @@ -## ---- 正式环境 ---- ## - +## ---- 开发环境 ---- ## +opsli: + # 前缀 + prefix: api + # 版本 + version: v1 # 端口设置 server: - port: 81 + port: 8080 spring: - # 邮件设置 - mail: - host: smtp.qq.com - username: meet.parker@foxmail.com - password: ?? - properties: - mail: - smpt: - auth: true - starttls: - enable: true - required: true -# ## quartz定时任务,采用数据库方式 -# quartz: -# job-store-type: jdbc - #redis 配置 redis: database: 0 host: 127.0.0.1 - lettuce: - pool: - max-active: 8 #最大连接数据库连接数,设 0 为没有限制 - max-idle: 8 #最大等待连接中的数量,设 0 为没有限制 - max-wait: -1ms #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。 - min-idle: 0 #最小等待连接中的数量,设 0 为没有限制 - shutdown-timeout: 100ms password: '123456' port: 6379 - # 数据库配置 datasource: # 数据库连接池监控 @@ -46,40 +26,16 @@ spring: enabled: true # 登录用户名/密码 login-username: admin - login-password: SQL!@#0p9o8i7u + login-password: 123456 # IP 白名单,没有配置或者为空,则允许所有访问 allow: # IP 黑名单,若白名单也存在,则优先使用 deny: - web-stat-filter: - enabled: true - url-pattern: /* - exclusions: .js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/* # 多数据源 dynamic: - druid: - # 连接池的配置信息 - # 初始化大小,最小,最大 - initial-size: 5 - min-idle: 5 - maxActive: 20 - # 配置获取连接等待超时的时间 - maxWait: 60000 - # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 - timeBetweenEvictionRunsMillis: 60000 - # 配置一个连接在池中最小生存的时间,单位是毫秒 - minEvictableIdleTimeMillis: 300000 - validationQuery: SELECT 1 FROM DUAL - testWhileIdle: true - testOnBorrow: false - testOnReturn: false - # 打开PSCache,并且指定每个连接上PSCache的大小 - poolPreparedStatements: true - maxPoolPreparedStatementPerConnectionSize: 20 - # 配置监控统计拦截的 Filter,去掉后监控界面 SQL 无法统计,wall 用于防火墙 - filters: stat,wall,slf4j - # 通过connectProperties属性来打开mergeSql功能;慢SQL记录 - connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 + #主数据源 + #设置默认的数据源或者数据源组,默认值即为master,如果你主从默认下主库的名称就是master可不定义此项。 + #primary: master datasource: master: url: jdbc:mysql://127.0.0.1:3306/opsli-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false @@ -87,17 +43,17 @@ spring: password: 12345678 driver-class-name: com.mysql.jdbc.Driver # 多数据源配置 - #multi-datasource1: + #slave-datasource: #url: jdbc:mysql://localhost:3306/opsli-boot?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true #username: root - #password: root + #password: 12345678 #driver-class-name: com.mysql.jdbc.Driver #Mybatis输出sql日志 -logging: - level: - org.opsli.modulars.system.mapper : debug +#logging: +# level: +# org.opsli.modulars.system.mapper : debug # swagger 配置 swagger: - production: true \ No newline at end of file + production: false \ No newline at end of file diff --git a/opsli-web/src/main/resources/application.yaml b/opsli-web/src/main/resources/application.yaml index 1f004856..0810f679 100644 --- a/opsli-web/src/main/resources/application.yaml +++ b/opsli-web/src/main/resources/application.yaml @@ -1,6 +1,9 @@ # tomcat 配置 server: tomcat: + # Tomcat 编码 + uri-encoding: UTF-8 + # 对于 Tomcat 头清秀不限制大小 max-swallow-size: -1 servlet: context-path: /opsli-boot @@ -16,23 +19,6 @@ management: exposure: include: metrics,httptrace -#mybatis plus 设置 -mybatis-plus: - mapper-locations: classpath*:org/opsli/modulars/**/xml/*Mapper.xml - global-config: - # 关闭MP3.0自带的banner - banner: false - db-config: - #主键类型 0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)"; - id-type: 4 - # 默认数据库表下划线命名 - table-underline: true - configuration: - # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用 - #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl - # 返回类型为Map,显示null对应的字段 - call-setters-on-nulls: true - spring: profiles: #此处由maven的环境选择决定 @@ -55,6 +41,8 @@ spring: # 邮件设置 mail: host: smtp.qq.com + username: meet.parker@foxmail.com + password: pamjnijkjkqdbbea properties: mail: smpt: @@ -65,3 +53,75 @@ spring: required: true # 默认编码 default-encoding: UTF-8 + + #redis 配置 + redis: + lettuce: + pool: + max-active: 8 #最大连接数据库连接数,设 0 为没有限制 + max-idle: 8 #最大等待连接中的数量,设 0 为没有限制 + max-wait: -1ms #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。 + min-idle: 0 #最小等待连接中的数量,设 0 为没有限制 + shutdown-timeout: 100ms + + # 数据库配置 + datasource: + # 数据库连接池监控 + druid: + web-stat-filter: + enabled: true + url-pattern: /* + exclusions: .js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/* + + # 多数据源 + dynamic: + druid: + # 连接池的配置信息 + # 初始化大小,最小,最大 + initial-size: 5 + min-idle: 5 + maxActive: 20 + # 配置获取连接等待超时的时间 + maxWait: 60000 + # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 + timeBetweenEvictionRunsMillis: 60000 + # 配置一个连接在池中最小生存的时间,单位是毫秒 + minEvictableIdleTimeMillis: 300000 + validationQuery: SELECT 1 FROM DUAL + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + # 打开PSCache,并且指定每个连接上PSCache的大小 + poolPreparedStatements: true + maxPoolPreparedStatementPerConnectionSize: 20 + # 配置监控统计拦截的 Filter,去掉后监控界面 SQL 无法统计,wall 用于防火墙 + filters: stat,wall,slf4j + # 通过connectProperties属性来打开mergeSql功能;慢SQL记录 + connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 + +#mybatis-plus 插件 +mybatis-plus: + #所有的mapper映射文件 + mapper-locations: + - classpath*:org/opsli/modulars/**/mapper/xml/*.xml + # 实体扫描,多个package 继续往后跟 + typeAliasesPackage: + - org.opsli.modulars.**.entity + global-config: + # 关闭Banner + banner: false + db-config: + # 主键类型 id-type: + # 数据库ID自增 - auto | 0 未设置主键类型 - none | 1 手动输入ID - input | 2 数字类型唯一ID - assign_id | 3 唯一ID一UUID - assign_uuid | 4 + id-type: assign_id + logic-delete-field: deleted # 全局逻辑删除的实体字段名(since 3.3.0,配置后可以忽略不配置步骤2) + logic-delete-value: 1 # 逻辑已删除值(默认为 1) + logic-not-delete-value: 0 # 逻辑未删除值(默认为 0) + # 更新策略 - 防止更新 null 值到数据字段中 + update-strategy: not_empty + configuration: + map-underscore-to-camel-case: true + cache-enabled: false + call-setters-on-nulls: true + # 打印SQL 开发测试使用 生产关闭 *** + #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl \ No newline at end of file