1. 增加字典数据的缓存与 util
2. 引入 Excel 组件
This commit is contained in:
@@ -48,7 +48,7 @@ public class SysDeptController {
|
||||
}
|
||||
|
||||
@ApiOperation("获得部门信息")
|
||||
@ApiImplicitParam(name = "id", value = "编号", readOnly = true, example = "1024")
|
||||
@ApiImplicitParam(name = "id", value = "编号", readOnly = true, example = "1024", dataTypeClass = Long.class)
|
||||
// @PreAuthorize("@ss.hasPermi('system:dept:query')")
|
||||
@GetMapping("/get")
|
||||
public CommonResult<SysDeptRespVO> getDept(@RequestParam("id") Long id) {
|
||||
@@ -74,7 +74,7 @@ public class SysDeptController {
|
||||
}
|
||||
|
||||
@ApiOperation("删除部门")
|
||||
@ApiImplicitParam(name = "id", value = "编号", readOnly = true, example = "1024")
|
||||
@ApiImplicitParam(name = "id", value = "编号", readOnly = true, example = "1024", dataTypeClass = Long.class)
|
||||
@PostMapping("delete")
|
||||
// @PreAuthorize("@ss.hasPermi('system:dept:remove')")
|
||||
// @Log(title = "部门管理", businessType = BusinessType.DELETE)
|
||||
|
||||
@@ -73,7 +73,7 @@ public class SysPostController {
|
||||
}
|
||||
|
||||
@ApiOperation("获得岗位信息")
|
||||
@ApiImplicitParam(name = "id", value = "岗位编号", readOnly = true, example = "1024")
|
||||
@ApiImplicitParam(name = "id", value = "岗位编号", readOnly = true, example = "1024", dataTypeClass = Long.class)
|
||||
// @PreAuthorize("@ss.hasPermi('system:post:query')")
|
||||
@GetMapping(value = "/get")
|
||||
public CommonResult<SysPostRespVO> getPost(@RequestParam("id") Long id) {
|
||||
|
||||
@@ -41,7 +41,7 @@ public class SysDictDataController {
|
||||
}
|
||||
|
||||
@ApiOperation("/查询字典数据详细")
|
||||
@ApiImplicitParam(name = "id", value = "编号", readOnly = true, example = "1024")
|
||||
@ApiImplicitParam(name = "id", value = "编号", readOnly = true, example = "1024", dataTypeClass = Long.class)
|
||||
@GetMapping(value = "/get")
|
||||
// @PreAuthorize("@ss.hasPermi('system:dict:query')")
|
||||
public CommonResult<SysDictDataRespVO> getDictData(@RequestParam("id") Long id) {
|
||||
@@ -67,7 +67,7 @@ public class SysDictDataController {
|
||||
}
|
||||
|
||||
@ApiOperation("删除字典数据")
|
||||
@ApiImplicitParam(name = "id", value = "编号", readOnly = true, example = "1024")
|
||||
@ApiImplicitParam(name = "id", value = "编号", readOnly = true, example = "1024", dataTypeClass = Long.class)
|
||||
@PostMapping("/delete")
|
||||
// @PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
||||
public CommonResult<Boolean> deleteDictData(Long id) {
|
||||
|
||||
@@ -33,7 +33,7 @@ public class SysDictTypeController {
|
||||
}
|
||||
|
||||
@ApiOperation("/查询字典类型详细")
|
||||
@ApiImplicitParam(name = "id", value = "编号", readOnly = true, example = "1024")
|
||||
@ApiImplicitParam(name = "id", value = "编号", readOnly = true, example = "1024", dataTypeClass = Long.class)
|
||||
@GetMapping(value = "/get")
|
||||
// @PreAuthorize("@ss.hasPermi('system:dict:query')")
|
||||
public CommonResult<SysDictTypeRespVO> getDictType(@RequestParam("id") Long id) {
|
||||
@@ -59,7 +59,7 @@ public class SysDictTypeController {
|
||||
}
|
||||
|
||||
@ApiOperation("删除字典类型")
|
||||
@ApiImplicitParam(name = "id", value = "编号", readOnly = true, example = "1024")
|
||||
@ApiImplicitParam(name = "id", value = "编号", readOnly = true, example = "1024", dataTypeClass = Long.class)
|
||||
@PostMapping("/delete")
|
||||
// @PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
||||
public CommonResult<Boolean> deleteDictType(Long id) {
|
||||
|
||||
@@ -88,7 +88,7 @@ public class SysMenuController {
|
||||
|
||||
@ApiOperation("删除菜单")
|
||||
@PostMapping("/delete")
|
||||
@ApiImplicitParam(name = "id", value = "角色编号", required= true, example = "1024")
|
||||
@ApiImplicitParam(name = "id", value = "角色编号", required= true, example = "1024", dataTypeClass = Long.class)
|
||||
// @Log(title = "菜单管理", businessType = BusinessType.DELETE)
|
||||
public CommonResult<Boolean> deleteMenu(@RequestParam("id") Long id) {
|
||||
menuService.deleteMenu(id);
|
||||
|
||||
@@ -30,8 +30,8 @@ public class SysPermissionController {
|
||||
private SysPermissionService permissionService;
|
||||
|
||||
@ApiOperation("获得角色拥有的菜单编号")
|
||||
@ApiImplicitParam(name = "roleId", value = "角色编号", required = true, dataTypeClass = Long.class)
|
||||
@GetMapping("/list-role-resources")
|
||||
@ApiImplicitParam(name = "roleId", value = "角色编号", required = true)
|
||||
// @RequiresPermissions("system:permission:assign-role-menu")
|
||||
public CommonResult<Set<Long>> listRoleMenus(Long roleId) {
|
||||
return success(permissionService.listRoleMenuIds(roleId));
|
||||
@@ -55,7 +55,7 @@ public class SysPermissionController {
|
||||
}
|
||||
|
||||
@ApiOperation("获得管理员拥有的角色编号列表")
|
||||
@ApiImplicitParam(name = "userId", value = "用户编号", required = true)
|
||||
@ApiImplicitParam(name = "userId", value = "用户编号", required = true, dataTypeClass = Long.class)
|
||||
@GetMapping("/list-user-roles")
|
||||
// @RequiresPermissions("system:permission:assign-user-role")
|
||||
public CommonResult<Set<Long>> listAdminRoles(@RequestParam("userId") Long userId) {
|
||||
|
||||
@@ -64,10 +64,10 @@ public class SysRoleController {
|
||||
|
||||
@ApiOperation("删除角色")
|
||||
@PostMapping("/delete")
|
||||
@ApiImplicitParam(name = "id", value = "角色编号", required = true, example = "1024")
|
||||
@ApiImplicitParam(name = "id", value = "角色编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
// @PreAuthorize("@ss.hasPermi('system:role:remove')")
|
||||
// @Log(title = "角色管理", businessType = BusinessType.DELETE)
|
||||
public CommonResult<Boolean> remove(@RequestParam("id") Long id) {
|
||||
public CommonResult<Boolean> deleteRole(@RequestParam("id") Long id) {
|
||||
roleService.deleteRole(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class SysUserController {
|
||||
* 根据用户编号获取详细信息
|
||||
*/
|
||||
@ApiOperation("获得用户详情")
|
||||
@ApiImplicitParam(name = "id", value = "编号", readOnly = true, example = "1024")
|
||||
@ApiImplicitParam(name = "id", value = "编号", readOnly = true, example = "1024", dataTypeClass = Long.class)
|
||||
@GetMapping("/get")
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:query')")
|
||||
public CommonResult<SysUserRespVO> getInfo(@RequestParam("id") Long id) {
|
||||
@@ -89,7 +89,7 @@ public class SysUserController {
|
||||
}
|
||||
|
||||
@ApiOperation("删除用户")
|
||||
@ApiImplicitParam(name = "id", value = "编号", readOnly = true, example = "1024")
|
||||
@ApiImplicitParam(name = "id", value = "编号", readOnly = true, example = "1024", dataTypeClass = Long.class)
|
||||
@PostMapping("/delete")
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:remove')")
|
||||
// @Log(title = "用户管理", businessType = BusinessType.DELETE)
|
||||
|
||||
@@ -11,20 +11,14 @@ import java.util.Date;
|
||||
* 用户 Excel 导出响应 VO
|
||||
*/
|
||||
@Data
|
||||
public class SysUserExcelRespVO {
|
||||
public class SysUserExcelRespBackVO {
|
||||
|
||||
@Excel(name = "用户序号", cellType = Excel.ColumnType.NUMERIC, prompt = "用户编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
@Excel(name = "登录名称")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
@Excel(name = "用户名称")
|
||||
private String nickname;
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package cn.iocoder.dashboard.modules.system.controller.user.vo.user;
|
||||
|
||||
import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.dashboard.framework.excel.core.convert.DictConvert;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import static cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum.SYS_COMMON_STATUS;
|
||||
import static cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum.SYS_USER_SEX;
|
||||
|
||||
/**
|
||||
* 用户 Excel 导出 VO
|
||||
*/
|
||||
@Data
|
||||
public class SysUserExcelVO {
|
||||
|
||||
@ExcelProperty("用户编号")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("用户名称")
|
||||
private String username;
|
||||
|
||||
@ExcelProperty("用户名称")
|
||||
private String nickname;
|
||||
|
||||
@ExcelProperty("用户邮箱")
|
||||
private String email;
|
||||
|
||||
@ExcelProperty("手机号码")
|
||||
private String mobile;
|
||||
|
||||
@ExcelProperty(value = "用户性别", converter = DictConvert.class)
|
||||
@DictFormat(SYS_USER_SEX)
|
||||
private Integer sex;
|
||||
|
||||
@ExcelProperty(value = "帐号状态", converter = DictConvert.class)
|
||||
@DictFormat(SYS_COMMON_STATUS)
|
||||
private Integer status;
|
||||
|
||||
@ExcelProperty("最后登录IP")
|
||||
private String loginIp;
|
||||
|
||||
@ExcelProperty("最后登录时间")
|
||||
private Date loginDate;
|
||||
|
||||
@ExcelProperty("部门名称")
|
||||
private String deptName;
|
||||
|
||||
@ExcelProperty("部门负责人")
|
||||
private String deptLeader;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user