Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
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
YZG
yzg-util
Commits
9094de7a
Commit
9094de7a
authored
Mar 24, 2021
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
不记录系统日志
parent
25b72fb8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
RedisConfig.java
...c/main/java/com.yanzuoguang.redis/config/RedisConfig.java
+16
-0
No files found.
yzg-util-redis/src/main/java/com.yanzuoguang.redis/config/RedisConfig.java
View file @
9094de7a
package
com
.
yanzuoguang
.
redis
.
config
;
import
com.alicp.jetcache.autoconfigure.LettuceFactory
;
import
com.alicp.jetcache.autoconfigure.RedisLettuceAutoConfiguration
;
import
io.lettuce.core.RedisClient
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.DependsOn
;
import
org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer
;
...
...
@@ -27,4 +31,16 @@ public class RedisConfig {
template
.
setConnectionFactory
(
redisConnectionFactory
);
return
template
;
}
/**
* 序列化工具
*
* @return
*/
@Bean
(
name
=
"defaultClient"
)
@DependsOn
(
RedisLettuceAutoConfiguration
.
AUTO_INIT_BEAN_NAME
)
public
LettuceFactory
defaultClient
()
{
return
new
LettuceFactory
(
"remote.default"
,
RedisClient
.
class
);
}
}
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