From 537f372d1a9e07d5a8b1eb3f693cc5f2cfa9d231 Mon Sep 17 00:00:00 2001 From: walker Date: Sun, 4 Feb 2024 14:28:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=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 --- config/bj_local.yml | 26 ++++---------------------- config/config.go | 8 ++++---- config/dev.yml | 27 ++++----------------------- config/local.yml | 27 ++++----------------------- config/test.yml | 37 +++++++++++++++++++++++++++++++++++++ config/test_local.yml | 28 +++++----------------------- 6 files changed, 58 insertions(+), 95 deletions(-) create mode 100644 config/test.yml diff --git a/config/bj_local.yml b/config/bj_local.yml index 285ddd5..bb27c5e 100644 --- a/config/bj_local.yml +++ b/config/bj_local.yml @@ -1,34 +1,14 @@ -# dev-开发环境 test-测试环境 prod-生产环境 -env: prod # 服务配置 server: # 服务端口 port: 9091 -# 动力学端口配置 -dynamics: - ip: 10.60.1.121 - udpLocalPort: 4000 - udpRemotePort: 3000 - udpRemoteTrainPort: 3001 - httpPort: 7800 - open: true -# VOBC -vobc: - ip: 10.60.1.59 - localPort: 10000 - remotePort: 4000 - open: true -# interlock -interlock: - ip: 10.60.1.59 - localPort: 10000 - remotePort: 4000 - open: false # 数据源 datasource: # 数据库访问url dsn: root:Joylink@0503@tcp(10.60.1.101:3306)/bj-rtsts?charset=utf8mb4&parseTime=true&loc=UTC + +# 日志配置 logging: # 日志级别 level: info @@ -48,6 +28,8 @@ logging: compress: false # 控制台是否输出 stdout: false + +# 消息配置 messaging: mqtt: address: tcp://10.60.1.111:1883 diff --git a/config/config.go b/config/config.go index ceb75ce..e02eb95 100644 --- a/config/config.go +++ b/config/config.go @@ -14,14 +14,14 @@ const ( ) type AppConfig struct { - Env string + // Env string Server server Datasource datasource Logging log Messaging messaging - Dynamics DynamicsConfig - Vobc VobcConfig - Interlock InterlockConfig + // Dynamics DynamicsConfig + // Vobc VobcConfig + // Interlock InterlockConfig } type server struct { Port int diff --git a/config/dev.yml b/config/dev.yml index 0bbf370..14d442f 100644 --- a/config/dev.yml +++ b/config/dev.yml @@ -1,35 +1,14 @@ -# dev-开发环境 test-测试环境 prod-生产环境 -env: dev # 服务配置 server: # 服务端口 port: 9091 -# 动力学端口配置 -dynamics: - ip: 192.168.3.37 - udpLocalPort: 4000 - udpRemotePort: 3000 - udpRemoteTrainPort: 3001 - httpPort: 7800 - open: false -# VOBC -vobc: - ip: 10.60.1.59 - localPort: 10000 - remotePort: 4000 - open: false -# interlock -interlock: - ip: 10.60.1.59 - localPort: 10000 - remotePort: 4000 - open: false - # 数据源 datasource: # 数据库访问url dsn: root:joylink0503@tcp(192.168.3.233:3306)/bj-rtss?charset=utf8mb4&parseTime=true&loc=UTC + +# 日志配置 logging: # 日志级别 level: debug @@ -49,6 +28,8 @@ logging: compress: false # 控制台是否输出 stdout: true + +# 消息配置 messaging: mqtt: address: tcp://192.168.3.233:1883 diff --git a/config/local.yml b/config/local.yml index 7d8939e..cb4e1e7 100644 --- a/config/local.yml +++ b/config/local.yml @@ -1,35 +1,14 @@ -# dev-开发环境 test-测试环境 prod-生产环境 local-线下项目 -env: local # 服务配置 server: # 服务端口 port: 9091 -# 动力学端口配置 -dynamics: - ip: 192.168.3.37 - udpLocalPort: 4000 - udpRemotePort: 3000 - udpRemoteTrainPort: 3001 - httpPort: 7800 - open: false -# VOBC -vobc: - ip: 10.60.1.59 - localPort: 10000 - remotePort: 4000 - open: false -# interlock -interlock: - ip: 10.60.1.59 - localPort: 10000 - remotePort: 4000 - open: false - # 数据源 datasource: # 数据库访问url dsn: root:localdb@tcp(192.168.53.11:3306)/bj-rtss?charset=utf8mb4&parseTime=true&loc=UTC + +# 日志配置 logging: # 日志级别 level: info @@ -49,6 +28,8 @@ logging: compress: false # 控制台是否输出 stdout: false + +# 消息配置 messaging: mqtt: address: tcp://192.168.0.203:1883 diff --git a/config/test.yml b/config/test.yml new file mode 100644 index 0000000..59dcf94 --- /dev/null +++ b/config/test.yml @@ -0,0 +1,37 @@ +# 服务配置 +server: + # 服务端口 + port: 9091 + +# 数据源 +datasource: + # 数据库访问url + dsn: root:joylink0503@tcp(192.168.53.22:3306)/bj-rtss?charset=utf8mb4&parseTime=true&loc=UTC + +# 日志配置 +logging: + # 日志级别 + level: info + # 格式化 + # format: json + # 日志文件路径 + path: /logs/bjrtsts + # 日志文件名 + fileName: bjrtsts.log + # 单个日志文件大小,单位mb,超过会自动滚动 + fileMaxSize: 5 + # 日志文件最大备份数量 + fileMaxBackups: 100 + # 日志文件最大保留时间,单位 天 + maxAge: 30 + # 是否压缩日志 + compress: false + # 控制台是否输出 + stdout: false + +# 消息配置 +messaging: + mqtt: + address: tcp://114.116.51.125:1883 + username: rtsts_service + password: joylink@0503 diff --git a/config/test_local.yml b/config/test_local.yml index c164327..58147e1 100644 --- a/config/test_local.yml +++ b/config/test_local.yml @@ -1,34 +1,14 @@ -# dev-开发环境 test-测试环境 prod-生产环境 -env: test # 服务配置 server: # 服务端口 port: 9091 -# 动力学端口配置 -dynamics: - ip: 192.168.3.233 - udpLocalPort: 4000 - udpRemotePort: 3000 - udpRemoteTrainPort: 3001 - httpPort: 7800 - open: true -# VOBC -vobc: - ip: 10.60.1.59 - localPort: 10000 - remotePort: 4000 - open: true -# interlock -interlock: - ip: 10.60.1.59 - localPort: 10000 - remotePort: 4000 - open: false - + # 数据源 datasource: # 数据库访问url dsn: root:joylink0503@tcp(192.168.53.22:3306)/bj-rtss?charset=utf8mb4&parseTime=true&loc=UTC + +# 日志配置 logging: # 日志级别 level: info @@ -48,6 +28,8 @@ logging: compress: false # 控制台是否输出 stdout: false + +# 消息配置 messaging: mqtt: address: tcp://192.168.3.233:1883