From f8aa4c983b279fa1628d807907529f5d264a9884 Mon Sep 17 00:00:00 2001
From: webzzq <2486827339@qq.com>
Date: Sat, 26 Oct 2024 16:48:29 +0800
Subject: [PATCH] =?UTF-8?q?update:=20=E8=AE=BE=E7=BD=AEmaven=20profile=20?=
=?UTF-8?q?=E8=BF=90=E8=A1=8C=E7=8E=AF=E5=A2=83?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...lication-druid.yml => application-dev.yml} | 0
.../src/main/resources/application-prod.yml | 61 +++++++++++++++++++
ahut-admin/src/main/resources/application.yml | 2 +-
ahut-admin/src/main/resources/banner.txt | 24 --------
pom.xml | 40 ++++++++++++
5 files changed, 102 insertions(+), 25 deletions(-)
rename ahut-admin/src/main/resources/{application-druid.yml => application-dev.yml} (100%)
create mode 100644 ahut-admin/src/main/resources/application-prod.yml
delete mode 100644 ahut-admin/src/main/resources/banner.txt
diff --git a/ahut-admin/src/main/resources/application-druid.yml b/ahut-admin/src/main/resources/application-dev.yml
similarity index 100%
rename from ahut-admin/src/main/resources/application-druid.yml
rename to ahut-admin/src/main/resources/application-dev.yml
diff --git a/ahut-admin/src/main/resources/application-prod.yml b/ahut-admin/src/main/resources/application-prod.yml
new file mode 100644
index 0000000..bdd6c65
--- /dev/null
+++ b/ahut-admin/src/main/resources/application-prod.yml
@@ -0,0 +1,61 @@
+# 数据源配置
+spring:
+ datasource:
+ type: com.alibaba.druid.pool.DruidDataSource
+ driverClassName: com.mysql.cj.jdbc.Driver
+ druid:
+ # 主库数据源
+ master:
+ url: jdbc:mysql://localhost:3306/ahut_review?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+ username: root
+ password: 111111111
+ # 从库数据源
+ slave:
+ # 从数据源开关/默认关闭
+ enabled: false
+ url:
+ username:
+ password:
+ # 初始连接数
+ initialSize: 5
+ # 最小连接池数量
+ minIdle: 10
+ # 最大连接池数量
+ maxActive: 20
+ # 配置获取连接等待超时的时间
+ maxWait: 60000
+ # 配置连接超时时间
+ connectTimeout: 30000
+ # 配置网络超时时间
+ socketTimeout: 60000
+ # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+ timeBetweenEvictionRunsMillis: 60000
+ # 配置一个连接在池中最小生存的时间,单位是毫秒
+ minEvictableIdleTimeMillis: 300000
+ # 配置一个连接在池中最大生存的时间,单位是毫秒
+ maxEvictableIdleTimeMillis: 900000
+ # 配置检测连接是否有效
+ validationQuery: SELECT 1 FROM DUAL
+ testWhileIdle: true
+ testOnBorrow: false
+ testOnReturn: false
+ webStatFilter:
+ enabled: true
+ statViewServlet:
+ enabled: true
+ # 设置白名单,不填则允许所有访问
+ allow:
+ url-pattern: /druid/*
+ # 控制台管理用户名和密码
+ login-username: ruoyi
+ 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
diff --git a/ahut-admin/src/main/resources/application.yml b/ahut-admin/src/main/resources/application.yml
index 7caff64..771cd23 100644
--- a/ahut-admin/src/main/resources/application.yml
+++ b/ahut-admin/src/main/resources/application.yml
@@ -52,7 +52,7 @@ spring:
# 国际化资源文件路径
basename: i18n/messages
profiles:
- active: druid
+ active: @spring.profile@
# 文件上传
servlet:
multipart:
diff --git a/ahut-admin/src/main/resources/banner.txt b/ahut-admin/src/main/resources/banner.txt
deleted file mode 100644
index 9466259..0000000
--- a/ahut-admin/src/main/resources/banner.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-Application Version: ${ruoyi.version}
-Spring Boot Version: ${spring-boot.version}
-////////////////////////////////////////////////////////////////////
-// _ooOoo_ //
-// o8888888o //
-// 88" . "88 //
-// (| ^_^ |) //
-// O\ = /O //
-// ____/`---'\____ //
-// .' \\| |// `. //
-// / \\||| : |||// \ //
-// / _||||| -:- |||||- \ //
-// | | \\\ - /// | | //
-// | \_| ''\---/'' | | //
-// \ .-\__ `-` ___/-. / //
-// ___`. .' /--.--\ `. . ___ //
-// ."" '< `.___\_<|>_/___.' >'"". //
-// | | : `- \`.;`\ _ /`;.`/ - ` : | | //
-// \ \ `-. \_ __\ /__ _/ .-` / / //
-// ========`-.____`-.___\_____/___.-`____.-'======== //
-// `=---=' //
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
-// 佛祖保佑 永不宕机 永无BUG //
-////////////////////////////////////////////////////////////////////
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index a6b6121..10d8793 100644
--- a/pom.xml
+++ b/pom.xml
@@ -219,6 +219,13 @@
+
+
+
+ src/main/resources
+ true
+
+
@@ -245,6 +252,39 @@
+
+
+
+ dev
+
+ dev
+
+
+
+ true
+
+
+
+
+ test
+
+ test
+
+
+ false
+
+
+
+
+ prod
+
+ prod
+
+
+ false
+
+
+