Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
shop
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
shop
Commits
9af9691f
Commit
9af9691f
authored
Aug 27, 2018
by
zhangyong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://zhangyong@gitlab.egolm.com/key/shop.git
parents
51f47e37
5b09e1ee
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
1 deletion
+69
-1
RedisConfig.java
src/main/java/com/egolm/shop/config/RedisConfig.java
+32
-0
application-dev.properties
src/main/resources/application-dev.properties
+13
-1
application-pro.properties
src/main/resources/application-pro.properties
+12
-0
application-test.properties
src/main/resources/application-test.properties
+12
-0
No files found.
src/main/java/com/egolm/shop/config/RedisConfig.java
0 → 100644
View file @
9af9691f
package
com
.
egolm
.
shop
.
config
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.data.redis.connection.RedisConnectionFactory
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer
;
import
org.springframework.data.redis.serializer.StringRedisSerializer
;
import
com.fasterxml.jackson.annotation.JsonAutoDetect
;
import
com.fasterxml.jackson.annotation.PropertyAccessor
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
@Configuration
public
class
RedisConfig
{
@Bean
public
RedisTemplate
<
String
,
?>
getRedisTemplate
(
RedisConnectionFactory
connectionFactory
)
{
RedisTemplate
<
String
,
?>
template
=
new
RedisTemplate
<>();
template
.
setConnectionFactory
(
connectionFactory
);
Jackson2JsonRedisSerializer
<?>
valueSerializer
=
new
Jackson2JsonRedisSerializer
<
Object
>(
Object
.
class
);
ObjectMapper
mapper
=
new
ObjectMapper
();
mapper
.
setVisibility
(
PropertyAccessor
.
ALL
,
JsonAutoDetect
.
Visibility
.
ANY
);
mapper
.
enableDefaultTyping
(
ObjectMapper
.
DefaultTyping
.
NON_FINAL
);
valueSerializer
.
setObjectMapper
(
mapper
);
template
.
setValueSerializer
(
valueSerializer
);
template
.
setKeySerializer
(
new
StringRedisSerializer
());
template
.
afterPropertiesSet
();
return
template
;
}
}
src/main/resources/application-dev.properties
View file @
9af9691f
...
...
@@ -17,5 +17,17 @@ spring.datasource.password=qiyang@2013
spring.datasource.url
=
jdbc:sqlserver://10.10.0.22:1433;instanceName=SQLSERVER;DatabaseName=EGOLMDEV
spring.datasource.driver-class-name
=
com.microsoft.sqlserver.jdbc.SQLServerDriver
spring.datasource.testWhileIdle
=
true
spring.datasource.validationQueryTimeout
=
5
spring.datasource.validationQuery
=
SELECT 1
spring.datasource.timeBetweenEvictionRunsMillis
=
3600000
\ No newline at end of file
spring.datasource.timeBetweenEvictionRunsMillis
=
3600000
spring.redis.database
=
0
spring.redis.host
=
ossip.cn
spring.redis.port
=
6379
spring.redis.password
=
@8UiMqvDtNgv
spring.redis.timeout
=
2000
spring.redis.pool.max-active
=
20
spring.redis.pool.max-wait
=
2000
spring.redis.pool.max-idle
=
5
spring.redis.pool.min-idle
=
0
\ No newline at end of file
src/main/resources/application-pro.properties
View file @
9af9691f
...
...
@@ -17,5 +17,17 @@ spring.datasource.password=qiyang
spring.datasource.url
=
jdbc:sqlserver://10.10.0.51:56443;instanceName=SQLSERVER;DatabaseName=EGOLMSAAS
spring.datasource.driver-class-name
=
com.microsoft.sqlserver.jdbc.SQLServerDriver
spring.datasource.testWhileIdle
=
true
spring.datasource.validationQueryTimeout
=
5
spring.datasource.validationQuery
=
SELECT 1
spring.datasource.timeBetweenEvictionRunsMillis
=
3600000
spring.redis.database
=
0
spring.redis.host
=
ossip.cn
spring.redis.port
=
6379
spring.redis.password
=
@8UiMqvDtNgv
spring.redis.timeout
=
2000
spring.redis.pool.max-active
=
20
spring.redis.pool.max-wait
=
2000
spring.redis.pool.max-idle
=
5
spring.redis.pool.min-idle
=
0
\ No newline at end of file
src/main/resources/application-test.properties
View file @
9af9691f
...
...
@@ -17,5 +17,17 @@ spring.datasource.password=qiyang
spring.datasource.url
=
jdbc:sqlserver://10.10.0.51:56443;instanceName=SQLSERVER;DatabaseName=EGOLMSAAS
spring.datasource.driver-class-name
=
com.microsoft.sqlserver.jdbc.SQLServerDriver
spring.datasource.testWhileIdle
=
true
spring.datasource.validationQueryTimeout
=
5
spring.datasource.validationQuery
=
SELECT 1
spring.datasource.timeBetweenEvictionRunsMillis
=
3600000
spring.redis.database
=
0
spring.redis.host
=
ossip.cn
spring.redis.port
=
6379
spring.redis.password
=
@8UiMqvDtNgv
spring.redis.timeout
=
2000
spring.redis.pool.max-active
=
20
spring.redis.pool.max-wait
=
2000
spring.redis.pool.max-idle
=
5
spring.redis.pool.min-idle
=
0
\ No newline at end of file
Write
Preview
Markdown
is supported
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