use of com.paascloud.core.annotation.LogAnnotation in project paascloud-master by paascloud.
the class UacUserMainController method modifyUserStatusById.
/**
* 根据Id修改用户状态.
*
* @param modifyUserStatusDto the modify user status dto
*
* @return the wrapper
*/
@PostMapping(value = "/modifyUserStatusById")
@LogAnnotation
@ApiOperation(httpMethod = "POST", value = "根据Id修改用户状态")
public Wrapper<Integer> modifyUserStatusById(@ApiParam(name = "modifyUserStatusDto", value = "用户禁用/启用Dto") @RequestBody ModifyUserStatusDto modifyUserStatusDto) {
logger.info(" 根据Id修改用户状态 modifyUserStatusDto={}", modifyUserStatusDto);
LoginAuthDto loginAuthDto = getLoginAuthDto();
UacUser uacUser = new UacUser();
uacUser.setId(modifyUserStatusDto.getUserId());
uacUser.setStatus(modifyUserStatusDto.getStatus());
int result = uacUserService.modifyUserStatusById(uacUser, loginAuthDto);
return handleResult(result);
}
use of com.paascloud.core.annotation.LogAnnotation in project paascloud-master by paascloud.
the class UacUserMainController method bindUserRoles.
/**
* 用户绑定角色.
*
* @param bindUserRolesDto the bind user roles dto
*
* @return the wrapper
*/
@PostMapping(value = "/bindRole")
@LogAnnotation
@ApiOperation(httpMethod = "POST", value = "用户绑定角色")
public Wrapper<Integer> bindUserRoles(@ApiParam(name = "bindUserRolesDto", value = "用户绑定角色Dto") @RequestBody BindUserRolesDto bindUserRolesDto) {
logger.info("用户绑定角色 bindUserRolesDto={}", bindUserRolesDto);
LoginAuthDto loginAuthDto = getLoginAuthDto();
uacUserService.bindUserRoles(bindUserRolesDto, loginAuthDto);
return WrapMapper.ok();
}
use of com.paascloud.core.annotation.LogAnnotation in project paascloud-master by paascloud.
the class UacMenuMainController method deleteUacMenuById.
/**
* 根据id删除菜单
*
* @param id the id
*
* @return the wrapper
*/
@PostMapping(value = "/deleteById/{id}")
@ApiOperation(httpMethod = "POST", value = "删除菜单")
@LogAnnotation
public Wrapper<Integer> deleteUacMenuById(@ApiParam(name = "id", value = "菜单id") @PathVariable Long id) {
logger.info(" 根据id删除菜单 id={}", id);
LoginAuthDto loginAuthDto = getLoginAuthDto();
Preconditions.checkArgument(id != null, "菜单ID不能为空");
// 判断此菜单是否有子节点
boolean hasChild = uacMenuService.checkMenuHasChildMenu(id);
if (hasChild) {
return WrapMapper.wrap(Wrapper.ERROR_CODE, "此菜单含有子菜单, 请先删除子菜单");
}
int result = uacMenuService.deleteUacMenuById(id, loginAuthDto);
return super.handleResult(result);
}
use of com.paascloud.core.annotation.LogAnnotation in project paascloud-master by paascloud.
the class UacMenuMainController method updateUacMenuStatusById.
/**
* 根据id修改菜单的禁用状态
*
* @param uacMenuStatusDto the uac menu status dto
*
* @return the wrapper
*/
@PostMapping(value = "/modifyStatus")
@ApiOperation(httpMethod = "POST", value = "修改菜单状态")
@LogAnnotation
public Wrapper updateUacMenuStatusById(@ApiParam(name = "uacMenuStatusDto", value = "修改菜单状态Dto") @RequestBody UacMenuStatusDto uacMenuStatusDto) {
logger.info("根据id修改菜单的禁用状态 uacMenuStatusDto={}", uacMenuStatusDto);
LoginAuthDto loginAuthDto = getLoginAuthDto();
uacMenuService.updateUacMenuStatusById(uacMenuStatusDto, loginAuthDto);
return WrapMapper.ok();
}
use of com.paascloud.core.annotation.LogAnnotation in project paascloud-master by paascloud.
the class LogAspect method giveController.
/**
* 是否存在注解, 如果存在就记录日志
*/
private static LogAnnotation giveController(JoinPoint joinPoint) {
Method[] methods = joinPoint.getTarget().getClass().getDeclaredMethods();
String methodName = joinPoint.getSignature().getName();
if (null != methods && 0 < methods.length) {
for (Method met : methods) {
LogAnnotation relog = met.getAnnotation(LogAnnotation.class);
if (null != relog && methodName.equals(met.getName())) {
return relog;
}
}
}
return null;
}
Aggregations