From 6d7517f778c33f3343bb9cf84b076b6d9fd850dd Mon Sep 17 00:00:00 2001 From: ZhouXY108 Date: Sat, 28 Jan 2023 17:36:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 + .../main/resources/application-public.yaml | 69 +++++++++++++++++ .../src/main/resources/application.yaml | 76 +------------------ plusone-start/src/main/resources/logback.xml | 10 +-- 4 files changed, 80 insertions(+), 77 deletions(-) create mode 100644 plusone-start/src/main/resources/application-public.yaml diff --git a/.gitignore b/.gitignore index eb3eb56..d0334d0 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,8 @@ build/ ### VS Code ### .vscode/ +log/ ### bak ### *.bak +*-secret.yaml diff --git a/plusone-start/src/main/resources/application-public.yaml b/plusone-start/src/main/resources/application-public.yaml new file mode 100644 index 0000000..a6a5b1e --- /dev/null +++ b/plusone-start/src/main/resources/application-public.yaml @@ -0,0 +1,69 @@ +spring: + # redis配置 + redis: + # Redis数据库索引(默认为0) + database: 1 + # Redis服务器地址 + host: 127.0.0.1 + # Redis服务器连接端口 + port: 6379 + # Redis服务器连接密码(默认为空) + # password: + # 连接超时时间 + timeout: 10s + lettuce: + pool: + # 连接池最大连接数 + max-active: 200 + # 连接池最大阻塞等待时间(使用负值表示没有限制) + max-wait: -1ms + # 连接池中的最大空闲连接 + max-idle: 10 + # 连接池中的最小空闲连接 + min-idle: 0 + # 数据库 + datasource: + url: jdbc:postgresql://localhost:5432/plusone + username: plusone + password: XXXXXXXXXXXXXXXX + +plusone: + application: + name: plusone + server: + port: 8108 + debug: true + # 短信发送相关参数 + sms: + region: ap-guangzhou + credential: + secret-id: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + secret-key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + client: + # SDK 默认用 TC3-HMAC-SHA256 进行签名,非必要请不要修改这个字段 + sign-method: HmacSHA256 + http: + # proxy: + # host: xxx + # port: xxx + req-method: POST + conn-timeout: 60 + app-id: 1111111111 + templates: + code: 0000000 + + # 邮件发送相关参数 + mail: + host: smtp.163.com + #设置邮件发送者 + from: example@163.com + password: XXXXXXXXXXXXXXXX + + # 异常拦截机制是否拦截所有异常 + exception: + handle-all-exception: false + +# 日志配置 +logging: + level: + root: debug diff --git a/plusone-start/src/main/resources/application.yaml b/plusone-start/src/main/resources/application.yaml index 80c6303..4a48e74 100644 --- a/plusone-start/src/main/resources/application.yaml +++ b/plusone-start/src/main/resources/application.yaml @@ -1,79 +1,11 @@ +spring: + profiles: + active: public + plusone: - application: - name: plusone - server: - port: 8108 - debug: true - - # 短信发送相关参数 - sms: - region: ap-guangzhou - credential: - secret-id: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - secret-key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - client: - # SDK 默认用 TC3-HMAC-SHA256 进行签名,非必要请不要修改这个字段 - sign-method: HmacSHA256 - http: - # proxy: - # host: xxx - # port: xxx - req-method: POST - conn-timeout: 60 - app-id: 1111111111 - templates: - code: 0000000 - # 邮件发送相关参数 mail: - host: smtp.163.com - #设置邮件发送者 - from: example@163.com - password: XXXXXXXXXXXXXXXX subject: code: Plusone template: code: 【Plusone】验证码:%s,10分钟内有效,请勿泄露。 - - # 异常拦截机制是否拦截所有异常 - exception: - handle-all-exception: false - -spring: - # redis配置 - redis: - # Redis数据库索引(默认为0) - database: 1 - # Redis服务器地址 - host: 127.0.0.1 - # Redis服务器连接端口 - port: 6379 - # Redis服务器连接密码(默认为空) - # password: - # 连接超时时间 - timeout: 10s - lettuce: - pool: - # 连接池最大连接数 - max-active: 200 - # 连接池最大阻塞等待时间(使用负值表示没有限制) - max-wait: -1ms - # 连接池中的最大空闲连接 - max-idle: 10 - # 连接池中的最小空闲连接 - min-idle: 0 - # 数据库 - datasource: - url: jdbc:postgresql://localhost:5432/plusone - username: plusone - password: XXXXXXXXXXXXXXXX - -# 日志配置 -logging: - file: - name: ${user.home}/logs/${plusone.application.name}.log - level: - root: INFO - xyz.zhouxy.plusone: DEBUG - org.springframework.jdbc.core: DEBUG - xyz.zhouxy.plusone.system.application.query: DEBUG diff --git a/plusone-start/src/main/resources/logback.xml b/plusone-start/src/main/resources/logback.xml index de3d0d4..dd9c22e 100644 --- a/plusone-start/src/main/resources/logback.xml +++ b/plusone-start/src/main/resources/logback.xml @@ -10,23 +10,23 @@ - + - +