From 81df26450713d25a1a857d18a634fdcf97ffe7ca Mon Sep 17 00:00:00 2001 From: terrfly Date: Thu, 10 Jun 2021 18:23:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BC=80=E5=8F=91=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E9=80=9A=E7=94=A8=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=20=E8=8A=82=E7=BA=A6=E5=BC=80=E5=8F=91=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E9=A1=B9=E7=9B=AE=E9=85=8D=E7=BD=AE=E6=88=90=E6=9C=AC?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/devCommons/config/application.yml | 30 +++++++++++++++++++ conf/manager/application.yml | 4 +-- conf/merchant/application.yml | 4 +-- conf/payment/application.yml | 4 +-- conf/readme.txt | 20 +++++++++++++ jeepay-manager/pom.xml | 13 ++++++++ .../src/main/resources/application.yml | 6 ++-- jeepay-merchant/pom.xml | 13 ++++++++ .../src/main/resources/application.yml | 6 ++-- jeepay-payment/pom.xml | 13 ++++++++ .../src/main/resources/application.yml | 6 ++-- 11 files changed, 104 insertions(+), 15 deletions(-) create mode 100644 conf/devCommons/config/application.yml create mode 100644 conf/readme.txt diff --git a/conf/devCommons/config/application.yml b/conf/devCommons/config/application.yml new file mode 100644 index 0000000..13d7329 --- /dev/null +++ b/conf/devCommons/config/application.yml @@ -0,0 +1,30 @@ +################################# +# 开发环境通用配置文件放置目录 +################################# +spring: + datasource: + # yml填写url连接串, 无需将&符号进行转义 + url: jdbc:mysql://127.0.0.1:3306/jeepay?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false + username: root + password: root + redis: + host: 127.0.0.1 + port: 6379 + password: + #activeMQ配置 + activemq: + broker-url: tcp://localhost:61616 #连接地址 + + #日志配置参数。 + # 当存在logback-spring.xml文件时: 该配置将引进到logback配置, springboot配置不生效。 + # 不存在logback-spring.xml 文件时, 使用springboot的配置, 同样可用。 +logging: + level: + root: info #主日志级别 + com.jeequan.jeepay: debug #该项目日志级别,当需要打印sql时请开启为debug + path: ./logs #日志存放地址 + +#系统业务参数 +isys: + oss-file: + root-path: /home/jeepay/upload #存储根路径 ( 无需以‘/’结尾 ) diff --git a/conf/manager/application.yml b/conf/manager/application.yml index b97ff67..f8a0ebb 100644 --- a/conf/manager/application.yml +++ b/conf/manager/application.yml @@ -16,8 +16,8 @@ spring: datasource: # yml填写url连接串, 无需将&符号进行转义 url: jdbc:mysql://127.0.0.1:3306/jeepaydb?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false - username: jeepay - password: 123456 + username: root + password: redis: host: 127.0.0.1 port: 6379 diff --git a/conf/merchant/application.yml b/conf/merchant/application.yml index 029965f..c3710c8 100644 --- a/conf/merchant/application.yml +++ b/conf/merchant/application.yml @@ -16,8 +16,8 @@ spring: datasource: # yml填写url连接串, 无需将&符号进行转义 url: jdbc:mysql://127.0.0.1:3306/jeepaydb?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false - username: jeepay - password: 123456 + username: root + password: redis: host: 127.0.0.1 port: 6379 diff --git a/conf/payment/application.yml b/conf/payment/application.yml index 177bcfe..69f03be 100644 --- a/conf/payment/application.yml +++ b/conf/payment/application.yml @@ -16,8 +16,8 @@ spring: datasource: # yml填写url连接串, 无需将&符号进行转义 url: jdbc:mysql://127.0.0.1:3306/jeepaydb?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false - username: jeepay - password: 123456 + username: root + password: redis: host: 127.0.0.1 port: 6379 diff --git a/conf/readme.txt b/conf/readme.txt new file mode 100644 index 0000000..46d12f7 --- /dev/null +++ b/conf/readme.txt @@ -0,0 +1,20 @@ + +文件夹用途: 用于放置开发环境的通用配置项和生产环境下的项目配置模板。 + +1. 【devCommons】: +开发环境通用配置文件放置目录。 更改此目录后将覆写 manager/merchant/payment 项目下的application.yml文件对应参数,从而达到每个项目不必单独配置的目的,更加节约开发时间。 + +2. 该文件夹下的【manager/merchant/payment】: +文件为上线部署时与jar同级目录下的application.yml建议配置项的模板。 需更改为实际参数, 也可按需添加。 + + +扩展知识: +##################################################### + +# spring boot支持外部application.yml 读取优先级为: +# 1、file:./config/(当前目录下的config文件夹) +# 2、file:./(当前目录) +# 3、classpath:/config/(classpath下的config目录) +# 4、classpath:/(classpath根目录) + +##################################################### \ No newline at end of file diff --git a/jeepay-manager/pom.xml b/jeepay-manager/pom.xml index 9dfc058..104487d 100644 --- a/jeepay-manager/pom.xml +++ b/jeepay-manager/pom.xml @@ -95,6 +95,19 @@ ${project.artifactId} + + + + + src/main/resources**/*.* + + + + ../conf/devCommons + **/*.yml + + + org.springframework.boot diff --git a/jeepay-manager/src/main/resources/application.yml b/jeepay-manager/src/main/resources/application.yml index 0f0bdfa..041dd2e 100644 --- a/jeepay-manager/src/main/resources/application.yml +++ b/jeepay-manager/src/main/resources/application.yml @@ -20,9 +20,9 @@ spring: number_format: '#' #数字格式进行原样显示,不加格式化字符例如 100,00 datasource: # yml填写url连接串, 无需将&符号进行转义 - url: jdbc:mysql://127.0.0.1:3306/jeepay?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false + url: jdbc:mysql://127.0.0.1:3306/jeepaydb?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false username: root - password: root + password: druid: # 连接池配置项 initial-size: 5 #初始化时建立物理连接的个数 @@ -70,6 +70,6 @@ isys: # 文件系统配置项(系统内oss, 并非云oss) oss-file: - root-path: E:/home/jeepay/files #存储根路径 ( 无需以‘/’结尾 ) + root-path: /home/jeepay/upload #存储根路径 ( 无需以‘/’结尾 ) public-path: ${isys.oss-file.root-path}/public #公共读取块 ( 一般配合root-path参数进行设置,需以‘/’ 开头, 无需以‘/’结尾 ) private-path: ${isys.oss-file.root-path}/private #私有化本地访问,不允许url方式公共读取 ( 一般配合root-path参数进行设置,需以‘/’ 开头, 无需以‘/’结尾 ) diff --git a/jeepay-merchant/pom.xml b/jeepay-merchant/pom.xml index 5788349..8f0259c 100644 --- a/jeepay-merchant/pom.xml +++ b/jeepay-merchant/pom.xml @@ -94,6 +94,19 @@ ${project.artifactId} + + + + + src/main/resources**/*.* + + + + ../conf/devCommons + **/*.yml + + + org.springframework.boot diff --git a/jeepay-merchant/src/main/resources/application.yml b/jeepay-merchant/src/main/resources/application.yml index b0e43c0..57a3f1b 100644 --- a/jeepay-merchant/src/main/resources/application.yml +++ b/jeepay-merchant/src/main/resources/application.yml @@ -20,9 +20,9 @@ spring: number_format: '#' #数字格式进行原样显示,不加格式化字符例如 100,00 datasource: # yml填写url连接串, 无需将&符号进行转义 - url: jdbc:mysql://127.0.0.1:3306/jeepay?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false + url: jdbc:mysql://127.0.0.1:3306/jeepaydb?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false username: root - password: root + password: druid: # 连接池配置项 initial-size: 5 #初始化时建立物理连接的个数 @@ -70,7 +70,7 @@ isys: # 文件系统配置项(系统内oss, 并非云oss) oss-file: - root-path: E:/home/jeepay/files #存储根路径 ( 无需以‘/’结尾 ) + root-path: /home/jeepay/upload #存储根路径 ( 无需以‘/’结尾 ) public-path: ${isys.oss-file.root-path}/public #公共读取块 ( 一般配合root-path参数进行设置,需以‘/’ 开头, 无需以‘/’结尾 ) private-path: ${isys.oss-file.root-path}/private #私有化本地访问,不允许url方式公共读取 ( 一般配合root-path参数进行设置,需以‘/’ 开头, 无需以‘/’结尾 ) diff --git a/jeepay-payment/pom.xml b/jeepay-payment/pom.xml index 3c95da3..c0d0cc8 100644 --- a/jeepay-payment/pom.xml +++ b/jeepay-payment/pom.xml @@ -106,6 +106,19 @@ ${project.artifactId} + + + + + src/main/resources**/*.* + + + + ../conf/devCommons + **/*.yml + + + org.springframework.boot diff --git a/jeepay-payment/src/main/resources/application.yml b/jeepay-payment/src/main/resources/application.yml index 9c9a503..fc7a85f 100644 --- a/jeepay-payment/src/main/resources/application.yml +++ b/jeepay-payment/src/main/resources/application.yml @@ -20,9 +20,9 @@ spring: number_format: '#' #数字格式进行原样显示,不加格式化字符例如 100,00 datasource: # yml填写url连接串, 无需将&符号进行转义 - url: jdbc:mysql://127.0.0.1:3306/jeepay?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false + url: jdbc:mysql://127.0.0.1:3306/jeepaydb?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false username: root - password: 123 + password: druid: # 连接池配置项 initial-size: 5 #初始化时建立物理连接的个数 @@ -69,5 +69,5 @@ isys: # 文件系统配置项(系统内oss, 并非云oss) oss-file: - root-path: E:/home/jeepay/files #存储根路径 ( 无需以‘/’结尾 ) + root-path: /home/jeepay/upload #存储根路径 ( 无需以‘/’结尾 ) private-path: ${isys.oss-file.root-path}/private #私有化本地访问,不允许url方式公共读取 ( 一般配合root-path参数进行设置,需以‘/’ 开头, 无需以‘/’结尾 ) -- GitLab