xiongzhu %!s(int64=4) %!d(string=hai) anos
pai
achega
d34c460666
Modificáronse 2 ficheiros con 60 adicións e 2 borrados
  1. 7 0
      pom.xml
  2. 53 2
      src/main/resources/application.yaml

+ 7 - 0
pom.xml

@@ -46,6 +46,13 @@
 			<artifactId>spring-boot-starter-test</artifactId>
 			<scope>test</scope>
 		</dependency>
+
+
+		<dependency>
+			<groupId>com.alibaba</groupId>
+			<artifactId>druid-spring-boot-starter</artifactId>
+			<version>1.2.8</version>
+		</dependency>
 	</dependencies>
 
 	<build>

+ 53 - 2
src/main/resources/application.yaml

@@ -1,5 +1,5 @@
 server:
-  port: 8080
+  port: 8081
   servlet:
     context_path: /
   compression:
@@ -19,8 +19,59 @@ spring:
     url: jdbc:mysql://rm-wz9sc79f5255780opqo.mysql.rds.aliyuncs.com/raex_test?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8
     username: raex_server
     password: tetQsjw!u4!c5$URduo7BH
+  druid:
+    # ????????
+    # ???????????
+    initial-size: 5
+    min-idle: 20
+    maxActive: 3000
+    # ?????????????
+    maxWait: 60000
+    # ??????????
+    use-unfair-lock: true
+    # ???????????????????????????????
+    timeBetweenEvictionRunsMillis: 30000
+    # ??????????????????????
+    minEvictableIdleTimeMillis: 300000
+    validationQuery: SELECT 1
+    testWhileIdle: true
+    testOnBorrow: false
+    testOnReturn: false
+    # ??PSCache??????????PSCache???
+    poolPreparedStatements: true
+    maxPoolPreparedStatementPerConnectionSize: 20
+    query-timeout: 300000
+    # ?????????filters????????sql?????'wall'?????
+    filters: stat,wall,slf4j
+    # ??connectProperties?????mergeSql????SQL??
+    connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
+    remove-abandoned: true
+    remove-abandoned-timeout: 1800
+    log-abandoned: true
+    # ????
+    keep-alive: true
+    # ??????
+    keep-alive-between-time-millis: 60000
+    # ??DruidStatFilter
+    web-stat-filter:
+      enabled: true
+      url-pattern: "/*"
+      exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"
+    # ??DruidStatViewServlet
+    stat-view-servlet:
+      enabled: true
+      url-pattern: "/druid/*"
+      login-username: admin
+      login-password: 3edc#EDC
+    filter:
+      wall:
+        enabled: true
+        config:
+          condition-and-alway-false-allow: true
+          condition-and-alway-true-allow: true
+          select-where-alway-true-check: false
   jpa:
     database: MySQL
     database_platform: org.hibernate.dialect.MySQL5InnoDBDialect
     hibernate:
-      ddl_auto: update
+      ddl_auto: update