| | |
| | | import com.moral.api.entity.Group; |
| | | import com.moral.api.service.GroupService; |
| | | import com.moral.api.service.UserGroupService; |
| | | import com.moral.api.service.UserService; |
| | | import com.moral.api.utils.OperationLogUtils; |
| | | import com.moral.constant.ResponseCodeEnum; |
| | | import com.moral.constant.ResultMessage; |
| | |
| | | @Autowired |
| | | private UserGroupService userGroupService; |
| | | |
| | | @Autowired |
| | | private UserService userService; |
| | | |
| | | @ApiOperation(value = "添加组", notes = "添加组") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "token", value = "token", required = true, paramType = "header", dataType = "String") |
| | |
| | | if (!result.isEmpty()) { |
| | | return ResultMessage.fail((int) result.get("code"), result.get("msg").toString()); |
| | | } |
| | | |
| | | //日志 |
| | | String content = "添加了组:" + group.getGroupName(); |
| | | OperationLogUtils.insertLog(request, content); |
| | | return ResultMessage.ok(); |
| | | } |
| | | |
| | |
| | | return ResultMessage.fail(ResponseCodeEnum.ACCOUNT_NOT_EXIST.getCode(), ResponseCodeEnum.ACCOUNT_NOT_EXIST.getMsg()); |
| | | } |
| | | groupService.deleteGroup(group); |
| | | |
| | | //日志 |
| | | String content = "删除了组:" + group.getGroupName(); |
| | | OperationLogUtils.insertLog(request, content); |
| | | return ResultMessage.ok(); |
| | | } |
| | | |
| | |
| | | if (!result.isEmpty()) { |
| | | return ResultMessage.fail((int) result.get("code"), result.get("msg").toString()); |
| | | } |
| | | |
| | | //日志 |
| | | String content = "修改了组:" + group.getGroupName(); |
| | | OperationLogUtils.insertLog(request, content); |
| | | return ResultMessage.ok(); |
| | | } |
| | | |
| | |
| | | return ResultMessage.ok(pageResult); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取用户所属组", notes = "获取用户所属组") |
| | | @ApiOperation(value = "获取用户所属组ids", notes = "获取用户所属组ids") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "token", value = "token", required = true, paramType = "header", dataType = "String") |
| | | }) |
| | |
| | | } |
| | | String token = request.getHeader("token"); |
| | | userGroupService.allotGroups(parameters, token); |
| | | |
| | | String account = userService.getById((Integer) parameters.get("userId")).getAccount(); |
| | | String content = "给账户《" + account + "》分配了组"; |
| | | OperationLogUtils.insertLog(request, content); |
| | | return ResultMessage.ok(); |
| | | } |
| | | } |