diff --git a/pom.xml b/pom.xml index 5ffbd55..b4ae482 100644 --- a/pom.xml +++ b/pom.xml @@ -48,6 +48,18 @@ 1.18.28 + + com.alibaba + druid-spring-boot-starter + 1.2.19 + + + + com.baomidou + mybatis-plus-boot-starter + 3.5.3.2 + + org.springframework.boot spring-boot-starter diff --git a/src/main/java/com/win/qad/config/ShellConfig.java b/src/main/java/com/win/qad/config/ShellConfig.java index c137845..80392a8 100644 --- a/src/main/java/com/win/qad/config/ShellConfig.java +++ b/src/main/java/com/win/qad/config/ShellConfig.java @@ -1,17 +1,30 @@ package com.win.qad.config; -import com.win.qad.utils.shell.ShellVo; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; @Data @Component -@ConfigurationProperties(prefix = "shell") +@ConfigurationProperties(prefix = "shell.jlht") public class ShellConfig { - //linux配置信息 - private ShellVo jlht; - private ShellVo jlht2; + private String qadDomain; + + private String companyCode; + + private String serverId; + + private String ip; + + private Integer port; + + private String linuxId; + + private String linuxPassword; + + private String qadUser; + + private String qadPassword; } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index d5c3d75..c2fbfa8 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -16,6 +16,17 @@ server: # Tomcat启动初始化的线程数,默认值10 min-spare: 10 +spring: + autoconfigure: + exclude: + - com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源 + datasource: + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://dev.ccwin-in.com:23113/qad_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: learun + password: Microdoft@2021 + # 日志配置 logging: file: diff --git a/src/main/resources/application-druid.yml b/src/main/resources/application-druid.yml new file mode 100644 index 0000000..d6479cc --- /dev/null +++ b/src/main/resources/application-druid.yml @@ -0,0 +1,47 @@ +# 数据源配置 +spring: + datasource: + druid: + # 初始连接数 + initialSize: 20 + # 最小连接池数量 + minIdle: 20 + # 最大连接池数量 + maxActive: 200 + # 配置获取连接等待超时的时间 + maxWait: 60000 + # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 + timeBetweenEvictionRunsMillis: 60000 + # 配置一个连接在池中最小生存的时间,单位是毫秒 + minEvictableIdleTimeMillis: 300000 + # 配置一个连接在池中最大生存的时间,单位是毫秒 + maxEvictableIdleTimeMillis: 900000 + # 配置检测连接是否有效 + validationQuery: SELECT 1 FROM DUAL + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + webStatFilter: + enabled: false + url-pattern: /* # 过滤所有url + exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*" # 排除一些不必要的url + session-stat-enable: true # 开启session统计功能 + session-stat-max-count: 1000 # session的最大个数,默认100 + statViewServlet: + enabled: true + # 设置白名单,不填则允许所有访问 + allow: + url-pattern: /druid/* + # 控制台管理用户名和密码 + login-username: win + login-password: 123456 + filter: + stat: + enabled: true + # 慢SQL记录 + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: true + wall: + config: + multi-statement-allow: true \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 1b99bab..6c3ef23 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -2,6 +2,7 @@ spring: application: name: win profiles: + include: druid active: dev main: allow-bean-definition-overriding: true @@ -9,4 +10,24 @@ spring: multipart: enabled: true max-file-size: 200MB - max-request-size: 1000MB \ No newline at end of file + max-request-size: 1000MB + +# MyBatis Plus 的配置项 +mybatis-plus: + configuration: + map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。 + logImpl: org.apache.ibatis.logging.slf4j.Slf4jImpl + # 开启缓存 + cache-enabled: true + global-config: + db-config: + id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。 + logic-delete-value: 1 # 逻辑已删除值(默认为 1) + logic-not-delete-value: 0 # 逻辑未删除值(默认为 0) + banner: false # 关闭控制台的 Banner 打印 + type-aliases-package: com.win.dao + encryptor: + password: XDV71a+xqStEA3WH # 加解密的秘钥,可使用 https://www.imaegoo.com/2020/aes-key-generator/ 网站生成 + +mybatis-plus-join: + banner: false # 关闭控制台的 Banner 打印 diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml index 66fd880..52957b7 100644 --- a/src/main/resources/logback-spring.xml +++ b/src/main/resources/logback-spring.xml @@ -27,6 +27,29 @@ + + + ${log.path}/sys-debug.log + + + + ${log.path}/sys-debug.%d{yyyy-MM-dd}.log + + 7 + + + ${log.pattern} + + + + DEBUG + + ACCEPT + + DENY + + + ${log.path}/sys-info.log @@ -34,8 +57,8 @@ ${log.path}/sys-info.%d{yyyy-MM-dd}.log - - 60 + + 7 ${log.pattern} @@ -50,21 +73,22 @@ - - ${log.path}/sys-error.log + + + ${log.path}/sys-warn.log - ${log.path}/sys-error.%d{yyyy-MM-dd}.log - - 60 + ${log.path}/sys-warn.%d{yyyy-MM-dd}.log + + 7 ${log.pattern} - ERROR + WARN ACCEPT @@ -72,37 +96,68 @@ - - - ${log.path}/sys-user.log + + ${log.path}/sys-error.log + - - ${log.path}/sys-user.%d{yyyy-MM-dd}.log - - 60 + + ${log.path}/sys-error.%d{yyyy-MM-dd}.log + + 7 ${log.pattern} + + + ERROR + + ACCEPT + + DENY + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - \ No newline at end of file