mirror of
https://gitee.com/jzsw-it/yexuejc-base.git
synced 2025-06-06 22:04:04 +08:00
json支持下划线、驼峰互转
This commit is contained in:
parent
e7e89563d9
commit
3b83e22ac7
@ -12,6 +12,7 @@ import java.io.InputStream;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
||||
/**
|
||||
* json工具类,基于jackson
|
||||
*
|
||||
@ -47,6 +48,8 @@ public class JsonUtil {
|
||||
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
|
||||
objectMapper.setDateFormat(DateUtil.DATE_TIME_FORMAT);
|
||||
//驼峰下划线互转
|
||||
objectMapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user