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
a9b2085d
Commit
a9b2085d
authored
Mar 21, 2020
by
liqiuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善redis
parent
46aecfb6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
33 deletions
+57
-33
RedisHelper.java
matrix-datahelper/matrix-datahelper-redis-core/src/main/java/com/secoo/mall/redis/helper/RedisHelper.java
+0
-0
pom.xml
matrix-datahelper/matrix-datahelper-redis-starter/pom.xml
+5
-0
MatrixeRedisAutoConfiguration.java
matrix-datahelper/matrix-datahelper-redis-starter/src/main/java/com/secoo/mall/mybatis/spring/boot/autoconfigure/MatrixeRedisAutoConfiguration.java
+0
-31
MatrixeRedisAutoConfiguration.java
matrix-datahelper/matrix-datahelper-redis-starter/src/main/java/com/secoo/mall/redis/spring/boot/autoconfigure/MatrixeRedisAutoConfiguration.java
+41
-0
spring.factories
matrix-datahelper/matrix-datahelper-redis-starter/src/main/resources/META-INF/spring.factories
+4
-0
pom.xml
pom.xml
+7
-2
No files found.
matrix-datahelper/matrix-datahelper-redis-core/src/main/java/com/secoo/mall/redis/
template/MatrixRedisTemplate
.java
→
matrix-datahelper/matrix-datahelper-redis-core/src/main/java/com/secoo/mall/redis/
helper/RedisHelper
.java
View file @
a9b2085d
This diff is collapsed.
Click to expand it.
matrix-datahelper/matrix-datahelper-redis-starter/pom.xml
View file @
a9b2085d
...
@@ -15,6 +15,10 @@
...
@@ -15,6 +15,10 @@
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-redis
</artifactId>
<artifactId>
spring-boot-starter-data-redis
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-datahelper-redis-core
</artifactId>
</dependency>
</dependencies>
</dependencies>
</project>
</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
deleted
100644 → 0
View file @
46aecfb6
package
com
.
secoo
.
mall
.
mybatis
.
spring
.
boot
.
autoconfigure
;
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
;
}
}
matrix-datahelper/matrix-datahelper-redis-starter/src/main/java/com/secoo/mall/redis/spring/boot/autoconfigure/MatrixeRedisAutoConfiguration.java
0 → 100644
View file @
a9b2085d
package
com
.
secoo
.
mall
.
redis
.
spring
.
boot
.
autoconfigure
;
import
com.secoo.mall.redis.helper.RedisHelper
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.boot.autoconfigure.AutoConfigureBefore
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration
;
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.RedisOperations
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
java.net.UnknownHostException
;
/**
* Created by QIANG
*
* @author QIANG
*/
@Configuration
@ConditionalOnClass
({
RedisOperations
.
class
})
@AutoConfigureBefore
({
RedisAutoConfiguration
.
class
})
public
class
MatrixeRedisAutoConfiguration
{
@Bean
@ConditionalOnMissingBean
(
name
=
{
"redisTemplate"
})
public
RedisTemplate
<
Object
,
Object
>
redisTemplate
(
RedisConnectionFactory
redisConnectionFactory
)
throws
UnknownHostException
{
RedisTemplate
<
Object
,
Object
>
template
=
new
RedisTemplate
();
template
.
setConnectionFactory
(
redisConnectionFactory
);
return
template
;
}
@Bean
@ConditionalOnMissingBean
(
name
=
"redisHelper"
)
public
RedisHelper
redisHelper
(
@Qualifier
(
"redisTemplate"
)
RedisTemplate
redisTemplate
)
{
return
new
RedisHelper
(
redisTemplate
);
}
}
matrix-datahelper/matrix-datahelper-redis-starter/src/main/resources/META-INF/spring.factories
0 → 100644
View file @
a9b2085d
# Auto Configure
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.secoo.mall.redis.spring.boot.autoconfigure.MatrixeRedisAutoConfiguration
\ No newline at end of file
pom.xml
View file @
a9b2085d
...
@@ -172,11 +172,16 @@
...
@@ -172,11 +172,16 @@
<version>
1.3.2.RELEASE
</version>
<version>
1.3.2.RELEASE
</version>
</dependency>
</dependency>
<!--redis-->
<!--redis-->
<!-- <dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-datahelper-redis-core
</artifactId>
<version>
1.3.2.RELEASE
</version>
</dependency>
<dependency>
<groupId>
com.secoo.mall
</groupId>
<groupId>
com.secoo.mall
</groupId>
<artifactId>
matrix-datahelper-redis-starter
</artifactId>
<artifactId>
matrix-datahelper-redis-starter
</artifactId>
<version>
1.3.2.RELEASE
</version>
<version>
1.3.2.RELEASE
</version>
</dependency>
-->
</dependency>
<!--普通jar-->
<!--普通jar-->
...
...
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