Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
29751a5f
Commit
29751a5f
authored
Jul 20, 2018
by
Junling Bu
Browse files
chore[litemall-core]: 采用yaml配置文件方式
parent
ef999d86
Changes
41
Hide whitespace changes
Inline
Side-by-side
litemall-admin-api/src/main/resources/application-admin.yml
0 → 100644
View file @
29751a5f
litemall-admin-api/src/main/resources/application-dep.properties
deleted
100644 → 0
View file @
ef999d86
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.db
=
ERROR
logging.level.org.linlinjava.litemall
=
DEBUG
\ No newline at end of file
litemall-admin-api/src/main/resources/application-dev.properties
deleted
100644 → 0
View file @
ef999d86
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&allowPublicKeyRetrieval=true
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.db
=
ERROR
logging.level.org.linlinjava.litemall
=
DEBUG
\ No newline at end of file
litemall-admin-api/src/main/resources/application-prod.properties
deleted
100644 → 0
View file @
ef999d86
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.db
=
ERROR
logging.level.org.linlinjava.litemall
=
DEBUG
\ No newline at end of file
litemall-admin-api/src/main/resources/application.properties
deleted
100644 → 0
View file @
ef999d86
spring.profiles.active
=
dev
server.port
=
8083
logging.level.org.linlinjava.litemall.admin.Application
=
DEBUG
litemall-admin-api/src/main/resources/application.yml
0 → 100644
View file @
29751a5f
spring
:
profiles
:
active
:
db, core, admin
message
:
encoding
:
UTF-8
server
:
port
:
8083
logging
:
level
:
root
:
ERROR
org.springframework
:
ERROR
org.mybatis
:
ERROR
org.linlinjava.litemall.admin
:
DEBUG
org.linlinjava.litemall
:
ERROR
\ No newline at end of file
litemall-admin-api/src/test/java/org/linlinjava/litemall/admin/AdminConfigTest.java
0 → 100644
View file @
29751a5f
package
org.linlinjava.litemall.admin
;
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
AdminConfigTest
{
@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-admin.yml配置信息
// System.out.println(environment.getProperty(""));
// 测试获取application.yml配置信息
System
.
out
.
println
(
environment
.
getProperty
(
"logging.level.org.linlinjava.litemall.admin"
));
}
}
litemall-all/src/main/resources/application-dep.properties
deleted
100644 → 0
View file @
ef999d86
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
=
litemall-all/src/main/resources/application-dev.properties
deleted
100644 → 0
View file @
ef999d86
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
=
litemall-all/src/main/resources/application-prod.properties
deleted
100644 → 0
View file @
ef999d86
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
=
\ No newline at end of file
litemall-all/src/main/resources/application.properties
deleted
100644 → 0
View file @
ef999d86
spring.profiles.active
=
prod
server.port
=
8080
\ No newline at end of file
litemall-all/src/main/resources/application.yml
0 → 100644
View file @
29751a5f
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
\ No newline at end of file
litemall-all/src/test/java/org/linlinjava/litemall/allinone/AllinoneConfigTest.java
0 → 100644
View file @
29751a5f
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"
));
}
}
litemall-core/src/main/java/org/linlinjava/litemall/core/express/config/ExpressConfig.java
View file @
29751a5f
...
...
@@ -12,7 +12,6 @@ import java.util.Map;
@Component
@Configuration
@PropertySource
(
value
=
{
"classpath:application.yaml"
},
factory
=
YmlPropertyFactory
.
class
)
@ConfigurationProperties
(
prefix
=
"express"
)
public
class
ExpressConfig
{
private
String
appId
;
...
...
litemall-core/src/main/resources/application.y
a
ml
→
litemall-core/src/main/resources/application
-core
.yml
View file @
29751a5f
File moved
litemall-core/src/main/resources/application-dep.properties
deleted
100644 → 0
View file @
ef999d86
swagger.enable
=
true
\ No newline at end of file
litemall-core/src/main/resources/application-dev.properties
deleted
100644 → 0
View file @
ef999d86
swagger.enable
=
true
\ No newline at end of file
litemall-core/src/main/resources/application-prod.properties
deleted
100644 → 0
View file @
ef999d86
swagger.enable
=
false
\ No newline at end of file
litemall-core/src/main/resources/application.properties
deleted
100644 → 0
View file @
ef999d86
spring.profiles.active
=
dev
spring.message.encoding
=
UTF-8
\ No newline at end of file
litemall-core/src/main/resources/application.yml
0 → 100644
View file @
29751a5f
spring
:
profiles
:
active
:
core
message
:
encoding
:
UTF-8
logging
:
level
:
root
:
ERROR
org.springframework
:
ERROR
org.mybatis
:
ERROR
org.linlinjava.litemall.core
:
DEBUG
\ No newline at end of file
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment