|
@@ -3,6 +3,9 @@ package com.ruoyi.web.controller.system;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
+
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
import org.apache.commons.lang3.ArrayUtils;
|
|
import org.apache.commons.lang3.ArrayUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
@@ -36,6 +39,7 @@ import com.ruoyi.system.service.ISysUserService;
|
|
*
|
|
*
|
|
* @author ruoyi
|
|
* @author ruoyi
|
|
*/
|
|
*/
|
|
|
|
+@Api(tags = "用户信息")
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("/system/user")
|
|
@RequestMapping("/system/user")
|
|
public class SysUserController extends BaseController
|
|
public class SysUserController extends BaseController
|
|
@@ -53,6 +57,7 @@ public class SysUserController extends BaseController
|
|
* 获取用户列表
|
|
* 获取用户列表
|
|
*/
|
|
*/
|
|
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
|
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
|
|
|
+ @ApiOperation("获取用户列表")
|
|
@GetMapping("/list")
|
|
@GetMapping("/list")
|
|
public TableDataInfo list(SysUser user)
|
|
public TableDataInfo list(SysUser user)
|
|
{
|
|
{
|
|
@@ -62,6 +67,7 @@ public class SysUserController extends BaseController
|
|
}
|
|
}
|
|
|
|
|
|
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
|
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
|
|
|
+ @ApiOperation("导出用户列表")
|
|
@PreAuthorize("@ss.hasPermi('system:user:export')")
|
|
@PreAuthorize("@ss.hasPermi('system:user:export')")
|
|
@PostMapping("/export")
|
|
@PostMapping("/export")
|
|
public void export(HttpServletResponse response, SysUser user)
|
|
public void export(HttpServletResponse response, SysUser user)
|
|
@@ -72,6 +78,7 @@ public class SysUserController extends BaseController
|
|
}
|
|
}
|
|
|
|
|
|
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
|
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
|
|
|
+ @ApiOperation("导入用户列表")
|
|
@PreAuthorize("@ss.hasPermi('system:user:import')")
|
|
@PreAuthorize("@ss.hasPermi('system:user:import')")
|
|
@PostMapping("/importData")
|
|
@PostMapping("/importData")
|
|
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
|
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
|
@@ -84,6 +91,7 @@ public class SysUserController extends BaseController
|
|
}
|
|
}
|
|
|
|
|
|
@PostMapping("/importTemplate")
|
|
@PostMapping("/importTemplate")
|
|
|
|
+ @ApiOperation("获取用户列表模板")
|
|
public void importTemplate(HttpServletResponse response)
|
|
public void importTemplate(HttpServletResponse response)
|
|
{
|
|
{
|
|
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
|
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
|
@@ -94,6 +102,7 @@ public class SysUserController extends BaseController
|
|
* 根据用户编号获取详细信息
|
|
* 根据用户编号获取详细信息
|
|
*/
|
|
*/
|
|
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
|
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
|
|
|
+ @ApiOperation("根据用户编号获取详细信息")
|
|
@GetMapping(value = { "/", "/{userId}" })
|
|
@GetMapping(value = { "/", "/{userId}" })
|
|
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
|
|
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
|
|
{
|
|
{
|
|
@@ -116,6 +125,7 @@ public class SysUserController extends BaseController
|
|
* 新增用户
|
|
* 新增用户
|
|
*/
|
|
*/
|
|
@PreAuthorize("@ss.hasPermi('system:user:add')")
|
|
@PreAuthorize("@ss.hasPermi('system:user:add')")
|
|
|
|
+ @ApiOperation("新增用户")
|
|
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
|
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
|
@PostMapping
|
|
@PostMapping
|
|
public AjaxResult add(@Validated @RequestBody SysUser user)
|
|
public AjaxResult add(@Validated @RequestBody SysUser user)
|
|
@@ -143,6 +153,7 @@ public class SysUserController extends BaseController
|
|
* 修改用户
|
|
* 修改用户
|
|
*/
|
|
*/
|
|
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
|
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
|
|
|
+ @ApiOperation("修改用户")
|
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
|
@PutMapping
|
|
@PutMapping
|
|
public AjaxResult edit(@Validated @RequestBody SysUser user)
|
|
public AjaxResult edit(@Validated @RequestBody SysUser user)
|
|
@@ -167,6 +178,7 @@ public class SysUserController extends BaseController
|
|
* 删除用户
|
|
* 删除用户
|
|
*/
|
|
*/
|
|
@PreAuthorize("@ss.hasPermi('system:user:remove')")
|
|
@PreAuthorize("@ss.hasPermi('system:user:remove')")
|
|
|
|
+ @ApiOperation("删除用户")
|
|
@Log(title = "用户管理", businessType = BusinessType.DELETE)
|
|
@Log(title = "用户管理", businessType = BusinessType.DELETE)
|
|
@DeleteMapping("/{userIds}")
|
|
@DeleteMapping("/{userIds}")
|
|
public AjaxResult remove(@PathVariable Long[] userIds)
|
|
public AjaxResult remove(@PathVariable Long[] userIds)
|
|
@@ -182,6 +194,7 @@ public class SysUserController extends BaseController
|
|
* 重置密码
|
|
* 重置密码
|
|
*/
|
|
*/
|
|
@PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
|
|
@PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
|
|
|
|
+ @ApiOperation("重置密码")
|
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
|
@PutMapping("/resetPwd")
|
|
@PutMapping("/resetPwd")
|
|
public AjaxResult resetPwd(@RequestBody SysUser user)
|
|
public AjaxResult resetPwd(@RequestBody SysUser user)
|