فهرست منبع

refactor: 增加测试数据库配置

TianChenjiang 5 سال پیش
والد
کامیت
6be1debff6
4فایلهای تغییر یافته به همراه89 افزوده شده و 42 حذف شده
  1. 2 2
      pom.xml
  2. 41 0
      src/main/resources/application-prod.yml
  3. 44 0
      src/main/resources/application-test.yml
  4. 2 40
      src/main/resources/application.yml

+ 2 - 2
pom.xml

@@ -107,13 +107,13 @@
 		<dependency>
 			<groupId>cn.seecoder</groupId>
 			<artifactId>seecoder-bok-client</artifactId>
-			<version>0.1.2</version>
+			<version>0.2.2</version>
 		</dependency>
 
 		<dependency>
 			<groupId>cn.seecoder</groupId>
 			<artifactId>seecoder-bok-common</artifactId>
-			<version>0.1.2</version>
+			<version>0.2.2</version>
 		</dependency>
 
 		<!--客观题评测-->

+ 41 - 0
src/main/resources/application-prod.yml

@@ -0,0 +1,41 @@
+server:
+  port: 8080
+spring:
+  datasource:
+    url: jdbc:mysql://environment-33-89.seec.svc.cluster.local:3306/eval?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
+    username: root
+    password: mysqleval
+    driverClassName: com.mysql.cj.jdbc.Driver
+  jpa:
+    #    database-platform: org.hibernate.dialect.MySQL57InnoDBDialect
+    hibernate:
+      ddl-auto: update
+      naming:
+        implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
+        physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
+    properties:
+      hibernate.enable_lazy_load_no_trans: true
+      hibernate.dialect: com.nju.edu.eval.config.MySQL57InnoDBDialect  # 人为调整数据库编码
+      hibernate.format_sql: true
+    show-sql: true
+  jackson:
+    date-format: yyyy-MM-dd HH:mm:ss
+    time-zone: GMT+8
+    parser:
+      #允许出现特殊字符和转义符
+      allow_unquoted_control_chars: true
+      #允许出现单引号
+      allow_single_quotes: true
+
+jwt:
+  header: Authorization
+  secret: SEEC-1919810-OIDC-114514
+
+seec-bok-client:
+  host: http://bok.seec.seecoder.cn
+
+objective-judgement-client:
+  host: http://seecoder-judgement.seec.seecoder.cn
+
+code-judgement-client:
+  host: http://oj.seec.seecoder.cn

+ 44 - 0
src/main/resources/application-test.yml

@@ -0,0 +1,44 @@
+server:
+  port: 8080
+spring:
+  datasource:
+    url: jdbc:mysql://47.111.95.164:3306/eval?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
+    username: root
+    password: mysqltcj
+    driverClassName: com.mysql.cj.jdbc.Driver
+    hikari:
+      max-lifetime: 600000
+      maximum-pool-size: 100
+  jpa:
+    #    database-platform: org.hibernate.dialect.MySQL57InnoDBDialect
+    hibernate:
+      ddl-auto: update
+      naming:
+        implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
+        physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
+    properties:
+      hibernate.enable_lazy_load_no_trans: true
+      hibernate.dialect: com.nju.edu.eval.config.MySQL57InnoDBDialect  # 人为调整数据库编码
+      hibernate.format_sql: true
+    show-sql: true
+  jackson:
+    date-format: yyyy-MM-dd HH:mm:ss
+    time-zone: GMT+8
+    parser:
+      #允许出现特殊字符和转义符
+      allow_unquoted_control_chars: true
+      #允许出现单引号
+      allow_single_quotes: true
+
+jwt:
+  header: Authorization
+  secret: SEEC-1919810-OIDC-114514
+
+seec-bok-client:
+  host: http://bok.seec.seecoder.cn
+
+objective-judgement-client:
+  host: http://seecoder-judgement.seec.seecoder.cn
+
+code-judgement-client:
+  host: http://oj.seec.seecoder.cn

+ 2 - 40
src/main/resources/application.yml

@@ -1,41 +1,3 @@
-server:
-  port: 8080
 spring:
-  datasource:
-    url: jdbc:mysql://environment-33-89.seec.svc.cluster.local:3306/eval?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
-    username: root
-    password: mysqleval
-    driverClassName: com.mysql.cj.jdbc.Driver
-  jpa:
-#    database-platform: org.hibernate.dialect.MySQL57InnoDBDialect
-    hibernate:
-      ddl-auto: update
-      naming:
-        implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
-        physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
-    properties:
-      hibernate.enable_lazy_load_no_trans: true
-      hibernate.dialect: com.nju.edu.eval.config.MySQL57InnoDBDialect  # 人为调整数据库编码
-      hibernate.format_sql: true
-    show-sql: true
-  jackson:
-    date-format: yyyy-MM-dd HH:mm:ss
-    time-zone: GMT+8
-    parser:
-      #允许出现特殊字符和转义符
-      allow_unquoted_control_chars: true
-      #允许出现单引号
-      allow_single_quotes: true
-
-jwt:
-  header: Authorization
-  secret: SEEC-1919810-OIDC-114514
-
-seec-bok-client:
-  host: http://bok.seec.seecoder.cn
-
-objective-judgement-client:
-  host: http://seecoder-judgement.seec.seecoder.cn
-
-code-judgement-client:
-  host: http://oj.seec.seecoder.cn
+  profils:
+    active: prod