diff --git a/auth-center/src/main/resources/application.yml b/auth-center/src/main/resources/application.yml index f9073b78..3692122e 100644 --- a/auth-center/src/main/resources/application.yml +++ b/auth-center/src/main/resources/application.yml @@ -33,24 +33,46 @@ spring: type: com.alibaba.druid.pool.DruidDataSource druid: driver-class-name: com.mysql.cj.jdbc.Driver - max-active: 100 initial-size: 5 + minIdle: 10 + max-active: 20 max-wait: 60000 - min-idle: 1 - time-between-eviction-runs-millis: 60000 - min-evictable-idle-time-millis: 30000 - validation-query: SELECT 'X' + time-between-eviction-runs-millis: 2000 + min-evictable-idle-time-millis: 600000 + max-evictable-idle-time-millis: 900000 + validation-query: SELECT 1 test-while-idle: true test-on-borrow: false test-on-return: false - max-pool-prepared-statement-per-connection-size: 20 - max-open-prepared-statements: 50 + pool-prepared-statements: true + max-open-prepared-statements: 20 + keep-alive: true + filters: stat,wall,log4j2 + filter: + stat: + enabled: true + db-type: mysql + log-slow-sql: true + slow-sql-millis: 2000 + slf4j: + enabled: true + statement-log-error-enabled: true + statement-create-after-log-enabled: false + statement-close-after-log-enabled: false + result-set-open-after-log-enabled: false + result-set-close-after-log-enabled: false + web-stat-filter: + enabled: true + url-pattern: /* + exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*" + session-stat-enable: true + session-stat-max-count: 1000 stat-view-servlet: enabled: true - login-username: root - login-password: sa - reset-enable: false url-pattern: /druid/* + reset-enable: false + login-username: root + login-password: 123456 redis: database: 0 diff --git a/exercise-mis/src/main/resources/application.yml b/exercise-mis/src/main/resources/application.yml index 3ce945d3..3a3f7adb 100644 --- a/exercise-mis/src/main/resources/application.yml +++ b/exercise-mis/src/main/resources/application.yml @@ -30,8 +30,49 @@ spring: file-size-threshold: 0 datasource: name: muscle_and_fitness - driver-class-name: com.mysql.cj.jdbc.Driver type: com.alibaba.druid.pool.DruidDataSource + druid: + driver-class-name: com.mysql.cj.jdbc.Driver + initial-size: 5 + minIdle: 10 + max-active: 20 + max-wait: 60000 + time-between-eviction-runs-millis: 2000 + min-evictable-idle-time-millis: 600000 + max-evictable-idle-time-millis: 900000 + validation-query: SELECT 1 + test-while-idle: true + test-on-borrow: false + test-on-return: false + pool-prepared-statements: true + max-open-prepared-statements: 20 + keep-alive: true + filters: stat,wall,log4j2 + filter: + stat: + enabled: true + db-type: mysql + log-slow-sql: true + slow-sql-millis: 2000 + slf4j: + enabled: true + statement-log-error-enabled: true + statement-create-after-log-enabled: false + statement-close-after-log-enabled: false + result-set-open-after-log-enabled: false + result-set-close-after-log-enabled: false + web-stat-filter: + enabled: true + url-pattern: /* + exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*" + session-stat-enable: true + session-stat-max-count: 1000 + stat-view-servlet: + enabled: true + url-pattern: /druid/* + reset-enable: false + login-username: root + login-password: 123456 redis: database: 0 timeout: 10000ms diff --git a/muscle-mis/src/main/resources/application.yml b/muscle-mis/src/main/resources/application.yml index 6ee9d451..98308583 100644 --- a/muscle-mis/src/main/resources/application.yml +++ b/muscle-mis/src/main/resources/application.yml @@ -18,8 +18,49 @@ spring: probability: 1.0 datasource: name: muscle_and_fitness - driver-class-name: com.mysql.cj.jdbc.Driver type: com.alibaba.druid.pool.DruidDataSource + druid: + driver-class-name: com.mysql.cj.jdbc.Driver + initial-size: 5 + minIdle: 10 + max-active: 20 + max-wait: 60000 + time-between-eviction-runs-millis: 2000 + min-evictable-idle-time-millis: 600000 + max-evictable-idle-time-millis: 900000 + validation-query: SELECT 1 + test-while-idle: true + test-on-borrow: false + test-on-return: false + pool-prepared-statements: true + max-open-prepared-statements: 20 + keep-alive: true + filters: stat,wall,log4j2 + filter: + stat: + enabled: true + db-type: mysql + log-slow-sql: true + slow-sql-millis: 2000 + slf4j: + enabled: true + statement-log-error-enabled: true + statement-create-after-log-enabled: false + statement-close-after-log-enabled: false + result-set-open-after-log-enabled: false + result-set-close-after-log-enabled: false + web-stat-filter: + enabled: true + url-pattern: /* + exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*" + session-stat-enable: true + session-stat-max-count: 1000 + stat-view-servlet: + enabled: true + url-pattern: /druid/* + reset-enable: false + login-username: root + login-password: 123456 redis: database: 0 timeout: 10000ms diff --git a/service-registry/src/main/resources/application.yml b/service-registry/src/main/resources/application.yml index 4d77adb9..afbb2954 100644 --- a/service-registry/src/main/resources/application.yml +++ b/service-registry/src/main/resources/application.yml @@ -15,8 +15,49 @@ spring: time-zone: Asia/Hong_Kong datasource: name: muscle_and_fitness - driver-class-name: com.mysql.cj.jdbc.Driver type: com.alibaba.druid.pool.DruidDataSource + druid: + driver-class-name: com.mysql.cj.jdbc.Driver + initial-size: 5 + minIdle: 10 + max-active: 20 + max-wait: 60000 + time-between-eviction-runs-millis: 2000 + min-evictable-idle-time-millis: 600000 + max-evictable-idle-time-millis: 900000 + validation-query: SELECT 1 + test-while-idle: true + test-on-borrow: false + test-on-return: false + pool-prepared-statements: true + max-open-prepared-statements: 20 + keep-alive: true + filters: stat,wall,log4j2 + filter: + stat: + enabled: true + db-type: mysql + log-slow-sql: true + slow-sql-millis: 2000 + slf4j: + enabled: true + statement-log-error-enabled: true + statement-create-after-log-enabled: false + statement-close-after-log-enabled: false + result-set-open-after-log-enabled: false + result-set-close-after-log-enabled: false + web-stat-filter: + enabled: true + url-pattern: /* + exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*" + session-stat-enable: true + session-stat-max-count: 1000 + stat-view-servlet: + enabled: true + url-pattern: /druid/* + reset-enable: false + login-username: root + login-password: 123456 redis: database: 0 timeout: 10000ms diff --git a/spring-boot-admin/src/main/resources/application.yml b/spring-boot-admin/src/main/resources/application.yml index 2ca00ae1..7815c424 100644 --- a/spring-boot-admin/src/main/resources/application.yml +++ b/spring-boot-admin/src/main/resources/application.yml @@ -15,8 +15,49 @@ spring: time-zone: Asia/Hong_Kong datasource: name: muscle_and_fitness - driver-class-name: com.mysql.cj.jdbc.Driver type: com.alibaba.druid.pool.DruidDataSource + druid: + driver-class-name: com.mysql.cj.jdbc.Driver + initial-size: 5 + minIdle: 10 + max-active: 20 + max-wait: 60000 + time-between-eviction-runs-millis: 2000 + min-evictable-idle-time-millis: 600000 + max-evictable-idle-time-millis: 900000 + validation-query: SELECT 1 + test-while-idle: true + test-on-borrow: false + test-on-return: false + pool-prepared-statements: true + max-open-prepared-statements: 20 + keep-alive: true + filters: stat,wall,log4j2 + filter: + stat: + enabled: true + db-type: mysql + log-slow-sql: true + slow-sql-millis: 2000 + slf4j: + enabled: true + statement-log-error-enabled: true + statement-create-after-log-enabled: false + statement-close-after-log-enabled: false + result-set-open-after-log-enabled: false + result-set-close-after-log-enabled: false + web-stat-filter: + enabled: true + url-pattern: /* + exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*" + session-stat-enable: true + session-stat-max-count: 1000 + stat-view-servlet: + enabled: true + url-pattern: /druid/* + reset-enable: false + login-username: root + login-password: 123456 redis: database: 0 timeout: 10000ms diff --git a/spring-boot-starter/src/main/java/com/jmsoftware/maf/springbootstarter/MafAutoConfiguration.java b/spring-boot-starter/src/main/java/com/jmsoftware/maf/springbootstarter/MafAutoConfiguration.java index 12aca23a..59089b2b 100644 --- a/spring-boot-starter/src/main/java/com/jmsoftware/maf/springbootstarter/MafAutoConfiguration.java +++ b/spring-boot-starter/src/main/java/com/jmsoftware/maf/springbootstarter/MafAutoConfiguration.java @@ -1,7 +1,5 @@ package com.jmsoftware.maf.springbootstarter; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.jcraft.jsch.ChannelSftp; import com.jmsoftware.maf.springbootstarter.aspect.ExceptionControllerAdvice; import com.jmsoftware.maf.springbootstarter.aspect.WebRequestLogAspect; import com.jmsoftware.maf.springbootstarter.configuration.*; @@ -13,11 +11,10 @@ import com.jmsoftware.maf.springbootstarter.filter.AccessLogFilter; import com.jmsoftware.maf.springbootstarter.helper.HttpApiScanHelper; import com.jmsoftware.maf.springbootstarter.helper.IpHelper; -import com.jmsoftware.maf.springbootstarter.redis.RedisCachingConfiguration; import com.jmsoftware.maf.springbootstarter.redis.RedisConfiguration; import com.jmsoftware.maf.springbootstarter.service.CommonService; import com.jmsoftware.maf.springbootstarter.service.impl.CommonServiceImpl; -import com.jmsoftware.maf.springbootstarter.sftp.*; +import com.jmsoftware.maf.springbootstarter.sftp.SftpConfiguration; import lombok.extern.slf4j.Slf4j; import lombok.val; import org.springframework.boot.autoconfigure.AutoConfigureOrder; @@ -35,22 +32,11 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.core.env.Environment; -import org.springframework.data.redis.connection.RedisConnectionFactory; -import org.springframework.expression.common.LiteralExpression; import org.springframework.integration.annotation.IntegrationComponentScan; -import org.springframework.integration.annotation.ServiceActivator; -import org.springframework.integration.file.remote.session.CachingSessionFactory; -import org.springframework.integration.file.remote.session.SessionFactory; -import org.springframework.integration.sftp.outbound.SftpMessageHandler; -import org.springframework.integration.sftp.session.DefaultSftpSessionFactory; -import org.springframework.integration.sftp.session.SftpRemoteFileTemplate; -import org.springframework.messaging.MessageHandler; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.web.client.RestTemplate; import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; import javax.annotation.PostConstruct; -import java.io.File; import java.util.List; /**