Search in sources :

Example 6 with LogAnnotation

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();
}
Also used : LoginAuthDto(com.paascloud.base.dto.LoginAuthDto) LogAnnotation(com.paascloud.core.annotation.LogAnnotation) ApiOperation(io.swagger.annotations.ApiOperation)

Example 7 with LogAnnotation

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, "操作成功");
    }
}
Also used : UacGroup(com.paascloud.provider.model.domain.UacGroup) LoginAuthDto(com.paascloud.base.dto.LoginAuthDto) LogAnnotation(com.paascloud.core.annotation.LogAnnotation) ApiOperation(io.swagger.annotations.ApiOperation)

Example 8 with LogAnnotation

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();
}
Also used : LoginAuthDto(com.paascloud.base.dto.LoginAuthDto) LogAnnotation(com.paascloud.core.annotation.LogAnnotation) ApiOperation(io.swagger.annotations.ApiOperation)

Example 9 with LogAnnotation

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);
}
Also used : UacBizException(com.paascloud.provider.model.exceptions.UacBizException) UacRoleUser(com.paascloud.provider.model.domain.UacRoleUser) LoginAuthDto(com.paascloud.base.dto.LoginAuthDto) UacRole(com.paascloud.provider.model.domain.UacRole) LogAnnotation(com.paascloud.core.annotation.LogAnnotation) ApiOperation(io.swagger.annotations.ApiOperation)

Example 10 with LogAnnotation

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();
}
Also used : LoginAuthDto(com.paascloud.base.dto.LoginAuthDto) LogAnnotation(com.paascloud.core.annotation.LogAnnotation) ApiOperation(io.swagger.annotations.ApiOperation) ValidateAnnotation(com.paascloud.core.annotation.ValidateAnnotation)

Aggregations

LogAnnotation (com.paascloud.core.annotation.LogAnnotation)24 LoginAuthDto (com.paascloud.base.dto.LoginAuthDto)22 ApiOperation (io.swagger.annotations.ApiOperation)22 ValidateAnnotation (com.paascloud.core.annotation.ValidateAnnotation)2 PostMapping (org.springframework.web.bind.annotation.PostMapping)2 OperationLogDto (com.paascloud.core.annotation.OperationLogDto)1 MdcProductCategory (com.paascloud.provider.model.domain.MdcProductCategory)1 TpcMqConsumer (com.paascloud.provider.model.domain.TpcMqConsumer)1 TpcMqProducer (com.paascloud.provider.model.domain.TpcMqProducer)1 TpcMqTag (com.paascloud.provider.model.domain.TpcMqTag)1 TpcMqTopic (com.paascloud.provider.model.domain.TpcMqTopic)1 UacAction (com.paascloud.provider.model.domain.UacAction)1 UacGroup (com.paascloud.provider.model.domain.UacGroup)1 UacMenu (com.paascloud.provider.model.domain.UacMenu)1 UacRole (com.paascloud.provider.model.domain.UacRole)1 UacRoleUser (com.paascloud.provider.model.domain.UacRoleUser)1 UacUser (com.paascloud.provider.model.domain.UacUser)1 UacBizException (com.paascloud.provider.model.exceptions.UacBizException)1 UserAgent (eu.bitwalker.useragentutils.UserAgent)1 Method (java.lang.reflect.Method)1