[{
"roleModel": {
"roleId": 27,
"roleCode": "role_analyst",
"roleName": "分析师"
},
"workspaceName": "营销组",
"workspaceId": "asgaeqwesd-123asdqw"
}, {
"roleModel": {
"roleId": 27,
"roleCode": "role_workspace_analyst",
"roleName": "分析师"
},
"workspaceName": "管理组",
"workspaceId": "aaaase123-1"
}]
导入依赖与包
cn.hutool
hutool-all
5.8.0.M2
import cn.hutool.json.JSONUtil;
String s ="[{
"roleModel": {
"roleId": 27,
"roleCode": "role_analyst",
"roleName": "分析师"
},
"workspaceName": "营销组",
"workspaceId": "asgaeqwesd-123asdqw"
}, {
"roleModel": {
"roleId": 27,
"roleCode": "role_workspace_analyst",
"roleName": "分析师"
},
"workspaceName": "管理组",
"workspaceId": "aaaase123-1"
}]"
List
最后输出的数据;
{
"roleModel": {
"roleId": 27,
"roleCode": "role_analyst",
"roleName": "分析师"
},
"workspaceName": "营销组",
"workspaceId": "asgaeqwesd-123asdqw"
}
{
"roleModel": {
"roleId": 27,
"roleCode": "role_workspace_analyst",
"roleName": "分析师"
},
"workspaceName": "管理组",
"workspaceId": "aaaase123-1"
}
List