赞
踩
@Data
public class RiskOrderQo {
@NotNull
private String processDefinitionId;
@NotNull
private String processDefinitionName;
@NotNull
private String processDefinitionKey;
@NotNull
private String title;
@NotNull
private String level;
private List<RiskEventDto> businessIds;
@NotNull
private NoticePersonDto noticePersonDto;
private Integer businessType;
}
@Data
public class RiskEventDto {
private Integer id;
private String name;
}
@Data
public class NoticePersonDto {
private List<PersonTreeNode> userIds;
private List<PersonTreeNode> groupIds;
}
@Data
public class PersonTreeNode {
private String id;
private String name;
}
{
"processDefinitionId":"securityIssueWarning:4:e32ff063-d675-11ec-b7e9-225484fbfdd2",
"processDefinitionName":"安全问题预警",
"processDefinitionKey":"securityIssueWarning",
"title":1,
"level":"high",
"businessIds":[
{
"id":"2ca727ca-17fb-407b-bd79-aa4173f45777",
"name":"安全"
},
{
"id":"b7f2e7e1-b6c2-44d4-bc85-38b552679c0c",
"name":"科技"
}
],
"noticePersonDto":{
"userIds":[
{
"id":"sysadmin",
"name":"sysadmin"
}
],
"groupIds":[
{
"id":"sysadmin",
"name":"sysadmin"
}
]
},
"businessType": 1
}
@Data
public class GroupAddVo {
private List<DepartmentVo> departmentVos;
private PageData<DepartmentMemberInfoVo> departmentMemberInfoVos;
}
@Data
public class DepartmentVo {
private Integer id;
private String name;
private List<DepartmentVo> children;
}
@Data
public class DepartmentMemberInfoVo {
private Integer id;
private List<String> deptPath;
}
{
"code": 0,
"message": "保存成功",
"data": {
"departmentVos": [
{
"id": 1,
"name": "部门",
"children": [
{
"id": 2,
"name": "默认部门"
}
]
}
],
"departmentMemberInfoVos": {
"pageNum": 1,
"pageSize": 2,
"totalCount": 2,
"data": [
{
"id": 1,
"deptPath": [
"部门",
"默认部门"
]
}
]
}
}
}
上述的转换方式容易出错,而且比较麻烦,建议直接使用idea的插件 POJO to JSON
选择类,右键,POJO to Json
这样这个类就转换成了json,并在粘贴板中,找一个文本粘贴下来即可:
{
"processDefinitionId": "",
"processDefinitionName": "",
"processDefinitionKey": "",
"title": "",
"level": "",
"businessIds": [
{
"id": 0,
"name": ""
}
],
"noticePersonDto": {
"userIds": [
{
"id": "",
"name": ""
}
],
"groupIds": [
{
"id": "",
"name": ""
}
]
},
"businessType": 0
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。