chore[litemall-core]: 采用yaml配置文件方式
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
pagehelper.helperDialect=mysql
|
||||
pagehelper.reasonable=true
|
||||
pagehelper.supportMethodsArguments=true
|
||||
pagehelper.params=count=countSql
|
||||
|
||||
spring.datasource.druid.url=jdbc:mysql://localhost:3306/litemall?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&verifyServerCertificate=false&useSSL=false
|
||||
spring.datasource.druid.driver-class-name=com.mysql.jdbc.Driver
|
||||
spring.datasource.druid.username=litemall
|
||||
spring.datasource.druid.password=litemall123456
|
||||
spring.datasource.druid.initial-size=10
|
||||
spring.datasource.druid.max-active=50
|
||||
spring.datasource.druid.min-idle=10
|
||||
spring.datasource.druid.max-wait=60000
|
||||
spring.datasource.druid.pool-prepared-statements=true
|
||||
spring.datasource.druid.max-pool-prepared-statement-per-connection-size=20
|
||||
spring.datasource.druid.validation-query=SELECT 1 FROM DUAL
|
||||
spring.datasource.druid.test-on-borrow=false
|
||||
spring.datasource.druid.test-on-return=false
|
||||
spring.datasource.druid.test-while-idle=true
|
||||
spring.datasource.druid.time-between-eviction-runs-millis=60000
|
||||
spring.datasource.druid.filters=stat,wall,log4j
|
||||
|
||||
|
||||
logging.level.root=ERROR
|
||||
logging.level.org.springframework=ERROR
|
||||
logging.level.org.mybatis=ERROR
|
||||
logging.level.org.linlinjava.litemall=DEBUG
|
||||
|
||||
# 开发者应该设置成自己的域名,必须附带http或者https
|
||||
org.linlinjava.litemall.os.address=http://122.152.206.172
|
||||
org.linlinjava.litemall.os.port=8080
|
||||
|
||||
wx.app-id=wxa5b486c6b918ecfb
|
||||
wx.app-secret=e04004829d4c383b4db7769d88dfbca1
|
||||
wx.mch-id=
|
||||
wx.mch-key=
|
||||
wx.notify-url=
|
||||
@@ -1,37 +0,0 @@
|
||||
pagehelper.helperDialect=mysql
|
||||
pagehelper.reasonable=true
|
||||
pagehelper.supportMethodsArguments=true
|
||||
pagehelper.params=count=countSql
|
||||
|
||||
spring.datasource.druid.url=jdbc:mysql://localhost:3306/litemall?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&verifyServerCertificate=false&useSSL=false
|
||||
spring.datasource.druid.driver-class-name=com.mysql.jdbc.Driver
|
||||
spring.datasource.druid.username=litemall
|
||||
spring.datasource.druid.password=litemall123456
|
||||
spring.datasource.druid.initial-size=10
|
||||
spring.datasource.druid.max-active=50
|
||||
spring.datasource.druid.min-idle=10
|
||||
spring.datasource.druid.max-wait=60000
|
||||
spring.datasource.druid.pool-prepared-statements=true
|
||||
spring.datasource.druid.max-pool-prepared-statement-per-connection-size=20
|
||||
spring.datasource.druid.validation-query=SELECT 1 FROM DUAL
|
||||
spring.datasource.druid.test-on-borrow=false
|
||||
spring.datasource.druid.test-on-return=false
|
||||
spring.datasource.druid.test-while-idle=true
|
||||
spring.datasource.druid.time-between-eviction-runs-millis=60000
|
||||
spring.datasource.druid.filters=stat,wall,log4j
|
||||
|
||||
|
||||
logging.level.root=ERROR
|
||||
logging.level.org.springframework=ERROR
|
||||
logging.level.org.mybatis=ERROR
|
||||
logging.level.org.linlinjava.litemall=DEBUG
|
||||
|
||||
# 开发者应该设置成自己的域名,必须附带http或者https
|
||||
org.linlinjava.litemall.os.address=http://127.0.0.1
|
||||
org.linlinjava.litemall.os.port=8080
|
||||
|
||||
wx.app-id=wxa5b486c6b918ecfb
|
||||
wx.app-secret=e04004829d4c383b4db7769d88dfbca1
|
||||
wx.mch-id=
|
||||
wx.mch-key=
|
||||
wx.notify-url=
|
||||
@@ -1,36 +0,0 @@
|
||||
pagehelper.helperDialect=mysql
|
||||
pagehelper.reasonable=true
|
||||
pagehelper.supportMethodsArguments=true
|
||||
pagehelper.params=count=countSql
|
||||
|
||||
spring.datasource.druid.url=jdbc:mysql://localhost:3306/litemall?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&verifyServerCertificate=false&useSSL=false
|
||||
spring.datasource.druid.driver-class-name=com.mysql.jdbc.Driver
|
||||
spring.datasource.druid.username=litemall
|
||||
spring.datasource.druid.password=litemall123456
|
||||
spring.datasource.druid.initial-size=10
|
||||
spring.datasource.druid.max-active=50
|
||||
spring.datasource.druid.min-idle=10
|
||||
spring.datasource.druid.max-wait=60000
|
||||
spring.datasource.druid.pool-prepared-statements=true
|
||||
spring.datasource.druid.max-pool-prepared-statement-per-connection-size=20
|
||||
spring.datasource.druid.validation-query=SELECT 1 FROM DUAL
|
||||
spring.datasource.druid.test-on-borrow=false
|
||||
spring.datasource.druid.test-on-return=false
|
||||
spring.datasource.druid.test-while-idle=true
|
||||
spring.datasource.druid.time-between-eviction-runs-millis=60000
|
||||
spring.datasource.druid.filters=stat,wall,log4j
|
||||
|
||||
logging.level.root=ERROR
|
||||
logging.level.org.springframework=ERROR
|
||||
logging.level.org.mybatis=ERROR
|
||||
logging.level.org.linlinjava.litemall=ERROR
|
||||
|
||||
# 开发者应该设置成自己的域名,必须附带http或者https
|
||||
org.linlinjava.litemall.os.address=https://www.example.com
|
||||
org.linlinjava.litemall.os.port=443
|
||||
|
||||
wx.app-id=wxa5b486c6b918ecfb
|
||||
wx.app-secret=e04004829d4c383b4db7769d88dfbca1
|
||||
wx.mch-id=
|
||||
wx.mch-key=
|
||||
wx.notify-url=
|
||||
@@ -1,2 +0,0 @@
|
||||
spring.profiles.active=prod
|
||||
server.port=8080
|
||||
18
litemall-all/src/main/resources/application.yml
Normal file
18
litemall-all/src/main/resources/application.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
spring:
|
||||
profiles:
|
||||
active: db, core, admin, wx, os
|
||||
message:
|
||||
encoding: UTF-8
|
||||
|
||||
server:
|
||||
port: 8080
|
||||
|
||||
logging:
|
||||
level:
|
||||
root: ERROR
|
||||
org.springframework: ERROR
|
||||
org.mybatis: ERROR
|
||||
org.linlinjava.litemall.admin: DEBUG
|
||||
org.linlinjava.litemall.os: DEBUG
|
||||
org.linlinjava.litemall.wx: DEBUG
|
||||
org.linlinjava.litemall: ERROR
|
||||
@@ -0,0 +1,37 @@
|
||||
package org.linlinjava.litemall.allinone;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.test.context.web.WebAppConfiguration;
|
||||
|
||||
@WebAppConfiguration
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest
|
||||
public class AllinoneConfigTest {
|
||||
@Autowired
|
||||
private Environment environment;
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
// 测试获取application-core.yml配置信息
|
||||
System.out.println(environment.getProperty("express.appId"));
|
||||
// 测试获取application-db.yml配置信息
|
||||
System.out.println(environment.getProperty("spring.datasource.druid.url"));
|
||||
// 测试获取application-wx.yml配置信息
|
||||
System.out.println(environment.getProperty("wx.app-id"));
|
||||
// 测试获取application-admin.yml配置信息
|
||||
// System.out.println(environment.getProperty(""));
|
||||
// 测试获取application-os.yml配置信息
|
||||
System.out.println(environment.getProperty("org.linlinjava.litemall.os.address"));
|
||||
// 测试获取application.yml配置信息
|
||||
System.out.println(environment.getProperty("logging.level.org.linlinjava.litemall.os"));
|
||||
System.out.println(environment.getProperty("logging.level.org.linlinjava.litemall.wx"));
|
||||
System.out.println(environment.getProperty("logging.level.org.linlinjava.litemall.admin"));
|
||||
System.out.println(environment.getProperty("logging.level.org.linlinjava.litemall"));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user