style(web): 优化代码缩进
This commit is contained in:
@@ -11,58 +11,58 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
* @date 2024-12-03
|
||||
*/
|
||||
public class TestQueryParse {
|
||||
public static void main(String[] args) throws JsonProcessingException {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
mapper.registerModule(new EclipseCollectionsModule());
|
||||
mapper.registerModule(new JavaTimeModule());
|
||||
// language=JSON
|
||||
System.out.println(mapper.readValue("{}", Query.class));
|
||||
// language=JSON
|
||||
System.out.println(mapper.readValue("{\n" +
|
||||
" \"query\": {\n" +
|
||||
" \"equal\": {\n" +
|
||||
" \"name\": \"lanyuanxiaoyao\"\n" +
|
||||
" }\n" +
|
||||
" }\n" +
|
||||
"}", Query.class));
|
||||
// language=JSON
|
||||
System.out.println(mapper.readValue("{\n" +
|
||||
" \"query\": {\n" +
|
||||
" \"equal\": {\n" +
|
||||
" \"name\": \"lanyuanxiaoyao\"\n" +
|
||||
" },\n" +
|
||||
" \"notEqual\": {\n" +
|
||||
" \"username\": \"lanyuanxiaoyao@qq.com\",\n" +
|
||||
" \"password\": \"mingland87\"\n" +
|
||||
" },\n" +
|
||||
" \"great\": {\n" +
|
||||
" \"age\": 12,\n" +
|
||||
" \"createTime\": \"2020-10-12 00:00:00\"\n" +
|
||||
" },\n" +
|
||||
" \"in\": {\n" +
|
||||
" \"age\": [\n" +
|
||||
" 15,\n" +
|
||||
" 18,\n" +
|
||||
" 20\n" +
|
||||
" ]\n" +
|
||||
" },\n" +
|
||||
" \"between\": {\n" +
|
||||
" \"createTime\": {\n" +
|
||||
" \"start\": \"2024-12-03 00:00:00\",\n" +
|
||||
" \"end\": \"2024-12-03 00:00:00\"\n" +
|
||||
" }\n" +
|
||||
" }\n" +
|
||||
" },\n" +
|
||||
" \"sort\": [\n" +
|
||||
" {\n" +
|
||||
" \"column\": \"createTime\",\n" +
|
||||
" \"direction\": \"ASC\"\n" +
|
||||
" }\n" +
|
||||
" ],\n" +
|
||||
" \"page\": {\n" +
|
||||
" \"size\": 10,\n" +
|
||||
" \"page\": 1\n" +
|
||||
" }\n" +
|
||||
"}", Query.class));
|
||||
}
|
||||
public static void main(String[] args) throws JsonProcessingException {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
mapper.registerModule(new EclipseCollectionsModule());
|
||||
mapper.registerModule(new JavaTimeModule());
|
||||
// language=JSON
|
||||
System.out.println(mapper.readValue("{}", Query.class));
|
||||
// language=JSON
|
||||
System.out.println(mapper.readValue("{\n" +
|
||||
" \"query\": {\n" +
|
||||
" \"equal\": {\n" +
|
||||
" \"name\": \"lanyuanxiaoyao\"\n" +
|
||||
" }\n" +
|
||||
" }\n" +
|
||||
"}", Query.class));
|
||||
// language=JSON
|
||||
System.out.println(mapper.readValue("{\n" +
|
||||
" \"query\": {\n" +
|
||||
" \"equal\": {\n" +
|
||||
" \"name\": \"lanyuanxiaoyao\"\n" +
|
||||
" },\n" +
|
||||
" \"notEqual\": {\n" +
|
||||
" \"username\": \"lanyuanxiaoyao@qq.com\",\n" +
|
||||
" \"password\": \"mingland87\"\n" +
|
||||
" },\n" +
|
||||
" \"great\": {\n" +
|
||||
" \"age\": 12,\n" +
|
||||
" \"createTime\": \"2020-10-12 00:00:00\"\n" +
|
||||
" },\n" +
|
||||
" \"in\": {\n" +
|
||||
" \"age\": [\n" +
|
||||
" 15,\n" +
|
||||
" 18,\n" +
|
||||
" 20\n" +
|
||||
" ]\n" +
|
||||
" },\n" +
|
||||
" \"between\": {\n" +
|
||||
" \"createTime\": {\n" +
|
||||
" \"start\": \"2024-12-03 00:00:00\",\n" +
|
||||
" \"end\": \"2024-12-03 00:00:00\"\n" +
|
||||
" }\n" +
|
||||
" }\n" +
|
||||
" },\n" +
|
||||
" \"sort\": [\n" +
|
||||
" {\n" +
|
||||
" \"column\": \"createTime\",\n" +
|
||||
" \"direction\": \"ASC\"\n" +
|
||||
" }\n" +
|
||||
" ],\n" +
|
||||
" \"page\": {\n" +
|
||||
" \"size\": 10,\n" +
|
||||
" \"page\": 1\n" +
|
||||
" }\n" +
|
||||
"}", Query.class));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user