use of org.lpw.ranch.editor.role.RoleModel in project ranch by heisedebaise.
the class EditorServiceImpl method queryUser.
@Override
public JSONObject queryUser() {
PageList<RoleModel> roles = roleService.query(userHelper.id());
JSONArray list = new JSONArray();
roles.getList().forEach(role -> list.add(find(role.getEditor())));
JSONObject object = roles.toJson(false);
object.put("list", list);
return object;
}
use of org.lpw.ranch.editor.role.RoleModel in project ranch by heisedebaise.
the class EditorServiceImpl method toJson.
private JSONObject toJson(EditorModel editor) {
JSONObject object = modelHelper.toJson(editor);
RoleModel role = roleService.find(userHelper.id(), editor.getId());
if (role == null)
return object;
object.put("role", role.getType());
return object;
}
Aggregations