| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | |
| | | return ResultMessage.ok(pageResult); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取用户所属组ids", notes = "获取用户所属组ids") |
| | | @ApiOperation(value = "获取用户组(角色)", notes = "获取用户组(角色)") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "userId", value = "用户id", required = true, paramType = "query", dataType = "int"), |
| | | @ApiImplicitParam(name = "token", value = "token", required = true, paramType = "header", dataType = "String") |
| | | }) |
| | | @RequestMapping(value = "getGroupIds", method = RequestMethod.GET) |
| | | public ResultMessage getGroupIds(Integer userId) { |
| | | System.out.println(userId); |
| | | if (userId == null) { |
| | | @RequestMapping(value = "getGroup", method = RequestMethod.GET) |
| | | public ResultMessage getGroup(Integer userId) { |
| | | if (ObjectUtils.isEmpty(userId)) { |
| | | return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), |
| | | ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg()); |
| | | } |
| | | List<Map<String, Object>> groups = groupService.getGroupIds(userId); |
| | | return ResultMessage.ok(groups); |
| | | Map<String, Object> group = groupService.getGroup(userId); |
| | | return ResultMessage.ok(group); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户分配组", notes = "用户分配组") |