| | |
| | | import com.ruoyi.system.service.ISysPostService; |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.Parameters; |
| | | import io.swagger.v3.oas.annotations.enums.ParameterIn; |
| | |
| | | /** |
| | | * 获取用户列表 |
| | | */ |
| | | @Operation(summary = "获取用户列表") |
| | | @SaCheckPermission("system:user:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<SysUser> list(SysUser user, PageQuery pageQuery) { |
| | | return userService.selectPageUserList(user, pageQuery); |
| | | } |
| | | |
| | | @Operation(summary = "导出用户列表") |
| | | @Log(title = "用户管理", businessType = BusinessType.EXPORT) |
| | | @SaCheckPermission("system:user:export") |
| | | @PostMapping("/export") |
| | |
| | | ExcelUtil.exportExcel(listVo, "用户数据", SysUserExportVo.class, response); |
| | | } |
| | | |
| | | @Operation(summary = "导入用户列表") |
| | | @Parameters({ |
| | | @Parameter(name = "file", description = "导入文件", required = true), |
| | | }) |
| | |
| | | return R.ok(result.getAnalysis()); |
| | | } |
| | | |
| | | @Operation(summary = "下载导入模板") |
| | | @PostMapping("/importTemplate") |
| | | public void importTemplate(HttpServletResponse response) { |
| | | ExcelUtil.exportExcel(new ArrayList<>(), "用户数据", SysUserImportVo.class, response); |
| | |
| | | /** |
| | | * 根据用户编号获取详细信息 |
| | | */ |
| | | @Operation(summary = "根据用户编号获取详细信息") |
| | | @SaCheckPermission("system:user:query") |
| | | @GetMapping(value = {"/", "/{userId}"}) |
| | | public R<Map<String, Object>> getInfo(@Parameter(name = "用户ID") @PathVariable(value = "userId", required = false) Long userId) { |
| | |
| | | /** |
| | | * 新增用户 |
| | | */ |
| | | @Operation(summary = "新增用户") |
| | | @SaCheckPermission("system:user:add") |
| | | @Log(title = "用户管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | |
| | | /** |
| | | * 修改用户 |
| | | */ |
| | | @Operation(summary = "修改用户") |
| | | @SaCheckPermission("system:user:edit") |
| | | @Log(title = "用户管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | |
| | | /** |
| | | * 删除用户 |
| | | */ |
| | | @Operation(summary = "删除用户") |
| | | @SaCheckPermission("system:user:remove") |
| | | @Log(title = "用户管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{userIds}") |
| | |
| | | /** |
| | | * 重置密码 |
| | | */ |
| | | @Operation(summary = "重置密码") |
| | | @SaCheckPermission("system:user:resetPwd") |
| | | @Log(title = "用户管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/resetPwd") |
| | |
| | | /** |
| | | * 状态修改 |
| | | */ |
| | | @Operation(summary = "状态修改") |
| | | @SaCheckPermission("system:user:edit") |
| | | @Log(title = "用户管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | |
| | | /** |
| | | * 根据用户编号获取授权角色 |
| | | */ |
| | | @Operation(summary = "根据用户编号获取授权角色") |
| | | @SaCheckPermission("system:user:query") |
| | | @GetMapping("/authRole/{userId}") |
| | | public R<Map<String, Object>> authRole(@Parameter(name = "用户ID") @PathVariable("userId") Long userId) { |
| | |
| | | /** |
| | | * 用户授权角色 |
| | | */ |
| | | @Operation(summary = "用户授权角色") |
| | | @Parameters({ |
| | | @Parameter(name = "userId", description = "用户Id", in = ParameterIn.QUERY), |
| | | @Parameter(name = "roleIds", description = "角色ID串", in = ParameterIn.QUERY) |