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
c264b083
Commit
c264b083
authored
Mar 23, 2021
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
不记录系统日志
parent
9d3372ca
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
0 deletions
+54
-0
pom.xml
pom.xml
+1
-0
pom.xml
yzg-util-redis/pom.xml
+23
-0
RedisConfig.java
...c/main/java/com.yanzuoguang.redis/config/RedisConfig.java
+30
-0
readme.md
yzg-util-redis/src/main/java/com.yanzuoguang.redis/readme.md
+0
-0
No files found.
pom.xml
View file @
c264b083
...
...
@@ -19,6 +19,7 @@
<module>
yzg-util-print
</module>
<module>
yzg-util-chinese
</module>
<module>
yzg-util-file
</module>
<module>
yzg-util-redis
</module>
</modules>
<properties>
...
...
yzg-util-redis/pom.xml
0 → 100644
View file @
c264b083
<?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>
yzg-util
</artifactId>
<groupId>
com.yanzuoguang
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
yzg-util-redis
</artifactId>
<dependencies>
<!-- 添加springboot对redis的支持 -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-redis
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
yzg-util-redis/src/main/java/com.yanzuoguang.redis/config/RedisConfig.java
0 → 100644
View file @
c264b083
package
com
.
yanzuoguang
.
redis
.
config
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer
;
import
org.springframework.data.redis.serializer.StringRedisSerializer
;
import
java.io.Serializable
;
/**
* Redis 配置
*
* @author 颜佐光
*/
@Configuration
public
class
RedisConfig
{
/**
* 序列化配置
*/
@Bean
public
RedisTemplate
<
String
,
Serializable
>
redisTemplate
(
LettuceConnectionFactory
redisConnectionFactory
)
{
RedisTemplate
<
String
,
Serializable
>
template
=
new
RedisTemplate
<>();
template
.
setKeySerializer
(
new
StringRedisSerializer
());
template
.
setValueSerializer
(
new
GenericJackson2JsonRedisSerializer
());
template
.
setConnectionFactory
(
redisConnectionFactory
);
return
template
;
}
}
yzg-util-redis/src/main/java/com.yanzuoguang.redis/readme.md
0 → 100755
View file @
c264b083
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