Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Eladmin
Commits
a97fb6ba
Commit
a97fb6ba
authored
Dec 13, 2020
by
zhengjie
Browse files
[代码优化](v2.6):序列化优化
parent
cbaa49fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
eladmin-system/src/main/java/me/zhengjie/config/ConfigurerAdapter.java
View file @
a97fb6ba
...
...
@@ -78,10 +78,7 @@ public class ConfigurerAdapter implements WebMvcConfigurer {
supportMediaTypeList
.
add
(
MediaType
.
APPLICATION_JSON_UTF8
);
FastJsonConfig
config
=
new
FastJsonConfig
();
config
.
setDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
config
.
setSerializerFeatures
(
SerializerFeature
.
DisableCircularReferenceDetect
,
//保留空的字段
SerializerFeature
.
WriteMapNullValue
);
config
.
setSerializerFeatures
(
SerializerFeature
.
DisableCircularReferenceDetect
);
converter
.
setFastJsonConfig
(
config
);
converter
.
setSupportedMediaTypes
(
supportMediaTypeList
);
converter
.
setDefaultCharset
(
StandardCharsets
.
UTF_8
);
...
...
Write
Preview
Supports
Markdown
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