| | |
| | | import com.ruoyi.common.log.annotation.Log;
|
| | | import com.ruoyi.common.log.enums.BusinessType;
|
| | | import com.ruoyi.common.security.annotation.InnerAuth;
|
| | | import com.ruoyi.common.security.annotation.PreAuthorize;
|
| | | import com.ruoyi.common.security.annotation.RequiresPermissions;
|
| | | import com.ruoyi.system.api.domain.SysRole;
|
| | | import com.ruoyi.system.api.domain.SysUser;
|
| | | import com.ruoyi.system.api.model.LoginUser;
|
| | |
| | | /**
|
| | | * 获取用户列表
|
| | | */
|
| | | @PreAuthorize(hasPermi = "system:user:list")
|
| | | @RequiresPermissions("system:user:list")
|
| | | @GetMapping("/list")
|
| | | public TableDataInfo list(SysUser user)
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | @Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
| | | @PreAuthorize(hasPermi = "system:user:export")
|
| | | @RequiresPermissions("system:user:export")
|
| | | @PostMapping("/export")
|
| | | public void export(HttpServletResponse response, SysUser user) throws IOException
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | @Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
| | | @PreAuthorize(hasPermi = "system:user:import")
|
| | | @RequiresPermissions("system:user:import")
|
| | | @PostMapping("/importData")
|
| | | public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
| | | {
|
| | |
| | | /**
|
| | | * 根据用户编号获取详细信息
|
| | | */
|
| | | @PreAuthorize(hasPermi = "system:user:query")
|
| | | @RequiresPermissions("system:user:query")
|
| | | @GetMapping(value = { "/", "/{userId}" })
|
| | | public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
|
| | | {
|
| | |
| | | /**
|
| | | * 新增用户
|
| | | */
|
| | | @PreAuthorize(hasPermi = "system:user:add")
|
| | | @RequiresPermissions("system:user:add")
|
| | | @Log(title = "用户管理", businessType = BusinessType.INSERT)
|
| | | @PostMapping
|
| | | public AjaxResult add(@Validated @RequestBody SysUser user)
|
| | |
| | | /**
|
| | | * 修改用户
|
| | | */
|
| | | @PreAuthorize(hasPermi = "system:user:edit")
|
| | | @RequiresPermissions("system:user:edit")
|
| | | @Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult edit(@Validated @RequestBody SysUser user)
|
| | |
| | | /**
|
| | | * 删除用户
|
| | | */
|
| | | @PreAuthorize(hasPermi = "system:user:remove")
|
| | | @RequiresPermissions("system:user:remove")
|
| | | @Log(title = "用户管理", businessType = BusinessType.DELETE)
|
| | | @DeleteMapping("/{userIds}")
|
| | | public AjaxResult remove(@PathVariable Long[] userIds)
|
| | |
| | | /**
|
| | | * 重置密码
|
| | | */
|
| | | @PreAuthorize(hasPermi = "system:user:edit")
|
| | | @RequiresPermissions("system:user:edit")
|
| | | @Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
| | | @PutMapping("/resetPwd")
|
| | | public AjaxResult resetPwd(@RequestBody SysUser user)
|
| | |
| | | /**
|
| | | * 状态修改
|
| | | */
|
| | | @PreAuthorize(hasPermi = "system:user:edit")
|
| | | @RequiresPermissions("system:user:edit")
|
| | | @Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
| | | @PutMapping("/changeStatus")
|
| | | public AjaxResult changeStatus(@RequestBody SysUser user)
|
| | |
| | | /**
|
| | | * 根据用户编号获取授权角色
|
| | | */
|
| | | @PreAuthorize(hasPermi = "system:user:query")
|
| | | @RequiresPermissions("system:user:query")
|
| | | @GetMapping("/authRole/{userId}")
|
| | | public AjaxResult authRole(@PathVariable("userId") Long userId)
|
| | | {
|
| | |
| | | /**
|
| | | * 用户授权角色
|
| | | */
|
| | | @PreAuthorize(hasPermi = "system:user:edit")
|
| | | @RequiresPermissions("system:user:edit")
|
| | | @Log(title = "用户管理", businessType = BusinessType.GRANT)
|
| | | @PutMapping("/authRole")
|
| | | public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
|