use of com.albedo.java.common.log.annotation.LogOperate in project albedo by somowhere.
the class TableResource method getPage.
/**
* @param pm
* @return
*/
@GetMapping
@PreAuthorize("@pms.hasPermission('gen_table_view')")
@LogOperate(value = "业务表查看")
public Result getPage(PageModel pm, TableQueryCriteria tableQueryCriteria) {
QueryWrapper wrapper = QueryWrapperUtil.getWrapper(pm, tableQueryCriteria);
pm = tableService.page(pm, wrapper);
return Result.buildOkData(pm);
}
use of com.albedo.java.common.log.annotation.LogOperate in project albedo by somowhere.
the class AccoutResource method updateEmail.
@LogOperate("修改邮箱")
@Operation(summary = "修改邮箱")
@PostMapping(value = "/account/change-email/{code}")
public Result<String> updateEmail(@PathVariable String code, @RequestBody UserEmailDto userEmailDto) {
// 密码解密
RSA rsa = new RSA(applicationProperties.getRsa().getPrivateKey(), applicationProperties.getRsa().getPublicKey());
String password = new String(rsa.decrypt(userEmailDto.getPassword(), KeyType.PrivateKey));
userEmailDto.setPassword(password);
emailService.validated(CommonConstants.EMAIL_RESET_EMAIL_CODE + userEmailDto.getEmail(), code);
userService.updateEmail(SecurityUtil.getUser().getUsername(), userEmailDto);
return Result.buildOk("修改邮箱成功");
}
use of com.albedo.java.common.log.annotation.LogOperate in project albedo by somowhere.
the class LogLoginResource method download.
@LogOperate(value = "登录日志导出")
@Operation(summary = "登录日志导出")
@GetMapping(value = "/download")
@PreAuthorize("@pms.hasPermission('sys_logOperate_export')")
public void download(LogLoginQueryCriteria logOperateQueryCriteria, HttpServletResponse response) {
QueryWrapper wrapper = QueryWrapperUtil.getWrapper(logOperateQueryCriteria);
ExcelUtil<LogLoginDo> util = new ExcelUtil(LogLoginDo.class);
util.exportExcel(service.list(wrapper), "登录日志", response);
}
use of com.albedo.java.common.log.annotation.LogOperate in project albedo by somowhere.
the class RoleResource method saveRoleMenus.
/**
* 更新角色菜单
*
* @param roleMenuDto 角色菜单
* @return success、false
*/
@PutMapping("/menu")
@LogOperate(value = "角色管理编辑")
@PreAuthorize("@pms.hasPermission('sys_role_edit')")
public Result saveRoleMenus(@Valid @RequestBody RoleMenuDto roleMenuDto) {
RoleDo roleDo = roleService.getById(roleMenuDto.getRoleId());
checkLevel(roleDo.getLevel());
return roleMenuService.saveRoleMenus(roleMenuDto);
}
use of com.albedo.java.common.log.annotation.LogOperate in project albedo by somowhere.
the class UserOnlineResource method remove.
@PreAuthorize("@pms.hasPermission('sys_userOnline_del')")
@LogOperate(value = "在线用户删除")
@DeleteMapping
public Result remove(@RequestBody Set<String> ids, HttpServletRequest request) {
for (String id : ids) {
UserOnlineDo online = userOnlineService.getById(id);
if (online == null) {
return Result.buildFail("用户已下线");
}
try {
SessionInformation sessionInformation = sessionRegistry.getSessionInformation(online.getSessionId());
if (sessionInformation != null) {
if (sessionInformation.getSessionId().equals(request.getSession(false).getId())) {
return Result.buildFail("当前登陆用户无法删除");
}
sessionInformation.expireNow();
redisTemplate.boundHashOps(RedisSessionRegistry.SESSIONIDS).put(online.getSessionId(), sessionInformation);
}
} catch (Exception e) {
}
sessionRegistry.removeSessionInformation(online.getSessionId());
userOnlineService.removeById(online);
}
return Result.buildOk("操作成功");
}
Aggregations