From e2cd53d515585f8d4d1123066167dbb0027674b9 Mon Sep 17 00:00:00 2001
From: xsx <825657193@qq.com>
Date: Sat, 3 Aug 2024 00:17:18 +0800
Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E9=85=8D=E7=BD=AE=E6=96=87?=
=?UTF-8?q?=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/main/resources/application-dev.yml | 27 +++++++++++
.../src/main/resources/application-prod.yml | 26 ++++++++++
.../src/main/resources/application-test.yml | 25 ++++++++++
.../src/main/resources/application.yml | 31 ++----------
im-platform/src/main/resources/logback.xml | 48 +++++++++++++++++++
.../src/main/resources/application-dev.yml | 5 ++
.../src/main/resources/application-prod.yml | 4 ++
.../src/main/resources/application-test.yml | 4 ++
im-server/src/main/resources/application.yml | 11 ++---
im-server/src/main/resources/logback.xml | 48 +++++++++++++++++++
10 files changed, 196 insertions(+), 33 deletions(-)
create mode 100644 im-platform/src/main/resources/application-dev.yml
create mode 100644 im-platform/src/main/resources/application-prod.yml
create mode 100644 im-platform/src/main/resources/application-test.yml
create mode 100644 im-platform/src/main/resources/logback.xml
create mode 100644 im-server/src/main/resources/application-dev.yml
create mode 100644 im-server/src/main/resources/application-prod.yml
create mode 100644 im-server/src/main/resources/application-test.yml
create mode 100644 im-server/src/main/resources/logback.xml
diff --git a/im-platform/src/main/resources/application-dev.yml b/im-platform/src/main/resources/application-dev.yml
new file mode 100644
index 0000000..27751f7
--- /dev/null
+++ b/im-platform/src/main/resources/application-dev.yml
@@ -0,0 +1,27 @@
+spring:
+ datasource:
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ url: jdbc:mysql://localhost:3306/box-im?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true
+ username: root
+ password: root
+ data:
+ redis:
+ host: localhost
+ port: 6379
+
+minio:
+ endpoint: http://127.0.0.1:9001 #内网地址
+ public: http://127.0.0.1:9001 #外网访问地址
+ accessKey: admin
+ secretKey: admin123456
+ bucketName: box-im
+ imagePath: image
+ filePath: file
+ videoPath: video
+
+webrtc:
+ max-channel: 9 # 多人通话最大通道数量,最大不能超过16,建议值:4,9,16
+ iceServers:
+ - urls: stun:stun.l.google.com:19302
+
+
diff --git a/im-platform/src/main/resources/application-prod.yml b/im-platform/src/main/resources/application-prod.yml
new file mode 100644
index 0000000..b412421
--- /dev/null
+++ b/im-platform/src/main/resources/application-prod.yml
@@ -0,0 +1,26 @@
+spring:
+ datasource:
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ url: jdbc:mysql://localhost:3306/box-im?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true
+ username: root
+ password: root
+ data:
+ redis:
+ host: localhost
+ port: 6379
+
+minio:
+ endpoint: http://127.0.0.1:9001 #内网地址
+ public: http://127.0.0.1:9001 #外网访问地址
+ accessKey: admin
+ secretKey: admin123456
+ bucketName: box-im
+ imagePath: image
+ filePath: file
+ videoPath: video
+
+webrtc:
+ max-channel: 9 # 多人通话最大通道数量,最大不能超过16,建议值:4,9,16
+ iceServers:
+ - urls: stun:stun.l.google.com:19302
+
diff --git a/im-platform/src/main/resources/application-test.yml b/im-platform/src/main/resources/application-test.yml
new file mode 100644
index 0000000..be01af2
--- /dev/null
+++ b/im-platform/src/main/resources/application-test.yml
@@ -0,0 +1,25 @@
+spring:
+ datasource:
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ url: jdbc:mysql://localhost:3306/box-im?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true
+ username: root
+ password: root
+ data:
+ redis:
+ host: localhost
+ port: 6379
+
+minio:
+ endpoint: http://127.0.0.1:9001 #内网地址
+ public: http://127.0.0.1:9001 #外网访问地址
+ accessKey: admin
+ secretKey: admin123456
+ bucketName: box-im
+ imagePath: image
+ filePath: file
+ videoPath: video
+
+webrtc:
+ max-channel: 9 # 多人通话最大通道数量,最大不能超过16,建议值:4,9,16
+ iceServers:
+ - urls: stun:stun.l.google.com:19302
diff --git a/im-platform/src/main/resources/application.yml b/im-platform/src/main/resources/application.yml
index 2012493..ae5abb0 100644
--- a/im-platform/src/main/resources/application.yml
+++ b/im-platform/src/main/resources/application.yml
@@ -1,23 +1,13 @@
server:
port: 8888
spring:
+ profiles:
+ active: dev # 环境 dev|test|prod
application:
name: im-platform
mvc:
pathmatch:
matching-strategy: ant_path_matcher
- datasource:
- driver-class-name: com.mysql.cj.jdbc.Driver
- url: jdbc:mysql://localhost:3306/box-im?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true
- username: root
- password: root
-
- data:
- redis:
- host: localhost
- port: 6379
- database: 2
-
servlet:
multipart:
max-file-size: 50MB
@@ -31,21 +21,6 @@ mybatis-plus:
map-underscore-to-camel-case: true #开启自动驼峰命名规则
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
-minio:
- endpoint: http://127.0.0.1:9001 #内网地址
- public: http://192.168.2.67:9001 #外网访问地址
- accessKey: admin
- secretKey: 12345678
- bucketName: box-im
- imagePath: image
- filePath: file
- videoPath: video
-
-webrtc:
- max-channel: 9 # 多人通话最大通道数量,最大不能超过16,建议值:4,9,16
- iceServers:
- - urls: stun:stun.l.google.com:19302
-
jwt:
accessToken:
expireIn: 1800 #半个小时
@@ -54,3 +29,5 @@ jwt:
expireIn: 604800 #7天
secret: IKDiqVmn0VFU
+
+
diff --git a/im-platform/src/main/resources/logback.xml b/im-platform/src/main/resources/logback.xml
new file mode 100644
index 0000000..770933c
--- /dev/null
+++ b/im-platform/src/main/resources/logback.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+ info
+
+
+ %date [%level] [%thread] [%file : %line] %msg%n
+ UTF-8
+
+
+
+ ${LOG_PATH}/${LOG_NAME}
+
+ %date [%level] [%thread] [%file : %line] %msg%n
+ UTF-8
+
+
+ ${LOG_PATH}/info-%d{yyyy-MM-dd}.%i.log
+ 100MB
+ 60
+ 20GB
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/im-server/src/main/resources/application-dev.yml b/im-server/src/main/resources/application-dev.yml
new file mode 100644
index 0000000..7a3694b
--- /dev/null
+++ b/im-server/src/main/resources/application-dev.yml
@@ -0,0 +1,5 @@
+spring:
+ redis:
+ host: 127.0.0.1
+ port: 6379
+
diff --git a/im-server/src/main/resources/application-prod.yml b/im-server/src/main/resources/application-prod.yml
new file mode 100644
index 0000000..ec50df6
--- /dev/null
+++ b/im-server/src/main/resources/application-prod.yml
@@ -0,0 +1,4 @@
+spring:
+ redis:
+ host: 127.0.0.1
+ port: 6379
diff --git a/im-server/src/main/resources/application-test.yml b/im-server/src/main/resources/application-test.yml
new file mode 100644
index 0000000..ec50df6
--- /dev/null
+++ b/im-server/src/main/resources/application-test.yml
@@ -0,0 +1,4 @@
+spring:
+ redis:
+ host: 127.0.0.1
+ port: 6379
diff --git a/im-server/src/main/resources/application.yml b/im-server/src/main/resources/application.yml
index affb1dc..9b47335 100644
--- a/im-server/src/main/resources/application.yml
+++ b/im-server/src/main/resources/application.yml
@@ -1,9 +1,8 @@
spring:
- data:
- redis:
- host: localhost
- port: 6379
- database: 2
+ profiles:
+ active: dev
+ application:
+ name: im-server
websocket:
enable: true
@@ -15,4 +14,4 @@ tcpsocket:
jwt:
accessToken:
- secret: MIIBIjANBgkq # 跟im-platfrom的secret必须一致
\ No newline at end of file
+ secret: MIIBIjANBgkq # 跟im-platfrom的secret必须一致
diff --git a/im-server/src/main/resources/logback.xml b/im-server/src/main/resources/logback.xml
new file mode 100644
index 0000000..6a0574b
--- /dev/null
+++ b/im-server/src/main/resources/logback.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+ info
+
+
+ %date [%level] [%thread] [%file : %line] %msg%n
+ UTF-8
+
+
+
+ ${LOG_PATH}/${LOG_NAME}
+
+ %date [%level] [%thread] [%file : %line] %msg%n
+ UTF-8
+
+
+ ${LOG_PATH}/info-%d{yyyy-MM-dd}.%i.log
+ 100MB
+ 60
+ 20GB
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file