Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
chejia-smart-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 62c8a786
authored
May 14, 2021
by
tyfanchz
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
代码修改
1 parent
dbb3aac4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
src/main/java/com/glsx/admin/config/JacksonMapperConfig.java
src/main/java/com/glsx/admin/config/JacksonMapperConfig.java
View file @
62c8a78
...
@@ -26,22 +26,26 @@ public class JacksonMapperConfig {
...
@@ -26,22 +26,26 @@ public class JacksonMapperConfig {
private
JacksonProperties
jacksonProperties
;
private
JacksonProperties
jacksonProperties
;
@PostConstruct
@PostConstruct
public
void
init
()
{
public
void
configJackson
()
{
if
(
objectMapper
!=
null
&&
jacksonProperties
!=
null
)
{
if
(
objectMapper
!=
null
&&
jacksonProperties
!=
null
)
{
this
.
configSerialization
(
objectMapper
,
jacksonProperties
.
getSerialization
()
);
this
.
configSerialization
(
objectMapper
,
jacksonProperties
);
this
.
configDeserialization
(
objectMapper
,
jacksonProperties
.
getDeserialization
()
);
this
.
configDeserialization
(
objectMapper
,
jacksonProperties
);
this
.
configOthers
(
objectMapper
,
jacksonProperties
);
this
.
configOthers
(
objectMapper
,
jacksonProperties
);
}
}
}
}
private
void
configSerialization
(
ObjectMapper
objectMapper
,
private
void
configSerialization
(
ObjectMapper
objectMapper
,
JacksonProperties
properties
)
{
Map
<
SerializationFeature
,
Boolean
>
features
)
{
Map
<
SerializationFeature
,
Boolean
>
serialization
=
properties
.
getSerialization
();
features
.
forEach
(
objectMapper:
:
configure
);
if
(
serialization
!=
null
)
{
serialization
.
forEach
(
objectMapper:
:
configure
);
}
}
}
private
void
configDeserialization
(
ObjectMapper
objectMapper
,
private
void
configDeserialization
(
ObjectMapper
objectMapper
,
JacksonProperties
properties
)
{
Map
<
DeserializationFeature
,
Boolean
>
features
)
{
Map
<
DeserializationFeature
,
Boolean
>
deserialization
=
properties
.
getDeserialization
();
features
.
forEach
(
objectMapper:
:
configure
);
if
(
deserialization
!=
null
)
{
deserialization
.
forEach
(
objectMapper:
:
configure
);
}
}
}
private
void
configOthers
(
ObjectMapper
objectMapper
,
JacksonProperties
properties
)
{
private
void
configOthers
(
ObjectMapper
objectMapper
,
JacksonProperties
properties
)
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment