Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
matrix
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
mall
arch
matrix
Commits
6f1d5fca
Commit
6f1d5fca
authored
Mar 21, 2020
by
liqiuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add redis-starter
parent
a3f88966
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
0 deletions
+56
-0
pom.xml
matrix-datahelper/matrix-datahelper-redis-starter/pom.xml
+16
-0
MatrixeRedisAutoConfiguration.java
matrix-datahelper/matrix-datahelper-redis-starter/src/main/java/com/secoo/mall/mybatis/spring/boot/autoconfigure/MatrixeRedisAutoConfiguration.java
+40
-0
No files found.
matrix-datahelper/matrix-datahelper-redis-starter/pom.xml
0 → 100644
View file @
6f1d5fca
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
matrix-datahelper
</artifactId>
<groupId>
com.secoo.mall
</groupId>
<version>
1.3.2.RELEASE
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
matrix-datahelper-redis-starter
</artifactId>
</project>
\ No newline at end of file
matrix-datahelper/matrix-datahelper-redis-starter/src/main/java/com/secoo/mall/mybatis/spring/boot/autoconfigure/MatrixeRedisAutoConfiguration.java
0 → 100644
View file @
6f1d5fca
package
com
.
secoo
.
mall
.
redis
.
config
;
import
com.secoo.mall.redis.utils.MatrixRedisClusterUtils
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
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.RedisSerializer
;
import
org.springframework.data.redis.serializer.StringRedisSerializer
;
/**
* Created by QIANG
*
* @author QIANG
*/
@Configuration
public
class
MatrixeRedisAutoConfiguration
{
@Bean
public
RedisTemplate
<
String
,
String
>
redisTemplate
(
RedisConnectionFactory
redisConnectionFactory
)
{
RedisSerializer
stringSerializer
=
new
StringRedisSerializer
();
RedisTemplate
<
String
,
String
>
redisTemplate
=
new
RedisTemplate
();
redisTemplate
.
setConnectionFactory
(
redisConnectionFactory
);
redisTemplate
.
setKeySerializer
(
stringSerializer
);
redisTemplate
.
setValueSerializer
(
stringSerializer
);
redisTemplate
.
setHashKeySerializer
(
stringSerializer
);
redisTemplate
.
setHashValueSerializer
(
stringSerializer
);
return
redisTemplate
;
}
@Bean
@ConditionalOnMissingBean
(
MatrixRedisClusterUtils
.
class
)
public
MatrixRedisClusterUtils
jedisClusterUtils
()
{
return
new
MatrixRedisClusterUtils
();
}
}
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