JavaBean 是这样的
Class User{
private Long id;
private Integer active;
private String sn;
private String name;
private String kind;
private String gender;
private Integer age;
private String remark;
private Object data;
}
Object data 中是一个 JsonObject schema 文件要怎么写才能让 User 类映射上去 想要的显示结果是这样的
{
"data": {
"userById": {
"id": 1,
"active": 1,
"sn": "kg",
"name": "库管",
"age": null
...
"data": {
"role": "aa"
"phone": "1111111"
...
}
}
}
}
1
jiobanma OP 以解决,将 user 直接转为 JsonObject 然后 schema 对应就好了
|