Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
isc-common
Overview
Overview
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
isc-v3.1-tmp
isc-common
Commits
c7a15bcc
Commit
c7a15bcc
authored
Oct 22, 2024
by
hulei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提JacksonRedisTemplate至SDK
parent
d0eb3663
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
RedisTemplateBuilder.java
...om/brilliance/isc/support/redis/RedisTemplateBuilder.java
+5
-2
No files found.
isc-cloud-sdk/isc-sdk-core/src/main/java/com/brilliance/isc/support/redis/RedisTemplateBuilder.java
View file @
c7a15bcc
...
...
@@ -17,11 +17,10 @@ import org.springframework.data.redis.serializer.StringRedisSerializer;
**/
public
class
RedisTemplateBuilder
{
public
static
RedisTemplate
<
String
,
Object
>
craeteJacksonRedisTemplate
(
RedisConnectionFactory
factory
){
public
static
RedisTemplate
<
String
,
Object
>
craeteJacksonRedisTemplate
(
RedisConnectionFactory
factory
,
ObjectMapper
objectMapper
){
RedisTemplate
<
String
,
Object
>
template
=
new
RedisTemplate
<>();
template
.
setConnectionFactory
(
factory
);
ObjectMapper
objectMapper
=
new
ObjectMapper
();
objectMapper
.
setVisibility
(
PropertyAccessor
.
ALL
,
JsonAutoDetect
.
Visibility
.
ANY
);
objectMapper
.
activateDefaultTyping
(
LaissezFaireSubTypeValidator
.
instance
,
ObjectMapper
.
DefaultTyping
.
NON_FINAL
,
JsonTypeInfo
.
As
.
PROPERTY
);
...
...
@@ -41,4 +40,8 @@ public class RedisTemplateBuilder {
return
template
;
}
public
static
RedisTemplate
<
String
,
Object
>
craeteJacksonRedisTemplate
(
RedisConnectionFactory
factory
)
{
return
craeteJacksonRedisTemplate
(
factory
,
new
ObjectMapper
());
}
}
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