Browse Source

配置正式环境参数

zsf 1 year ago
parent
commit
f6b93ff2ca

+ 2 - 2
src/main/java/com/rf/psychological/filter/JWTInterceptorConfig.java

@@ -13,7 +13,6 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
  * @date 2021/12/2822:06
  */
 @Configuration
-@Profile("!public")
 public class JWTInterceptorConfig implements WebMvcConfigurer {
 
     @Autowired
@@ -31,7 +30,8 @@ public class JWTInterceptorConfig implements WebMvcConfigurer {
         String[] webLogin = new String[]{"/user/authCode", "/user/saveUser", "/user/webLogin", "/user/webUpdatePassword", "/user/*/checkUser"};
         String[] automaticImport = new String[]{"/category/loadCategory", "/subjectInfo", "/importTest", "/subjectInfo/update"};
         String[] wxPay = new String[]{"/api/wx-pay/native/notify","/api/wx-pay/refunds/notify"};
-        String[] systemApi = new String[]{"/system/login","/user/findUserByStructureNo/**","/system/adminLogin","/system/forgotPassword","/system/registerUser","/institution/newNumber"};
+        String[] systemApi = new String[]{"/system/login","/user/findUserByStructureNo/**","/system/adminLogin","/system/forgotPassword","/system/registerUser",
+                "/institution/getAll","/testPlan/**","/user/**","/subject/**","/category/**","/structure/getChildByParent/**","/report/analysis/**"};
         registry.addInterceptor(jwtInterceptor)
                 .addPathPatterns("/**")
                 .excludePathPatterns("/", "/index**", "/error")

+ 0 - 3
src/main/java/com/rf/psychological/plan/service/impl/TestPlanContendServiceImpl.java

@@ -12,7 +12,6 @@ import com.rf.psychological.plan.dao.dto.TestPlanUserProgressDto;
 import com.rf.psychological.plan.dao.model.TestPlanContendEntity;
 import com.rf.psychological.plan.dao.model.TestPlanUserEntity;
 import com.rf.psychological.plan.dao.repository.TestPlanContendRepository;
-import com.rf.psychological.plan.dao.repository.TestPlanRepository;
 import com.rf.psychological.plan.dao.repository.TestPlanUserRepository;
 import com.rf.psychological.plan.service.TestPlanContendService;
 import org.springframework.data.domain.Page;
@@ -37,8 +36,6 @@ import java.util.stream.Collectors;
 @Service
 public class TestPlanContendServiceImpl implements TestPlanContendService {
 
-    @Autowired
-    private TestPlanRepository testPlanRepository;
 
     @Autowired
     private TestPlanContendRepository testPlanContendRepository;

+ 61 - 31
src/main/resources/config/application-prod.yml

@@ -1,42 +1,64 @@
-#112正式版
 server:
-  port: 8848
+  port: 8090
   address: 0.0.0.0
-  ssl:
-    key-store: classpath:server.jks
-    key-store-password: ppru022o8rag9
-    key-store-type: JKS
-  tomcat:
-    accept-count: 1000
-    max-connections: 10000
-    threads:
-      min-spare: 100
-      max: 1600
-
 spring:
   datasource:
-    driver-class-name: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://49.232.79.112:3306/psychological_admin2?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2B8
-
-    #url: jdbc:mysql://localhost:54027/psychological_admin?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2B8
-    username: root
-    #112/44
-    password: Mysql@.2020
-    #username: root
-    #password: QazMysql@1921.Wsx
-    hikari:
-      max-lifetime: 30000
-
-  #redisson:
-    #address: redis://49.232.79.112:6379
-    #address: redis://49.232.26.44:6379
-    #password: bjjmtech&jsyx
+    type: com.alibaba.druid.pool.DruidDataSource
+    druid:
+      # 使用druid连接池
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      url: jdbc:mysql://localhost:3306/psychological_cpdm?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2B8
+      username: root
+      password: Mysql@.2020
+      # 初始化连接大小
+      initial-size: 5
+      # 最小空闲连接数
+      min-idle: 5
+      max-active: 20
+      max-wait: 30000
+      # 可关闭的空闲连接间隔时间
+      time-between-eviction-runs-millis: 60000
+      # 配置连接在池中的最小生存时间
+      min-evictable-idle-time-millis: 300000
+      validation-query: select '1' from dual
+      test-while-idle: true
+      test-on-borrow: false
+      test-on-return: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      pool-prepared-statements: true
+      max-open-prepared-statements: 20
+      max-pool-prepared-statement-per-connection-size: 20
+      # 配置监控统计拦截的filters
+      filters: stat,wall
+      # 自己配置监控统计拦截的filter
+      filter:
+        # 开启druid datasource的状态监控
+        stat:
+          enabled: true
+          db-type: mysql
+          # 开启慢sql监控,超过2s 就认为是慢sql,记录到日志中
+          log-slow-sql: true
+          slow-sql-millis: 2000
+      ########## 配置StatViewServlet(监控页面),用于展示Druid的统计信息 ##########
+      stat-view-servlet:
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: testAdmin
+        login-password: asdcjiafh^&912834
+        enabled: true
+        allow:
+      ########## 配置WebStatFilter,用于采集web关联监控的数据 ##########
+      web-stat-filter:
+        url-pattern: /*
+        exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"
+        enabled: true
+        session-stat-enable: true
   data:
     redis:
       repositories:
         enabled: false
   redis:
-    host: 49.232.79.112
+    host: localhost
     port: 6379
     password: bjjmtech&jsyx
     timeout: 5000
@@ -45,4 +67,12 @@ spring:
         max-wait: -1
         max-idle: 8
         max-active: 8
-        min-idle: 0
+        min-idle: 0
+    database: 3
+#swagger 显示隐藏配置
+swagger:
+  show: true
+
+
+
+

+ 1 - 1
src/main/resources/config/application-test.yml

@@ -1,4 +1,4 @@
-# 44测试服务器
+# 测试服务器
 server:
   port: 8090
   address: 0.0.0.0

+ 1 - 1
src/main/resources/config/application.yml

@@ -1,7 +1,7 @@
 spring:
   profiles:
     #默认启用test配置文件
-    active: test
+    active: prod
   #  mvc:
   #    static-path-pattern: /findFile/**
   #  resources: