use of com.paascloud.core.annotation.LogAnnotation in project paascloud-master by paascloud.
the class UacGroupMainController method editGroup.
/**
* 编辑组织
*
* @param group the group
*
* @return the wrapper
*/
@PostMapping(value = "/save")
@LogAnnotation
@ApiOperation(httpMethod = "POST", value = "修改组织信息")
public Wrapper editGroup(@ApiParam(name = "group", value = "组织信息") @RequestBody UacGroup group) {
LoginAuthDto loginAuthDto = super.getLoginAuthDto();
uacGroupService.saveUacGroup(group, loginAuthDto);
return WrapMapper.ok();
}
use of com.paascloud.core.annotation.LogAnnotation in project paascloud-master by paascloud.
the class UacGroupMainController method modifyGroupStatus.
/**
* 根据id修改组织状态
*
* @param idStatusDto the id status dto
*
* @return the wrapper
*/
@PostMapping(value = "/modifyStatus")
@LogAnnotation
@ApiOperation(httpMethod = "POST", value = "根据id修改组织状态")
public Wrapper modifyGroupStatus(@ApiParam(name = "modifyGroupStatus", value = "修改状态") @RequestBody IdStatusDto idStatusDto) {
logger.info("根据id修改组织状态 idStatusDto={}", idStatusDto);
UacGroup uacGroup = new UacGroup();
uacGroup.setId(idStatusDto.getId());
LoginAuthDto loginAuthDto = super.getLoginAuthDto();
Integer status = idStatusDto.getStatus();
uacGroup.setStatus(status);
int result = uacGroupService.updateUacGroupStatusById(idStatusDto, loginAuthDto);
if (result < 1) {
return WrapMapper.wrap(Wrapper.ERROR_CODE, "操作失败");
} else {
return WrapMapper.wrap(Wrapper.SUCCESS_CODE, "操作成功");
}
}
use of com.paascloud.core.annotation.LogAnnotation in project paascloud-master by paascloud.
the class UacRoleBindUserController method bindUser.
/**
* 角色绑定用户.
*
* @param roleBindUserReqDto the role bind user req dto
*
* @return the wrapper
*/
@LogAnnotation
@PostMapping(value = "/bindUser")
@ApiOperation(httpMethod = "POST", value = "角色绑定用户")
public Wrapper bindUser(@ApiParam(name = "uacRoleBindUserReqDto", value = "角色绑定用户") @RequestBody RoleBindUserReqDto roleBindUserReqDto) {
logger.info("roleBindUser={}", roleBindUserReqDto);
LoginAuthDto loginAuthDto = getLoginAuthDto();
uacRoleService.bindUser4Role(roleBindUserReqDto, loginAuthDto);
return WrapMapper.ok();
}
use of com.paascloud.core.annotation.LogAnnotation in project paascloud-master by paascloud.
the class UacRoleMainController method modifyUacRoleStatusById.
/**
* 修改角色状态.
*
* @param modifyStatusDto the modify status dto
*
* @return the wrapper
*/
@LogAnnotation
@PostMapping(value = "/modifyRoleStatusById")
@ApiOperation(httpMethod = "POST", value = "根据角色Id修改角色状态")
public Wrapper modifyUacRoleStatusById(@ApiParam(name = "modifyRoleStatusDto", value = "修改角色状态数据") @RequestBody ModifyStatusDto modifyStatusDto) {
logger.info("根据角色Id修改角色状态 modifyStatusDto={}", modifyStatusDto);
Long roleId = modifyStatusDto.getId();
if (roleId == null) {
throw new UacBizException(ErrorCodeEnum.UAC10012001);
}
LoginAuthDto loginAuthDto = getLoginAuthDto();
Long userId = loginAuthDto.getUserId();
UacRoleUser ru = uacRoleUserService.getByUserIdAndRoleId(userId, roleId);
if (ru != null && UacRoleStatusEnum.DISABLE.getType().equals(modifyStatusDto.getStatus())) {
throw new UacBizException(ErrorCodeEnum.UAC10012002);
}
UacRole uacRole = new UacRole();
uacRole.setId(roleId);
uacRole.setStatus(modifyStatusDto.getStatus());
uacRole.setUpdateInfo(loginAuthDto);
int result = uacRoleService.update(uacRole);
return super.handleResult(result);
}
use of com.paascloud.core.annotation.LogAnnotation in project paascloud-master by paascloud.
the class UacRoleMainController method save.
/**
* 保存用户.
*
* @param role the role
*
* @return the wrapper
*/
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增角色")
@ValidateAnnotation
@LogAnnotation
public Wrapper save(@ApiParam(name = "role", value = "角色信息") @RequestBody UacRole role) {
LoginAuthDto loginAuthDto = RequestUtil.getLoginUser();
uacRoleService.saveRole(role, loginAuthDto);
return WrapMapper.ok();
}
Aggregations