|
|
|
@ -30,12 +30,17 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
import com.ruoyi.system.service.ISysPostService;
|
|
|
|
import com.ruoyi.system.service.ISysPostService;
|
|
|
|
import com.ruoyi.system.service.ISysRoleService;
|
|
|
|
import com.ruoyi.system.service.ISysRoleService;
|
|
|
|
import com.ruoyi.system.service.ISysUserService;
|
|
|
|
import com.ruoyi.system.service.ISysUserService;
|
|
|
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
|
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 用户信息
|
|
|
|
* 用户信息
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @author ruoyi
|
|
|
|
* @author ruoyi
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Api(tags = "用户管理")
|
|
|
|
@RestController
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("/system/user")
|
|
|
|
@RequestMapping("/system/user")
|
|
|
|
public class SysUserController extends BaseController
|
|
|
|
public class SysUserController extends BaseController
|
|
|
|
@ -52,6 +57,7 @@ public class SysUserController extends BaseController
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 获取用户列表
|
|
|
|
* 获取用户列表
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
@ApiOperation("查询用户列表")
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
|
|
|
@GetMapping("/list")
|
|
|
|
@GetMapping("/list")
|
|
|
|
public TableDataInfo list(SysUser user)
|
|
|
|
public TableDataInfo list(SysUser user)
|
|
|
|
@ -61,6 +67,7 @@ public class SysUserController extends BaseController
|
|
|
|
return getDataTable(list);
|
|
|
|
return getDataTable(list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("导出用户数据")
|
|
|
|
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
|
|
|
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:user:export')")
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:user:export')")
|
|
|
|
@PostMapping("/export")
|
|
|
|
@PostMapping("/export")
|
|
|
|
@ -71,6 +78,7 @@ public class SysUserController extends BaseController
|
|
|
|
util.exportExcel(response, list, "用户数据");
|
|
|
|
util.exportExcel(response, list, "用户数据");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("导入用户数据")
|
|
|
|
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
|
|
|
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:user:import')")
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:user:import')")
|
|
|
|
@PostMapping("/importData")
|
|
|
|
@PostMapping("/importData")
|
|
|
|
@ -83,6 +91,7 @@ public class SysUserController extends BaseController
|
|
|
|
return AjaxResult.success(message);
|
|
|
|
return AjaxResult.success(message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("下载用户导入模板")
|
|
|
|
@PostMapping("/importTemplate")
|
|
|
|
@PostMapping("/importTemplate")
|
|
|
|
public void importTemplate(HttpServletResponse response)
|
|
|
|
public void importTemplate(HttpServletResponse response)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -93,6 +102,8 @@ public class SysUserController extends BaseController
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 根据用户编号获取详细信息
|
|
|
|
* 根据用户编号获取详细信息
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
@ApiOperation("获取用户详细信息")
|
|
|
|
|
|
|
|
@ApiImplicitParam(name = "userId", value = "用户ID", dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
|
|
|
@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)
|
|
|
|
@ -114,6 +125,7 @@ public class SysUserController extends BaseController
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 新增用户
|
|
|
|
* 新增用户
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
@ApiOperation("新增用户")
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:user:add')")
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:user:add')")
|
|
|
|
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
|
|
|
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
|
|
|
@PostMapping
|
|
|
|
@PostMapping
|
|
|
|
@ -141,6 +153,7 @@ public class SysUserController extends BaseController
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 修改用户
|
|
|
|
* 修改用户
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
@ApiOperation("修改用户")
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
|
|
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
|
|
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
|
|
|
@PutMapping
|
|
|
|
@PutMapping
|
|
|
|
@ -164,6 +177,7 @@ public class SysUserController extends BaseController
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 删除用户
|
|
|
|
* 删除用户
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
@ApiOperation("删除用户")
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:user:remove')")
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:user:remove')")
|
|
|
|
@Log(title = "用户管理", businessType = BusinessType.DELETE)
|
|
|
|
@Log(title = "用户管理", businessType = BusinessType.DELETE)
|
|
|
|
@DeleteMapping("/{userIds}")
|
|
|
|
@DeleteMapping("/{userIds}")
|
|
|
|
@ -179,6 +193,7 @@ public class SysUserController extends BaseController
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 重置密码
|
|
|
|
* 重置密码
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
@ApiOperation("重置用户密码")
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
|
|
|
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
|
|
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
|
|
|
@PutMapping("/resetPwd")
|
|
|
|
@PutMapping("/resetPwd")
|
|
|
|
@ -193,6 +208,7 @@ public class SysUserController extends BaseController
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 状态修改
|
|
|
|
* 状态修改
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
@ApiOperation("修改用户状态")
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
|
|
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
|
|
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
|
|
|
@PutMapping("/changeStatus")
|
|
|
|
@PutMapping("/changeStatus")
|
|
|
|
@ -206,6 +222,8 @@ public class SysUserController extends BaseController
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 根据用户编号获取授权角色
|
|
|
|
* 根据用户编号获取授权角色
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
@ApiOperation("获取用户授权角色")
|
|
|
|
|
|
|
|
@ApiImplicitParam(name = "userId", value = "用户ID", dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
|
|
|
@GetMapping("/authRole/{userId}")
|
|
|
|
@GetMapping("/authRole/{userId}")
|
|
|
|
public AjaxResult authRole(@PathVariable("userId") Long userId)
|
|
|
|
public AjaxResult authRole(@PathVariable("userId") Long userId)
|
|
|
|
@ -221,6 +239,11 @@ public class SysUserController extends BaseController
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 用户授权角色
|
|
|
|
* 用户授权角色
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
@ApiOperation("用户授权角色")
|
|
|
|
|
|
|
|
@ApiImplicitParams({
|
|
|
|
|
|
|
|
@ApiImplicitParam(name = "userId", value = "用户ID", dataType = "Long", paramType = "query", dataTypeClass = Long.class),
|
|
|
|
|
|
|
|
@ApiImplicitParam(name = "roleIds", value = "角色ID列表", dataType = "Long[]", paramType = "query")
|
|
|
|
|
|
|
|
})
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
|
|
|
@Log(title = "用户管理", businessType = BusinessType.GRANT)
|
|
|
|
@Log(title = "用户管理", businessType = BusinessType.GRANT)
|
|
|
|
@PutMapping("/authRole")
|
|
|
|
@PutMapping("/authRole")
|
|
|
|
|