use of com.company.project.common.aop.annotation.LogAnnotation in project springboot-manager by aitangbao.
the class SysJobController method update.
@ApiOperation(value = "更新")
@PutMapping("/update")
@RequiresPermissions("sysJob:update")
@LogAnnotation(title = "更新")
public DataResult update(@RequestBody SysJobEntity sysJob) {
if (isValidExpression(sysJob.getCronExpression())) {
return DataResult.fail("cron表达式有误");
}
DataResult dataResult = ScheduleJob.judgeBean(sysJob.getBeanName());
if (BaseResponseCode.SUCCESS.getCode() != dataResult.getCode()) {
return dataResult;
}
sysJobService.updateJobById(sysJob);
return DataResult.success();
}
use of com.company.project.common.aop.annotation.LogAnnotation in project springboot-manager by aitangbao.
the class SysJobController method add.
@ApiOperation(value = "新增")
@LogAnnotation(title = "新增")
@PostMapping("/add")
@RequiresPermissions("sysJob:add")
public DataResult add(@RequestBody SysJobEntity sysJob) {
if (isValidExpression(sysJob.getCronExpression())) {
return DataResult.fail("cron表达式有误");
}
DataResult dataResult = ScheduleJob.judgeBean(sysJob.getBeanName());
if (BaseResponseCode.SUCCESS.getCode() != dataResult.getCode()) {
return dataResult;
}
sysJobService.saveJob(sysJob);
return DataResult.success();
}
use of com.company.project.common.aop.annotation.LogAnnotation in project springboot-manager by aitangbao.
the class SysLogController method pageInfo.
@PostMapping("/logs")
@ApiOperation(value = "分页查询系统操作日志接口")
@LogAnnotation(title = "系统操作日志管理", action = "分页查询系统操作日志")
@RequiresPermissions("sys:log:list")
public DataResult pageInfo(@RequestBody SysLog vo) {
Page page = new Page(vo.getPage(), vo.getLimit());
LambdaQueryWrapper<SysLog> queryWrapper = Wrappers.lambdaQuery();
if (!StringUtils.isEmpty(vo.getUsername())) {
queryWrapper.like(SysLog::getUsername, vo.getUsername());
}
if (!StringUtils.isEmpty(vo.getOperation())) {
queryWrapper.like(SysLog::getOperation, vo.getOperation());
}
if (!StringUtils.isEmpty(vo.getStartTime())) {
queryWrapper.gt(SysLog::getCreateTime, vo.getStartTime());
}
if (!StringUtils.isEmpty(vo.getEndTime())) {
queryWrapper.lt(SysLog::getCreateTime, vo.getEndTime());
}
queryWrapper.orderByDesc(SysLog::getCreateTime);
return DataResult.success(logService.page(page, queryWrapper));
}
use of com.company.project.common.aop.annotation.LogAnnotation in project springboot-manager by aitangbao.
the class UserController method getUserOwnRole.
@GetMapping("/user/roles/{userId}")
@ApiOperation(value = "赋予角色-获取所有角色接口")
@LogAnnotation(title = "用户管理", action = "赋予角色-获取所有角色接口")
@RequiresPermissions("sys:user:role:detail")
public DataResult getUserOwnRole(@PathVariable("userId") String userId) {
DataResult result = DataResult.success();
result.setData(userService.getUserOwnRole(userId));
return result;
}
use of com.company.project.common.aop.annotation.LogAnnotation in project springboot-manager by aitangbao.
the class UserController method setUserOwnRole.
@PutMapping("/user/roles/{userId}")
@ApiOperation(value = "赋予角色-用户赋予角色接口")
@LogAnnotation(title = "用户管理", action = "赋予角色-用户赋予角色接口")
@RequiresPermissions("sys:user:update:role")
public DataResult setUserOwnRole(@PathVariable("userId") String userId, @RequestBody List<String> roleIds) {
LambdaQueryWrapper<SysUserRole> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.eq(SysUserRole::getUserId, userId);
userRoleService.remove(queryWrapper);
if (!CollectionUtils.isEmpty(roleIds)) {
UserRoleOperationReqVO reqVO = new UserRoleOperationReqVO();
reqVO.setUserId(userId);
reqVO.setRoleIds(roleIds);
userRoleService.addUserRoleInfo(reqVO);
}
// 刷新权限
httpSessionService.refreshUerId(userId);
return DataResult.success();
}
Aggregations