Commit dbb3aac4 by tyfanchz

增加jackson配置兼容性

1 parent a082b3b1
...@@ -45,8 +45,14 @@ public class JacksonMapperConfig { ...@@ -45,8 +45,14 @@ public class JacksonMapperConfig {
} }
private void configOthers(ObjectMapper objectMapper, JacksonProperties properties) { private void configOthers(ObjectMapper objectMapper, JacksonProperties properties) {
objectMapper.setDateFormat(new SimpleDateFormat(properties.getDateFormat())); if (properties.getDateFormat() != null) {
objectMapper.setTimeZone(properties.getTimeZone()); objectMapper.setDateFormat(new SimpleDateFormat(properties.getDateFormat()));
objectMapper.setLocale(properties.getLocale()); }
if (properties.getTimeZone() != null) {
objectMapper.setTimeZone(properties.getTimeZone());
}
if (properties.getLocale() != null) {
objectMapper.setLocale(properties.getLocale());
}
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!