Commit ca55bfb0 by chenweisong

更新

parent 235ee9b5
......@@ -34,13 +34,25 @@ public class UserController {
return users;
}
@ApiOperation(value = "根据组织id获取用户组", hidden = true)
@ApiOperation(value = "根据组织id获取用户组")
@ApiImplicitParams({
@ApiImplicitParam(name = "orgId", value = "机构id", paramType = "query", required = true, dataType = "long")
})
@GetMapping(value = "/groups")
@GetMapping(value = "/userGroups")
public List<Map> getUserGroups(long orgId) {
List<Map> userGroups = feignAuthService.getUserGroups(0, orgId);
userGroups.forEach(group -> {
long groupId = Long.parseLong(group.get("id").toString());
List<Map> users = feignAuthService.getGroupUsers(0L, groupId);
List<Map> groupSubNodes = new ArrayList<>();
users.forEach(user -> {
Map node = new HashMap();
long userId = Long.parseLong(user.get("id").toString());
node.put("node", ImmutableMap.of("id", userId, "name", user.get("name").toString(), "orgId", orgId));
groupSubNodes.add(node);
});
group.put("subNodes", groupSubNodes);
});
return userGroups;
}
......@@ -56,7 +68,7 @@ public class UserController {
/**
* tree structure
*
* <p>
* {
* node: {},
* subNodes: [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment