mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 02:08:43 +08:00 
			
		
		
		
	多模块重构 4:system 模块的创建,去除 Sys
This commit is contained in:
		| @@ -1,7 +1,7 @@ | ||||
| ### 请求 /login 接口 => 成功 | ||||
| POST {{baseUrl}}/login | ||||
| POST {{baseUrl}}/system/login | ||||
| Content-Type: application/json | ||||
| tenant-id: 1 | ||||
| tenant-id: {{adminTenentId}} | ||||
| 
 | ||||
| { | ||||
|   "username": "admin", | ||||
| @@ -11,16 +11,12 @@ tenant-id: 1 | ||||
| } | ||||
| 
 | ||||
| ### 请求 /get-permission-info 接口 => 成功 | ||||
| GET {{baseUrl}}/get-permission-info | ||||
| GET {{baseUrl}}/system/get-permission-info | ||||
| Authorization: Bearer {{token}} | ||||
| tenant-id: 1 | ||||
| tenant-id: {{adminTenentId}} | ||||
| 
 | ||||
| ### 请求 /list-menus 接口 => 成功 | ||||
| GET {{baseUrl}}/list-menus | ||||
| GET {{baseUrl}}/system/list-menus | ||||
| Authorization: Bearer {{token}} | ||||
| #Authorization: Bearer a6aa7714a2e44c95aaa8a2c5adc2a67a | ||||
| tenant-id: 1 | ||||
| 
 | ||||
| ### 请求 /druid/xxx 接口 => 失败 TODO 临时测试 | ||||
| GET http://127.0.0.1:8080/druid/123 | ||||
| Authorization: Bearer {{token}} | ||||
| tenant-id: {{adminTenentId}} | ||||
| @@ -1,13 +1,13 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.auth; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.auth; | ||||
| 
 | ||||
| import cn.iocoder.yudao.module.system.controller.auth.vo.auth.*; | ||||
| import cn.iocoder.yudao.module.system.convert.auth.SysAuthConvert; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.permission.SysMenuDO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.auth.vo.auth.*; | ||||
| import cn.iocoder.yudao.module.system.convert.auth.AuthConvert; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.permission.SysRoleDO; | ||||
| import cn.iocoder.yudao.module.system.enums.permission.MenuTypeEnum; | ||||
| import cn.iocoder.yudao.module.system.service.auth.SysAuthService; | ||||
| import cn.iocoder.yudao.module.system.service.permission.SysPermissionService; | ||||
| import cn.iocoder.yudao.module.system.service.permission.SysRoleService; | ||||
| import cn.iocoder.yudao.module.system.service.auth.AuthService; | ||||
| import cn.iocoder.yudao.module.system.service.permission.PermissionService; | ||||
| import cn.iocoder.yudao.module.system.service.permission.RoleService; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.user.SysUserDO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.service.social.SysSocialCoreService; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.service.user.SysUserCoreService; | ||||
| @@ -21,6 +21,7 @@ import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
| 
 | ||||
| @@ -34,36 +35,37 @@ import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getUse | ||||
| import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; | ||||
| import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserRoleIds; | ||||
| 
 | ||||
| @Api(tags = "认证") | ||||
| @Api(tags = "管理后台 - 认证") | ||||
| @RestController | ||||
| @RequestMapping("/") | ||||
| @RequestMapping("/system") // 暂时不跟 /auth 结尾 | ||||
| @Validated | ||||
| @Slf4j | ||||
| public class SysAuthController { | ||||
| public class AuthController { | ||||
| 
 | ||||
|     @Resource | ||||
|     private SysAuthService authService; | ||||
|     @Autowired | ||||
|     @SuppressWarnings("SpringJavaAutowiredFieldsWarningInspection") // AuthService 存在重名 | ||||
|     private AuthService authService; | ||||
|     @Resource | ||||
|     private SysUserCoreService userCoreService; | ||||
|     @Resource | ||||
|     private SysRoleService roleService; | ||||
|     private RoleService roleService; | ||||
|     @Resource | ||||
|     private SysPermissionService permissionService; | ||||
|     private PermissionService permissionService; | ||||
|     @Resource | ||||
|     private SysSocialCoreService socialCoreService; | ||||
| 
 | ||||
|     @PostMapping("/login") | ||||
|     @ApiOperation("使用账号密码登录") | ||||
|     @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 | ||||
|     public CommonResult<SysAuthLoginRespVO> login(@RequestBody @Valid SysAuthLoginReqVO reqVO) { | ||||
|     public CommonResult<AuthLoginRespVO> login(@RequestBody @Valid AuthLoginReqVO reqVO) { | ||||
|         String token = authService.login(reqVO, getClientIP(), getUserAgent()); | ||||
|         // 返回结果 | ||||
|         return success(SysAuthLoginRespVO.builder().token(token).build()); | ||||
|         return success(AuthLoginRespVO.builder().token(token).build()); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/get-permission-info") | ||||
|     @ApiOperation("获取登录用户的权限信息") | ||||
|     public CommonResult<SysAuthPermissionInfoRespVO> getPermissionInfo() { | ||||
|     public CommonResult<AuthPermissionInfoRespVO> getPermissionInfo() { | ||||
|         // 获得用户信息 | ||||
|         SysUserDO user = userCoreService.getUser(getLoginUserId()); | ||||
|         if (user == null) { | ||||
| @@ -72,24 +74,24 @@ public class SysAuthController { | ||||
|         // 获得角色列表 | ||||
|         List<SysRoleDO> roleList = roleService.getRolesFromCache(getLoginUserRoleIds()); | ||||
|         // 获得菜单列表 | ||||
|         List<SysMenuDO> menuList = permissionService.getRoleMenusFromCache( | ||||
|         List<MenuDO> menuList = permissionService.getRoleMenusFromCache( | ||||
|                 getLoginUserRoleIds(), // 注意,基于登录的角色,因为后续的权限判断也是基于它 | ||||
|                 SetUtils.asSet(MenuTypeEnum.DIR.getType(), MenuTypeEnum.MENU.getType(), MenuTypeEnum.BUTTON.getType()), | ||||
|                 SetUtils.asSet(CommonStatusEnum.ENABLE.getStatus())); | ||||
|         // 拼接结果返回 | ||||
|         return success(SysAuthConvert.INSTANCE.convert(user, roleList, menuList)); | ||||
|         return success(AuthConvert.INSTANCE.convert(user, roleList, menuList)); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("list-menus") | ||||
|     @ApiOperation("获得登录用户的菜单列表") | ||||
|     public CommonResult<List<SysAuthMenuRespVO>> getMenus() { | ||||
|     public CommonResult<List<AuthMenuRespVO>> getMenus() { | ||||
|         // 获得用户拥有的菜单列表 | ||||
|         List<SysMenuDO> menuList = permissionService.getRoleMenusFromCache( | ||||
|         List<MenuDO> menuList = permissionService.getRoleMenusFromCache( | ||||
|                 getLoginUserRoleIds(), // 注意,基于登录的角色,因为后续的权限判断也是基于它 | ||||
|                 SetUtils.asSet(MenuTypeEnum.DIR.getType(), MenuTypeEnum.MENU.getType()), // 只要目录和菜单类型 | ||||
|                 SetUtils.asSet(CommonStatusEnum.ENABLE.getStatus())); // 只要开启的 | ||||
|         // 转换成 Tree 结构返回 | ||||
|         return success(SysAuthConvert.INSTANCE.buildMenuTree(menuList)); | ||||
|         return success(AuthConvert.INSTANCE.buildMenuTree(menuList)); | ||||
|     } | ||||
| 
 | ||||
|     // ========== 社交登录相关 ========== | ||||
| @@ -108,31 +110,31 @@ public class SysAuthController { | ||||
|     @PostMapping("/social-login") | ||||
|     @ApiOperation("社交登录,使用 code 授权码") | ||||
|     @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 | ||||
|     public CommonResult<SysAuthLoginRespVO> socialLogin(@RequestBody @Valid SysAuthSocialLoginReqVO reqVO) { | ||||
|     public CommonResult<AuthLoginRespVO> socialLogin(@RequestBody @Valid AuthSocialLoginReqVO reqVO) { | ||||
|         String token = authService.socialLogin(reqVO, getClientIP(), getUserAgent()); | ||||
|         // 返回结果 | ||||
|         return success(SysAuthLoginRespVO.builder().token(token).build()); | ||||
|         return success(AuthLoginRespVO.builder().token(token).build()); | ||||
|     } | ||||
| 
 | ||||
|     @PostMapping("/social-login2") | ||||
|     @ApiOperation("社交登录,使用 code 授权码 + 账号密码") | ||||
|     @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 | ||||
|     public CommonResult<SysAuthLoginRespVO> socialLogin2(@RequestBody @Valid SysAuthSocialLogin2ReqVO reqVO) { | ||||
|     public CommonResult<AuthLoginRespVO> socialLogin2(@RequestBody @Valid AuthSocialLogin2ReqVO reqVO) { | ||||
|         String token = authService.socialLogin2(reqVO, getClientIP(), getUserAgent()); | ||||
|         // 返回结果 | ||||
|         return success(SysAuthLoginRespVO.builder().token(token).build()); | ||||
|         return success(AuthLoginRespVO.builder().token(token).build()); | ||||
|     } | ||||
| 
 | ||||
|     @PostMapping("/social-bind") | ||||
|     @ApiOperation("社交绑定,使用 code 授权码") | ||||
|     public CommonResult<Boolean> socialBind(@RequestBody @Valid SysAuthSocialBindReqVO reqVO) { | ||||
|     public CommonResult<Boolean> socialBind(@RequestBody @Valid AuthSocialBindReqVO reqVO) { | ||||
|         authService.socialBind(getLoginUserId(), reqVO); | ||||
|         return CommonResult.success(true); | ||||
|     } | ||||
| 
 | ||||
|     @DeleteMapping("/social-unbind") | ||||
|     @ApiOperation("取消社交绑定") | ||||
|     public CommonResult<Boolean> socialUnbind(@RequestBody SysAuthSocialUnbindReqVO reqVO) { | ||||
|     public CommonResult<Boolean> socialUnbind(@RequestBody AuthSocialUnbindReqVO reqVO) { | ||||
|         socialCoreService.unbindSocialUser(getLoginUserId(), reqVO.getType(), reqVO.getUnionId(), UserTypeEnum.ADMIN); | ||||
|         return CommonResult.success(true); | ||||
|     } | ||||
| @@ -1,10 +1,10 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.auth; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.auth; | ||||
| 
 | ||||
| import cn.iocoder.yudao.module.system.controller.auth.vo.session.SysUserSessionPageItemRespVO; | ||||
| import cn.iocoder.yudao.module.system.controller.auth.vo.session.SysUserSessionPageReqVO; | ||||
| import cn.iocoder.yudao.module.system.convert.auth.SysUserSessionConvert; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.auth.vo.session.UserSessionPageItemRespVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.auth.vo.session.UserSessionPageReqVO; | ||||
| import cn.iocoder.yudao.module.system.convert.auth.UserSessionConvert; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.dept.SysDeptDO; | ||||
| import cn.iocoder.yudao.module.system.service.auth.SysUserSessionService; | ||||
| import cn.iocoder.yudao.module.system.service.auth.UserSessionService; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.auth.SysUserSessionDO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.user.SysUserDO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.service.auth.SysUserSessionCoreService; | ||||
| @@ -28,13 +28,13 @@ import java.util.Map; | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList; | ||||
| 
 | ||||
| @Api(tags = "用户 Session") | ||||
| @Api(tags = "管理后台 - 用户 Session") | ||||
| @RestController | ||||
| @RequestMapping("/system/user-session") | ||||
| public class SysUserSessionController { | ||||
| public class UserSessionController { | ||||
| 
 | ||||
|     @Resource | ||||
|     private SysUserSessionService userSessionService; | ||||
|     private UserSessionService userSessionService; | ||||
|     @Resource | ||||
|     private SysUserSessionCoreService userSessionCoreService; | ||||
|     @Resource | ||||
| @@ -46,7 +46,7 @@ public class SysUserSessionController { | ||||
|     @GetMapping("/page") | ||||
|     @ApiOperation("获得 Session 分页列表") | ||||
|     @PreAuthorize("@ss.hasPermission('system:user-session:page')") | ||||
|     public CommonResult<PageResult<SysUserSessionPageItemRespVO>> getUserSessionPage(@Validated SysUserSessionPageReqVO reqVO) { | ||||
|     public CommonResult<PageResult<UserSessionPageItemRespVO>> getUserSessionPage(@Validated UserSessionPageReqVO reqVO) { | ||||
|         // 获得 Session 分页 | ||||
|         PageResult<SysUserSessionDO> pageResult = userSessionService.getUserSessionPage(reqVO); | ||||
| 
 | ||||
| @@ -56,9 +56,9 @@ public class SysUserSessionController { | ||||
|         Map<Long, SysDeptDO> deptMap = deptCoreService.getDeptMap( | ||||
|                 convertList(userMap.values(), SysUserDO::getDeptId)); | ||||
|         // 拼接结果返回 | ||||
|         List<SysUserSessionPageItemRespVO> sessionList = new ArrayList<>(pageResult.getList().size()); | ||||
|         List<UserSessionPageItemRespVO> sessionList = new ArrayList<>(pageResult.getList().size()); | ||||
|         pageResult.getList().forEach(session -> { | ||||
|             SysUserSessionPageItemRespVO respVO = SysUserSessionConvert.INSTANCE.convert(session); | ||||
|             UserSessionPageItemRespVO respVO = UserSessionConvert.INSTANCE.convert(session); | ||||
|             sessionList.add(respVO); | ||||
|             // 设置用户账号 | ||||
|             MapUtils.findAndThen(userMap, session.getUserId(), user -> { | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.auth.vo.auth; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.auth.vo.auth; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -11,12 +11,12 @@ import org.hibernate.validator.constraints.Length; | ||||
| import javax.validation.constraints.NotEmpty; | ||||
| import javax.validation.constraints.Pattern; | ||||
| 
 | ||||
| @ApiModel("账号密码登录 Request VO") | ||||
| @ApiModel("管理后台 - 账号密码登录 Request VO") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| @Builder | ||||
| public class SysAuthLoginReqVO { | ||||
| public class AuthLoginReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "账号", required = true, example = "yudaoyuanma") | ||||
|     @NotEmpty(message = "登录账号不能为空") | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.auth.vo.auth; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.auth.vo.auth; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -7,12 +7,12 @@ import lombok.Builder; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
| 
 | ||||
| @ApiModel("账号密码登录 Response VO") | ||||
| @ApiModel("管理后台 - 账号密码登录 Response VO") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| @Builder | ||||
| public class SysAuthLoginRespVO { | ||||
| public class AuthLoginRespVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "token", required = true, example = "yudaoyuanma") | ||||
|     private String token; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.auth.vo.auth; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.auth.vo.auth; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -9,12 +9,12 @@ import lombok.NoArgsConstructor; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| @ApiModel("登录用户的菜单信息 Response VO") | ||||
| @ApiModel("管理后台 - 登录用户的菜单信息 Response VO") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| @Builder | ||||
| public class SysAuthMenuRespVO { | ||||
| public class AuthMenuRespVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "菜单名称", required = true, example = "芋道") | ||||
|     private Long id; | ||||
| @@ -37,6 +37,6 @@ public class SysAuthMenuRespVO { | ||||
|     /** | ||||
|      * 子路由 | ||||
|      */ | ||||
|     private List<SysAuthMenuRespVO> children; | ||||
|     private List<AuthMenuRespVO> children; | ||||
| 
 | ||||
| } | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.auth.vo.auth; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.auth.vo.auth; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -9,12 +9,12 @@ import lombok.NoArgsConstructor; | ||||
| 
 | ||||
| import java.util.Set; | ||||
| 
 | ||||
| @ApiModel(value = "登录用户的权限信息 Response VO", description = "额外包括用户信息和角色列表") | ||||
| @ApiModel(value = "管理后台 - 登录用户的权限信息 Response VO", description = "额外包括用户信息和角色列表") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| @Builder | ||||
| public class SysAuthPermissionInfoRespVO { | ||||
| public class AuthPermissionInfoRespVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "用户信息", required = true) | ||||
|     private UserVO user; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.auth.vo.auth; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.auth.vo.auth; | ||||
| 
 | ||||
| import cn.iocoder.yudao.coreservice.modules.system.enums.social.SysSocialTypeEnum; | ||||
| import cn.iocoder.yudao.framework.common.validation.InEnum; | ||||
| @@ -12,12 +12,12 @@ import lombok.NoArgsConstructor; | ||||
| import javax.validation.constraints.NotEmpty; | ||||
| import javax.validation.constraints.NotNull; | ||||
| 
 | ||||
| @ApiModel("社交绑定 Request VO,使用 code 授权码") | ||||
| @ApiModel("管理后台 - 社交绑定 Request VO,使用 code 授权码") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| @Builder | ||||
| public class SysAuthSocialBindReqVO { | ||||
| public class AuthSocialBindReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") | ||||
|     @InEnum(SysSocialTypeEnum.class) | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.auth.vo.auth; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.auth.vo.auth; | ||||
| 
 | ||||
| import cn.iocoder.yudao.coreservice.modules.system.enums.social.SysSocialTypeEnum; | ||||
| import cn.iocoder.yudao.framework.common.validation.InEnum; | ||||
| @@ -14,12 +14,12 @@ import javax.validation.constraints.NotEmpty; | ||||
| import javax.validation.constraints.NotNull; | ||||
| import javax.validation.constraints.Pattern; | ||||
| 
 | ||||
| @ApiModel("社交登录 Request VO,使用 code 授权码 + 账号密码") | ||||
| @ApiModel("管理后台 - 社交登录 Request VO,使用 code 授权码 + 账号密码") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| @Builder | ||||
| public class SysAuthSocialLogin2ReqVO { | ||||
| public class AuthSocialLogin2ReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") | ||||
|     @InEnum(SysSocialTypeEnum.class) | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.auth.vo.auth; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.auth.vo.auth; | ||||
| 
 | ||||
| import cn.iocoder.yudao.coreservice.modules.system.enums.social.SysSocialTypeEnum; | ||||
| import cn.iocoder.yudao.framework.common.validation.InEnum; | ||||
| @@ -12,12 +12,12 @@ import lombok.NoArgsConstructor; | ||||
| import javax.validation.constraints.NotEmpty; | ||||
| import javax.validation.constraints.NotNull; | ||||
| 
 | ||||
| @ApiModel("社交登录 Request VO,使用 code 授权码") | ||||
| @ApiModel("管理后台 - 社交登录 Request VO,使用 code 授权码") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| @Builder | ||||
| public class SysAuthSocialLoginReqVO { | ||||
| public class AuthSocialLoginReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") | ||||
|     @InEnum(SysSocialTypeEnum.class) | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.auth.vo.auth; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.auth.vo.auth; | ||||
| 
 | ||||
| import cn.iocoder.yudao.coreservice.modules.system.enums.social.SysSocialTypeEnum; | ||||
| import cn.iocoder.yudao.framework.common.validation.InEnum; | ||||
| @@ -12,12 +12,12 @@ import lombok.NoArgsConstructor; | ||||
| import javax.validation.constraints.NotEmpty; | ||||
| import javax.validation.constraints.NotNull; | ||||
| 
 | ||||
| @ApiModel("取消社交绑定 Request VO,使用 code 授权码") | ||||
| @ApiModel("管理后台 - 取消社交绑定 Request VO,使用 code 授权码") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| @Builder | ||||
| public class SysAuthSocialUnbindReqVO { | ||||
| public class AuthSocialUnbindReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") | ||||
|     @InEnum(SysSocialTypeEnum.class) | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.auth.vo.session; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.auth.vo.session; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| @@ -10,12 +10,12 @@ import lombok.NoArgsConstructor; | ||||
| 
 | ||||
| import java.util.Date; | ||||
| 
 | ||||
| @ApiModel(value = "用户在线 Session Response VO", description = "相比用户基本信息来说,会多部门、用户账号等信息") | ||||
| @ApiModel(value = "管理后台 - 用户在线 Session Response VO", description = "相比用户基本信息来说,会多部门、用户账号等信息") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysUserSessionPageItemRespVO extends PageParam { | ||||
| public class UserSessionPageItemRespVO extends PageParam { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "Session 编号", required = true, example = "fe50b9f6-d177-44b1-8da9-72ea34f63db7") | ||||
|     private String id; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.auth.vo.session; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.auth.vo.session; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| @@ -6,10 +6,10 @@ import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| 
 | ||||
| @ApiModel("在线用户 Session 分页 Request VO") | ||||
| @ApiModel("管理后台 - 在线用户 Session 分页 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysUserSessionPageReqVO extends PageParam { | ||||
| public class UserSessionPageReqVO extends PageParam { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "用户 IP", example = "127.0.0.1", notes = "模糊匹配") | ||||
|     private String userIp; | ||||
| @@ -1,8 +1,8 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.common; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.common; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.module.system.controller.common.vo.SysCaptchaImageRespVO; | ||||
| import cn.iocoder.yudao.module.system.service.common.SysCaptchaService; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.common.vo.CaptchaImageRespVO; | ||||
| import cn.iocoder.yudao.module.system.service.common.CaptchaService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | ||||
| @@ -13,17 +13,17 @@ import javax.annotation.Resource; | ||||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| 
 | ||||
| @Api(tags = "验证码") | ||||
| @Api(tags = "管理后台 - 验证码") | ||||
| @RestController | ||||
| @RequestMapping("/system/captcha") | ||||
| public class SysCaptchaController { | ||||
| public class CaptchaController { | ||||
| 
 | ||||
|     @Resource | ||||
|     private SysCaptchaService captchaService; | ||||
|     private CaptchaService captchaService; | ||||
| 
 | ||||
|     @GetMapping("/get-image") | ||||
|     @ApiOperation("生成图片验证码") | ||||
|     public CommonResult<SysCaptchaImageRespVO> getCaptchaImage() { | ||||
|     public CommonResult<CaptchaImageRespVO> getCaptchaImage() { | ||||
|         return success(captchaService.getCaptchaImage()); | ||||
|     } | ||||
| 
 | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.common.vo; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.common.vo; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -7,14 +7,15 @@ import lombok.Builder; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
| 
 | ||||
| @ApiModel("验证码图片 Response VO") | ||||
| @ApiModel("管理后台 - 验证码图片 Response VO") | ||||
| @Data | ||||
| @Builder | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class SysCaptchaImageRespVO { | ||||
| public class CaptchaImageRespVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "uuid", required = true, example = "1b3b7d00-83a8-4638-9e37-d67011855968", notes = "通过该 uuid 作为该验证码的标识") | ||||
|     @ApiModelProperty(value = "uuid", required = true, example = "1b3b7d00-83a8-4638-9e37-d67011855968", | ||||
|             notes = "通过该 uuid 作为该验证码的标识") | ||||
|     private String uuid; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "图片", required = true, notes = "验证码的图片内容,使用 Base64 编码") | ||||
| @@ -1,12 +1,12 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dept; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dept; | ||||
| 
 | ||||
| import cn.iocoder.yudao.coreservice.modules.system.service.dept.SysDeptCoreService; | ||||
| import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.module.system.controller.dept.vo.dept.*; | ||||
| import cn.iocoder.yudao.module.system.convert.dept.SysDeptConvert; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.*; | ||||
| import cn.iocoder.yudao.module.system.convert.dept.DeptConvert; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.dept.SysDeptDO; | ||||
| import cn.iocoder.yudao.module.system.service.dept.SysDeptService; | ||||
| import cn.iocoder.yudao.module.system.service.dept.DeptService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| @@ -21,14 +21,14 @@ import java.util.List; | ||||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| 
 | ||||
| @Api(tags = "部门") | ||||
| @Api(tags = "管理后台 - 部门") | ||||
| @RestController | ||||
| @RequestMapping("/system/dept") | ||||
| @Validated | ||||
| public class SysDeptController { | ||||
| public class DeptController { | ||||
| 
 | ||||
|     @Resource | ||||
|     private SysDeptService deptService; | ||||
|     private DeptService deptService; | ||||
| 
 | ||||
|     @Resource | ||||
|     private SysDeptCoreService deptCoreService; | ||||
| @@ -36,7 +36,7 @@ public class SysDeptController { | ||||
|     @PostMapping("create") | ||||
|     @ApiOperation("创建部门") | ||||
|     @PreAuthorize("@ss.hasPermission('system:dept:create')") | ||||
|     public CommonResult<Long> createDept(@Valid @RequestBody SysDeptCreateReqVO reqVO) { | ||||
|     public CommonResult<Long> createDept(@Valid @RequestBody DeptCreateReqVO reqVO) { | ||||
|         Long deptId = deptService.createDept(reqVO); | ||||
|         return success(deptId); | ||||
|     } | ||||
| @@ -44,7 +44,7 @@ public class SysDeptController { | ||||
|     @PutMapping("update") | ||||
|     @ApiOperation("更新部门") | ||||
|     @PreAuthorize("@ss.hasPermission('system:dept:update')") | ||||
|     public CommonResult<Boolean> updateDept(@Valid @RequestBody SysDeptUpdateReqVO reqVO) { | ||||
|     public CommonResult<Boolean> updateDept(@Valid @RequestBody DeptUpdateReqVO reqVO) { | ||||
|         deptService.updateDept(reqVO); | ||||
|         return success(true); | ||||
|     } | ||||
| @@ -61,30 +61,30 @@ public class SysDeptController { | ||||
|     @GetMapping("/list") | ||||
|     @ApiOperation("获取部门列表") | ||||
|     @PreAuthorize("@ss.hasPermission('system:dept:query')") | ||||
|     public CommonResult<List<SysDeptRespVO>> listDepts(SysDeptListReqVO reqVO) { | ||||
|     public CommonResult<List<DeptRespVO>> listDepts(DeptListReqVO reqVO) { | ||||
|         List<SysDeptDO> list = deptService.getSimpleDepts(reqVO); | ||||
|         list.sort(Comparator.comparing(SysDeptDO::getSort)); | ||||
|         return success(SysDeptConvert.INSTANCE.convertList(list)); | ||||
|         return success(DeptConvert.INSTANCE.convertList(list)); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/list-all-simple") | ||||
|     @ApiOperation(value = "获取部门精简信息列表", notes = "只包含被开启的部门,主要用于前端的下拉选项") | ||||
|     public CommonResult<List<SysDeptSimpleRespVO>> getSimpleDepts() { | ||||
|     public CommonResult<List<DeptSimpleRespVO>> getSimpleDepts() { | ||||
|         // 获得部门列表,只要开启状态的 | ||||
|         SysDeptListReqVO reqVO = new SysDeptListReqVO(); | ||||
|         DeptListReqVO reqVO = new DeptListReqVO(); | ||||
|         reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); | ||||
|         List<SysDeptDO> list = deptService.getSimpleDepts(reqVO); | ||||
|         // 排序后,返回给前端 | ||||
|         list.sort(Comparator.comparing(SysDeptDO::getSort)); | ||||
|         return success(SysDeptConvert.INSTANCE.convertList02(list)); | ||||
|         return success(DeptConvert.INSTANCE.convertList02(list)); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/get") | ||||
|     @ApiOperation("获得部门信息") | ||||
|     @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | ||||
|     @PreAuthorize("@ss.hasPermission('system:dept:query')") | ||||
|     public CommonResult<SysDeptRespVO> getDept(@RequestParam("id") Long id) { | ||||
|         return success(SysDeptConvert.INSTANCE.convert(deptCoreService.getDept(id))); | ||||
|     public CommonResult<DeptRespVO> getDept(@RequestParam("id") Long id) { | ||||
|         return success(DeptConvert.INSTANCE.convert(deptCoreService.getDept(id))); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| @@ -1,14 +1,14 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dept; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dept; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | ||||
| import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | ||||
| import cn.iocoder.yudao.module.system.controller.dept.vo.post.*; | ||||
| import cn.iocoder.yudao.module.system.convert.dept.SysPostConvert; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.*; | ||||
| import cn.iocoder.yudao.module.system.convert.dept.PostConvert; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.dept.SysPostDO; | ||||
| import cn.iocoder.yudao.module.system.service.dept.SysPostService; | ||||
| import cn.iocoder.yudao.module.system.service.dept.PostService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| @@ -27,19 +27,19 @@ import java.util.List; | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; | ||||
| 
 | ||||
| @Api(tags = "岗位") | ||||
| @Api(tags = "管理后台 - 岗位") | ||||
| @RestController | ||||
| @RequestMapping("/system/post") | ||||
| @Valid | ||||
| public class SysPostController { | ||||
| @Validated | ||||
| public class PostController { | ||||
| 
 | ||||
|     @Resource | ||||
|     private SysPostService postService; | ||||
|     private PostService postService; | ||||
| 
 | ||||
|     @PostMapping("/create") | ||||
|     @ApiOperation("创建岗位") | ||||
|     @PreAuthorize("@ss.hasPermission('system:post:create')") | ||||
|     public CommonResult<Long> createPost(@Valid @RequestBody SysPostCreateReqVO reqVO) { | ||||
|     public CommonResult<Long> createPost(@Valid @RequestBody PostCreateReqVO reqVO) { | ||||
|         Long postId = postService.createPost(reqVO); | ||||
|         return success(postId); | ||||
|     } | ||||
| @@ -47,7 +47,7 @@ public class SysPostController { | ||||
|     @PutMapping("/update") | ||||
|     @ApiOperation("修改岗位") | ||||
|     @PreAuthorize("@ss.hasPermission('system:post:update')") | ||||
|     public CommonResult<Boolean> updatePost(@Valid @RequestBody SysPostUpdateReqVO reqVO) { | ||||
|     public CommonResult<Boolean> updatePost(@Valid @RequestBody PostUpdateReqVO reqVO) { | ||||
|         postService.updatePost(reqVO); | ||||
|         return success(true); | ||||
|     } | ||||
| @@ -64,36 +64,36 @@ public class SysPostController { | ||||
|     @ApiOperation("获得岗位信息") | ||||
|     @ApiImplicitParam(name = "id", value = "岗位编号", required = true, example = "1024", dataTypeClass = Long.class) | ||||
|     @PreAuthorize("@ss.hasPermission('system:post:query')") | ||||
|     public CommonResult<SysPostRespVO> getPost(@RequestParam("id") Long id) { | ||||
|         return success(SysPostConvert.INSTANCE.convert(postService.getPost(id))); | ||||
|     public CommonResult<PostRespVO> getPost(@RequestParam("id") Long id) { | ||||
|         return success(PostConvert.INSTANCE.convert(postService.getPost(id))); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/list-all-simple") | ||||
|     @ApiOperation(value = "获取岗位精简信息列表", notes = "只包含被开启的岗位,主要用于前端的下拉选项") | ||||
|     public CommonResult<List<SysPostSimpleRespVO>> getSimplePosts() { | ||||
|     public CommonResult<List<PostSimpleRespVO>> getSimplePosts() { | ||||
|         // 获得岗位列表,只要开启状态的 | ||||
|         List<SysPostDO> list = postService.getPosts(null, Collections.singleton(CommonStatusEnum.ENABLE.getStatus())); | ||||
|         // 排序后,返回给前端 | ||||
|         list.sort(Comparator.comparing(SysPostDO::getSort)); | ||||
|         return success(SysPostConvert.INSTANCE.convertList02(list)); | ||||
|         return success(PostConvert.INSTANCE.convertList02(list)); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/page") | ||||
|     @ApiOperation("获得岗位分页列表") | ||||
|     @PreAuthorize("@ss.hasPermission('system:post:query')") | ||||
|     public CommonResult<PageResult<SysPostRespVO>> getPostPage(@Validated SysPostPageReqVO reqVO) { | ||||
|         return success(SysPostConvert.INSTANCE.convertPage(postService.getPostPage(reqVO))); | ||||
|     public CommonResult<PageResult<PostRespVO>> getPostPage(@Validated PostPageReqVO reqVO) { | ||||
|         return success(PostConvert.INSTANCE.convertPage(postService.getPostPage(reqVO))); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/export") | ||||
|     @ApiOperation("岗位管理") | ||||
|     @PreAuthorize("@ss.hasPermission('system:post:export')") | ||||
|     @OperateLog(type = EXPORT) | ||||
|     public void export(HttpServletResponse response, @Validated SysPostExportReqVO reqVO) throws IOException { | ||||
|     public void export(HttpServletResponse response, @Validated PostExportReqVO reqVO) throws IOException { | ||||
|         List<SysPostDO> posts = postService.getPosts(reqVO); | ||||
|         List<SysPostExcelVO> data = SysPostConvert.INSTANCE.convertList03(posts); | ||||
|         List<PostExcelVO> data = PostConvert.INSTANCE.convertList03(posts); | ||||
|         // 输出 | ||||
|         ExcelUtils.write(response, "岗位数据.xls", "岗位列表", SysPostExcelVO.class, data); | ||||
|         ExcelUtils.write(response, "岗位数据.xls", "岗位列表", PostExcelVO.class, data); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dept.vo.dept; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.Data; | ||||
| @@ -13,7 +13,7 @@ import javax.validation.constraints.Size; | ||||
|  * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | ||||
|  */ | ||||
| @Data | ||||
| public class SysDeptBaseVO { | ||||
| public class DeptBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "菜单名称", required = true, example = "芋道") | ||||
|     @NotBlank(message = "部门名称不能为空") | ||||
| @@ -1,13 +1,13 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dept.vo.dept; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
| 
 | ||||
| @ApiModel("部门创建 Request VO") | ||||
| @ApiModel("管理后台 - 部门创建 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class SysDeptCreateReqVO extends SysDeptBaseVO { | ||||
| public class DeptCreateReqVO extends DeptBaseVO { | ||||
| } | ||||
| @@ -1,12 +1,12 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dept.vo.dept; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| @ApiModel("部门列表 Request VO") | ||||
| @ApiModel("管理后台 - 部门列表 Request VO") | ||||
| @Data | ||||
| public class SysDeptListReqVO { | ||||
| public class DeptListReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "部门名称", example = "芋道", notes = "模糊匹配") | ||||
|     private String name; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dept.vo.dept; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -7,10 +7,10 @@ import lombok.EqualsAndHashCode; | ||||
| 
 | ||||
| import java.util.Date; | ||||
| 
 | ||||
| @ApiModel("部门信息 Response VO") | ||||
| @ApiModel("管理后台 - 部门信息 Response VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysDeptRespVO extends SysDeptBaseVO { | ||||
| public class DeptRespVO extends DeptBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "部门编号", required = true, example = "1024") | ||||
|     private Long id; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dept.vo.dept; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -6,11 +6,11 @@ import lombok.AllArgsConstructor; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
| 
 | ||||
| @ApiModel("部门精简信息 Response VO") | ||||
| @ApiModel("管理后台 - 部门精简信息 Response VO") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class SysDeptSimpleRespVO { | ||||
| public class DeptSimpleRespVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "部门编号", required = true, example = "1024") | ||||
|     private Long id; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dept.vo.dept; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -7,10 +7,10 @@ import lombok.EqualsAndHashCode; | ||||
| 
 | ||||
| import javax.validation.constraints.NotNull; | ||||
| 
 | ||||
| @ApiModel("部门更新 Request VO") | ||||
| @ApiModel("管理后台 - 部门更新 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysDeptUpdateReqVO extends SysDeptBaseVO { | ||||
| public class DeptUpdateReqVO extends DeptBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "部门编号", required = true, example = "1024") | ||||
|     @NotNull(message = "部门编号不能为空") | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dept.vo.post; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.Data; | ||||
| @@ -12,7 +12,7 @@ import javax.validation.constraints.Size; | ||||
|  * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | ||||
|  */ | ||||
| @Data | ||||
| public class SysPostBaseVO { | ||||
| public class PostBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "岗位名称", required = true, example = "小博主") | ||||
|     @NotBlank(message = "岗位名称不能为空") | ||||
| @@ -0,0 +1,11 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post; | ||||
|  | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
|  | ||||
| @ApiModel("管理后台 - 岗位创建 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class PostCreateReqVO extends PostBaseVO { | ||||
| } | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dept.vo.post; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | ||||
| import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | ||||
| @@ -10,7 +10,7 @@ import lombok.Data; | ||||
|  * 岗位 Excel 导出响应 VO | ||||
|  */ | ||||
| @Data | ||||
| public class SysPostExcelVO { | ||||
| public class PostExcelVO { | ||||
| 
 | ||||
|     @ExcelProperty("岗位序号") | ||||
|     private Long id; | ||||
| @@ -1,12 +1,12 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dept.vo.post; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| @ApiModel(value = "岗位导出 Request VO", description = "参数和 SysPostExcelVO 是一致的") | ||||
| @ApiModel(value = "管理后台 - 岗位导出 Request VO", description = "参数和 SysPostExcelVO 是一致的") | ||||
| @Data | ||||
| public class SysPostExportReqVO { | ||||
| public class PostExportReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "岗位编码", example = "yudao", notes = "模糊匹配") | ||||
|     private String code; | ||||
| @@ -1,14 +1,14 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dept.vo.post; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| 
 | ||||
| @ApiModel("岗位列表 Request VO") | ||||
| @ApiModel("管理后台 - 岗位列表 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysPostListReqVO extends SysPostBaseVO { | ||||
| public class PostListReqVO extends PostBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "岗位名称", example = "芋道", notes = "模糊匹配") | ||||
|     private String name; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dept.vo.post; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| @@ -6,10 +6,10 @@ import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| 
 | ||||
| @ApiModel("岗位分页 Request VO") | ||||
| @ApiModel("管理后台 - 岗位分页 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysPostPageReqVO extends PageParam { | ||||
| public class PostPageReqVO extends PageParam { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "岗位编码", example = "yudao", notes = "模糊匹配") | ||||
|     private String code; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dept.vo.post; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -7,10 +7,10 @@ import lombok.EqualsAndHashCode; | ||||
| 
 | ||||
| import java.util.Date; | ||||
| 
 | ||||
| @ApiModel("岗位信息 Response VO") | ||||
| @ApiModel("管理后台 - 岗位信息 Response VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysPostRespVO extends SysPostBaseVO { | ||||
| public class PostRespVO extends PostBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "岗位序号", required = true, example = "1024") | ||||
|     private Long id; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dept.vo.post; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -6,11 +6,11 @@ import lombok.AllArgsConstructor; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
| 
 | ||||
| @ApiModel("岗位精简信息 Response VO") | ||||
| @ApiModel("管理后台 - 岗位精简信息 Response VO") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class SysPostSimpleRespVO { | ||||
| public class PostSimpleRespVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "岗位编号", required = true, example = "1024") | ||||
|     private Long id; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dept.vo.post; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -7,10 +7,10 @@ import lombok.EqualsAndHashCode; | ||||
| 
 | ||||
| import javax.validation.constraints.NotNull; | ||||
| 
 | ||||
| @ApiModel("岗位更新 Request VO") | ||||
| @ApiModel("管理后台 - 岗位更新 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysPostUpdateReqVO extends SysPostBaseVO { | ||||
| public class PostUpdateReqVO extends PostBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "岗位编号", required = true, example = "1024") | ||||
|     @NotNull(message = "岗位编号不能为空") | ||||
| @@ -1,3 +1,4 @@ | ||||
| ### 请求 /menu/list 接口 => 成功 | ||||
| GET {{baseUrl}}/system/dict-data/list-all-simple | ||||
| Authorization: Bearer {{token}} | ||||
| tenant-id: {{adminTenentId}} | ||||
| @@ -1,13 +1,13 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dict; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dict; | ||||
| 
 | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.dict.SysDictDataDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | ||||
| import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | ||||
| import cn.iocoder.yudao.module.system.controller.dict.vo.data.*; | ||||
| import cn.iocoder.yudao.module.system.convert.dict.SysDictDataConvert; | ||||
| import cn.iocoder.yudao.module.system.service.dict.SysDictDataService; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.*; | ||||
| import cn.iocoder.yudao.module.system.convert.dict.DictDataConvert; | ||||
| import cn.iocoder.yudao.module.system.service.dict.DictDataService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| @@ -24,19 +24,19 @@ import java.util.List; | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; | ||||
| 
 | ||||
| @Api(tags = "字典数据") | ||||
| @Api(tags = "管理后台 - 字典数据") | ||||
| @RestController | ||||
| @RequestMapping("/system/dict-data") | ||||
| @Validated | ||||
| public class SysDictDataController { | ||||
| public class DictDataController { | ||||
| 
 | ||||
|     @Resource | ||||
|     private SysDictDataService dictDataService; | ||||
|     private DictDataService dictDataService; | ||||
| 
 | ||||
|     @PostMapping("/create") | ||||
|     @ApiOperation("新增字典数据") | ||||
|     @PreAuthorize("@ss.hasPermission('system:dict:create')") | ||||
|     public CommonResult<Long> createDictData(@Valid @RequestBody SysDictDataCreateReqVO reqVO) { | ||||
|     public CommonResult<Long> createDictData(@Valid @RequestBody DictDataCreateReqVO reqVO) { | ||||
|         Long dictDataId = dictDataService.createDictData(reqVO); | ||||
|         return success(dictDataId); | ||||
|     } | ||||
| @@ -44,7 +44,7 @@ public class SysDictDataController { | ||||
|     @PutMapping("update") | ||||
|     @ApiOperation("修改字典数据") | ||||
|     @PreAuthorize("@ss.hasPermission('system:dict:update')") | ||||
|     public CommonResult<Boolean> updateDictData(@Valid @RequestBody SysDictDataUpdateReqVO reqVO) { | ||||
|     public CommonResult<Boolean> updateDictData(@Valid @RequestBody DictDataUpdateReqVO reqVO) { | ||||
|         dictDataService.updateDictData(reqVO); | ||||
|         return success(true); | ||||
|     } | ||||
| @@ -61,35 +61,35 @@ public class SysDictDataController { | ||||
|     @GetMapping("/list-all-simple") | ||||
|     @ApiOperation(value = "获得全部字典数据列表", notes = "一般用于管理后台缓存字典数据在本地") | ||||
|     // 无需添加权限认证,因为前端全局都需要 | ||||
|     public CommonResult<List<SysDictDataSimpleRespVO>> getSimpleDictDatas() { | ||||
|     public CommonResult<List<DictDataSimpleRespVO>> getSimpleDictDatas() { | ||||
|         List<SysDictDataDO> list = dictDataService.getDictDatas(); | ||||
|         return success(SysDictDataConvert.INSTANCE.convertList(list)); | ||||
|         return success(DictDataConvert.INSTANCE.convertList(list)); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/page") | ||||
|     @ApiOperation("/获得字典类型的分页列表") | ||||
|     @PreAuthorize("@ss.hasPermission('system:dict:query')") | ||||
|     public CommonResult<PageResult<SysDictDataRespVO>> getDictTypePage(@Valid SysDictDataPageReqVO reqVO) { | ||||
|         return success(SysDictDataConvert.INSTANCE.convertPage(dictDataService.getDictDataPage(reqVO))); | ||||
|     public CommonResult<PageResult<DictDataRespVO>> getDictTypePage(@Valid DictDataPageReqVO reqVO) { | ||||
|         return success(DictDataConvert.INSTANCE.convertPage(dictDataService.getDictDataPage(reqVO))); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping(value = "/get") | ||||
|     @ApiOperation("/查询字典数据详细") | ||||
|     @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | ||||
|     @PreAuthorize("@ss.hasPermission('system:dict:query')") | ||||
|     public CommonResult<SysDictDataRespVO> getDictData(@RequestParam("id") Long id) { | ||||
|         return success(SysDictDataConvert.INSTANCE.convert(dictDataService.getDictData(id))); | ||||
|     public CommonResult<DictDataRespVO> getDictData(@RequestParam("id") Long id) { | ||||
|         return success(DictDataConvert.INSTANCE.convert(dictDataService.getDictData(id))); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/export") | ||||
|     @ApiOperation("导出字典数据") | ||||
|     @PreAuthorize("@ss.hasPermission('system:dict:export')") | ||||
|     @OperateLog(type = EXPORT) | ||||
|     public void export(HttpServletResponse response, @Valid SysDictDataExportReqVO reqVO) throws IOException { | ||||
|     public void export(HttpServletResponse response, @Valid DictDataExportReqVO reqVO) throws IOException { | ||||
|         List<SysDictDataDO> list = dictDataService.getDictDatas(reqVO); | ||||
|         List<SysDictDataExcelVO> data = SysDictDataConvert.INSTANCE.convertList02(list); | ||||
|         List<DictDataExcelVO> data = DictDataConvert.INSTANCE.convertList02(list); | ||||
|         // 输出 | ||||
|         ExcelUtils.write(response, "字典数据.xls", "数据列表", SysDictDataExcelVO.class, data); | ||||
|         ExcelUtils.write(response, "字典数据.xls", "数据列表", DictDataExcelVO.class, data); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| @@ -1,13 +1,13 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dict; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dict; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | ||||
| import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | ||||
| import cn.iocoder.yudao.module.system.controller.dict.vo.type.*; | ||||
| import cn.iocoder.yudao.module.system.convert.dict.SysDictTypeConvert; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.dict.SysDictTypeDO; | ||||
| import cn.iocoder.yudao.module.system.service.dict.SysDictTypeService; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.dict.vo.type.*; | ||||
| import cn.iocoder.yudao.module.system.convert.dict.DictTypeConvert; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictTypeDO; | ||||
| import cn.iocoder.yudao.module.system.service.dict.DictTypeService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| @@ -24,19 +24,19 @@ import java.util.List; | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; | ||||
| 
 | ||||
| @Api(tags = "字典类型") | ||||
| @Api(tags = "管理后台 - 字典类型") | ||||
| @RestController | ||||
| @RequestMapping("/system/dict-type") | ||||
| @Validated | ||||
| public class SysDictTypeController { | ||||
| public class DictTypeController { | ||||
| 
 | ||||
|     @Resource | ||||
|     private SysDictTypeService dictTypeService; | ||||
|     private DictTypeService dictTypeService; | ||||
| 
 | ||||
|     @PostMapping("/create") | ||||
|     @ApiOperation("创建字典类型") | ||||
|     @PreAuthorize("@ss.hasPermission('system:dict:create')") | ||||
|     public CommonResult<Long> createDictType(@Valid @RequestBody SysDictTypeCreateReqVO reqVO) { | ||||
|     public CommonResult<Long> createDictType(@Valid @RequestBody DictTypeCreateReqVO reqVO) { | ||||
|         Long dictTypeId = dictTypeService.createDictType(reqVO); | ||||
|         return success(dictTypeId); | ||||
|     } | ||||
| @@ -44,7 +44,7 @@ public class SysDictTypeController { | ||||
|     @PutMapping("/update") | ||||
|     @ApiOperation("修改字典类型") | ||||
|     @PreAuthorize("@ss.hasPermission('system:dict:update')") | ||||
|     public CommonResult<Boolean> updateDictType(@Valid @RequestBody SysDictTypeUpdateReqVO reqVO) { | ||||
|     public CommonResult<Boolean> updateDictType(@Valid @RequestBody DictTypeUpdateReqVO reqVO) { | ||||
|         dictTypeService.updateDictType(reqVO); | ||||
|         return success(true); | ||||
|     } | ||||
| @@ -61,35 +61,35 @@ public class SysDictTypeController { | ||||
|     @ApiOperation("/获得字典类型的分页列表") | ||||
|     @GetMapping("/page") | ||||
|     @PreAuthorize("@ss.hasPermission('system:dict:query')") | ||||
|     public CommonResult<PageResult<SysDictTypeRespVO>> pageDictTypes(@Valid SysDictTypePageReqVO reqVO) { | ||||
|         return success(SysDictTypeConvert.INSTANCE.convertPage(dictTypeService.getDictTypePage(reqVO))); | ||||
|     public CommonResult<PageResult<DictTypeRespVO>> pageDictTypes(@Valid DictTypePageReqVO reqVO) { | ||||
|         return success(DictTypeConvert.INSTANCE.convertPage(dictTypeService.getDictTypePage(reqVO))); | ||||
|     } | ||||
| 
 | ||||
|     @ApiOperation("/查询字典类型详细") | ||||
|     @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | ||||
|     @GetMapping(value = "/get") | ||||
|     @PreAuthorize("@ss.hasPermission('system:dict:query')") | ||||
|     public CommonResult<SysDictTypeRespVO> getDictType(@RequestParam("id") Long id) { | ||||
|         return success(SysDictTypeConvert.INSTANCE.convert(dictTypeService.getDictType(id))); | ||||
|     public CommonResult<DictTypeRespVO> getDictType(@RequestParam("id") Long id) { | ||||
|         return success(DictTypeConvert.INSTANCE.convert(dictTypeService.getDictType(id))); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/list-all-simple") | ||||
|     @ApiOperation(value = "获得全部字典类型列表", notes = "包括开启 + 禁用的字典类型,主要用于前端的下拉选项") | ||||
|     // 无需添加权限认证,因为前端全局都需要 | ||||
|     public CommonResult<List<SysDictTypeSimpleRespVO>> listSimpleDictTypes() { | ||||
|         List<SysDictTypeDO> list = dictTypeService.getDictTypeList(); | ||||
|         return success(SysDictTypeConvert.INSTANCE.convertList(list)); | ||||
|     public CommonResult<List<DictTypeSimpleRespVO>> listSimpleDictTypes() { | ||||
|         List<DictTypeDO> list = dictTypeService.getDictTypeList(); | ||||
|         return success(DictTypeConvert.INSTANCE.convertList(list)); | ||||
|     } | ||||
| 
 | ||||
|     @ApiOperation("导出数据类型") | ||||
|     @GetMapping("/export") | ||||
|     @PreAuthorize("@ss.hasPermission('system:dict:query')") | ||||
|     @OperateLog(type = EXPORT) | ||||
|     public void export(HttpServletResponse response, @Valid SysDictTypeExportReqVO reqVO) throws IOException { | ||||
|         List<SysDictTypeDO> list = dictTypeService.getDictTypeList(reqVO); | ||||
|         List<SysDictTypeExcelVO> data = SysDictTypeConvert.INSTANCE.convertList02(list); | ||||
|     public void export(HttpServletResponse response, @Valid DictTypeExportReqVO reqVO) throws IOException { | ||||
|         List<DictTypeDO> list = dictTypeService.getDictTypeList(reqVO); | ||||
|         List<DictTypeExcelVO> data = DictTypeConvert.INSTANCE.convertList02(list); | ||||
|         // 输出 | ||||
|         ExcelUtils.write(response, "字典类型.xls", "类型列表", SysDictTypeExcelVO.class, data); | ||||
|         ExcelUtils.write(response, "字典类型.xls", "类型列表", DictTypeExcelVO.class, data); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dict.vo.data; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.Data; | ||||
| @@ -12,7 +12,7 @@ import javax.validation.constraints.Size; | ||||
|  * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | ||||
|  */ | ||||
| @Data | ||||
| public class SysDictDataBaseVO { | ||||
| public class DictDataBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "显示顺序不能为空", required = true, example = "1024") | ||||
|     @NotNull(message = "显示顺序不能为空") | ||||
| @@ -0,0 +1,12 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data; | ||||
|  | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
|  | ||||
| @ApiModel("管理后台 - 字典数据创建 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class DictDataCreateReqVO extends DictDataBaseVO { | ||||
|  | ||||
| } | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dict.vo.data; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | ||||
| import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | ||||
| @@ -10,7 +10,7 @@ import lombok.Data; | ||||
|  * 字典数据 Excel 导出响应 VO | ||||
|  */ | ||||
| @Data | ||||
| public class SysDictDataExcelVO { | ||||
| public class DictDataExcelVO { | ||||
| 
 | ||||
|     @ExcelProperty("字典编码") | ||||
|     private Long id; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dict.vo.data; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -6,9 +6,9 @@ import lombok.Data; | ||||
| 
 | ||||
| import javax.validation.constraints.Size; | ||||
| 
 | ||||
| @ApiModel("字典类型导出 Request VO") | ||||
| @ApiModel("管理后台 - 字典类型导出 Request VO") | ||||
| @Data | ||||
| public class SysDictDataExportReqVO { | ||||
| public class DictDataExportReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "字典标签", example = "芋道") | ||||
|     @Size(max = 100, message = "字典标签长度不能超过100个字符") | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dict.vo.data; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| @@ -8,10 +8,10 @@ import lombok.EqualsAndHashCode; | ||||
| 
 | ||||
| import javax.validation.constraints.Size; | ||||
| 
 | ||||
| @ApiModel("字典类型分页列表 Request VO") | ||||
| @ApiModel("管理后台 - 字典类型分页列表 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysDictDataPageReqVO extends PageParam { | ||||
| public class DictDataPageReqVO extends PageParam { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "字典标签", example = "芋道") | ||||
|     @Size(max = 100, message = "字典标签长度不能超过100个字符") | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dict.vo.data; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -9,12 +9,12 @@ import lombok.NoArgsConstructor; | ||||
| 
 | ||||
| import java.util.Date; | ||||
| 
 | ||||
| @ApiModel("字典数据信息 Response VO") | ||||
| @ApiModel("管理后台 - 字典数据信息 Response VO") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysDictDataRespVO extends SysDictDataBaseVO { | ||||
| public class DictDataRespVO extends DictDataBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "字典数据编号", required = true, example = "1024") | ||||
|     private Long id; | ||||
| @@ -1,12 +1,12 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dict.vo.data; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| @ApiModel("数据字典精简 Response VO") | ||||
| @ApiModel("管理后台 - 数据字典精简 Response VO") | ||||
| @Data | ||||
| public class SysDictDataSimpleRespVO { | ||||
| public class DictDataSimpleRespVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "字典类型", required = true, example = "gender") | ||||
|     private String dictType; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dict.vo.data; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -7,10 +7,10 @@ import lombok.EqualsAndHashCode; | ||||
| 
 | ||||
| import javax.validation.constraints.NotNull; | ||||
| 
 | ||||
| @ApiModel("字典数据更新 Request VO") | ||||
| @ApiModel("管理后台 - 字典数据更新 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysDictDataUpdateReqVO extends SysDictDataBaseVO { | ||||
| public class DictDataUpdateReqVO extends DictDataBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "字典数据编号", required = true, example = "1024") | ||||
|     @NotNull(message = "字典数据编号不能为空") | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dict.vo.type; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dict.vo.type; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.Data; | ||||
| @@ -12,7 +12,7 @@ import javax.validation.constraints.Size; | ||||
|  * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | ||||
|  */ | ||||
| @Data | ||||
| public class SysDictTypeBaseVO { | ||||
| public class DictTypeBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "字典名称", required = true, example = "性别") | ||||
|     @NotBlank(message = "字典名称不能为空") | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dict.vo.type; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dict.vo.type; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -8,10 +8,10 @@ import lombok.EqualsAndHashCode; | ||||
| import javax.validation.constraints.NotNull; | ||||
| import javax.validation.constraints.Size; | ||||
| 
 | ||||
| @ApiModel("字典类型创建 Request VO") | ||||
| @ApiModel("管理后台 - 字典类型创建 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysDictTypeCreateReqVO extends SysDictTypeBaseVO { | ||||
| public class DictTypeCreateReqVO extends DictTypeBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "字典类型", required = true, example = "sys_common_sex") | ||||
|     @NotNull(message = "字典类型不能为空") | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dict.vo.type; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dict.vo.type; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | ||||
| import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | ||||
| @@ -10,7 +10,7 @@ import lombok.Data; | ||||
|  * 字典类型 Excel 导出响应 VO | ||||
|  */ | ||||
| @Data | ||||
| public class SysDictTypeExcelVO { | ||||
| public class DictTypeExcelVO { | ||||
| 
 | ||||
|     @ExcelProperty("字典主键") | ||||
|     private Long id; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dict.vo.type; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dict.vo.type; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -9,9 +9,9 @@ import java.util.Date; | ||||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||||
| 
 | ||||
| @ApiModel("字典类型分页列表 Request VO") | ||||
| @ApiModel("管理后台 - 字典类型分页列表 Request VO") | ||||
| @Data | ||||
| public class SysDictTypeExportReqVO { | ||||
| public class DictTypeExportReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "字典类型名称", example = "芋道", notes = "模糊匹配") | ||||
|     private String name; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dict.vo.type; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dict.vo.type; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| @@ -12,10 +12,10 @@ import java.util.Date; | ||||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||||
| 
 | ||||
| @ApiModel("字典类型分页列表 Request VO") | ||||
| @ApiModel("管理后台 - 字典类型分页列表 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysDictTypePageReqVO extends PageParam { | ||||
| public class DictTypePageReqVO extends PageParam { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "字典类型名称", example = "芋道", notes = "模糊匹配") | ||||
|     private String name; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dict.vo.type; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dict.vo.type; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -9,12 +9,12 @@ import lombok.NoArgsConstructor; | ||||
| 
 | ||||
| import java.util.Date; | ||||
| 
 | ||||
| @ApiModel("字典类型信息 Response VO") | ||||
| @ApiModel("管理后台 - 字典类型信息 Response VO") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysDictTypeRespVO extends SysDictTypeBaseVO { | ||||
| public class DictTypeRespVO extends DictTypeBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "字典类型编号", required = true, example = "1024") | ||||
|     private Long id; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dict.vo.type; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dict.vo.type; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -6,11 +6,11 @@ import lombok.AllArgsConstructor; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
| 
 | ||||
| @ApiModel("字典类型精简信息 Response VO") | ||||
| @ApiModel("管理后台 - 字典类型精简信息 Response VO") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class SysDictTypeSimpleRespVO { | ||||
| public class DictTypeSimpleRespVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "字典类型编号", required = true, example = "1024") | ||||
|     private Long id; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.dict.vo.type; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dict.vo.type; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -7,10 +7,10 @@ import lombok.EqualsAndHashCode; | ||||
| 
 | ||||
| import javax.validation.constraints.NotNull; | ||||
| 
 | ||||
| @ApiModel("字典类型更新 Request VO") | ||||
| @ApiModel("管理后台 - 字典类型更新 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysDictTypeUpdateReqVO extends SysDictTypeBaseVO { | ||||
| public class DictTypeUpdateReqVO extends DictTypeBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "字典类型编号", required = true, example = "1024") | ||||
|     @NotNull(message = "字典类型编号不能为空") | ||||
| @@ -1,7 +1,8 @@ | ||||
| ### | ||||
| ### 创建错误码 | ||||
| POST {{baseUrl}}/inra/error-code/create | ||||
| Authorization: Bearer {{token}} | ||||
| Content-Type:application/json | ||||
| Content-Type: application/json | ||||
| tenant-id: {{adminTenentId}} | ||||
| 
 | ||||
| { | ||||
|   "code": 200, | ||||
| @@ -1,13 +1,13 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.errorcode; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.errorcode; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | ||||
| import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | ||||
| import cn.iocoder.yudao.module.system.convert.errorcode.SysErrorCodeConvert; | ||||
| import cn.iocoder.yudao.module.system.controller.errorcode.vo.*; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.errorcode.SysErrorCodeDO; | ||||
| import cn.iocoder.yudao.module.system.service.errorcode.SysErrorCodeService; | ||||
| import cn.iocoder.yudao.module.system.convert.errorcode.ErrorCodeConvert; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.*; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.errorcode.ErrorCodeDO; | ||||
| import cn.iocoder.yudao.module.system.service.errorcode.ErrorCodeService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| @@ -24,26 +24,26 @@ import java.util.List; | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; | ||||
| 
 | ||||
| @Api(tags = "错误码") | ||||
| @Api(tags = "管理后台 - 错误码") | ||||
| @RestController | ||||
| @RequestMapping("/system/error-code") | ||||
| @Validated | ||||
| public class SysErrorCodeController { | ||||
| public class ErrorCodeController { | ||||
| 
 | ||||
|     @Resource | ||||
|     private SysErrorCodeService errorCodeService; | ||||
|     private ErrorCodeService errorCodeService; | ||||
| 
 | ||||
|     @PostMapping("/create") | ||||
|     @ApiOperation("创建错误码") | ||||
|     @PreAuthorize("@ss.hasPermission('system:error-code:create')") | ||||
|     public CommonResult<Long> createErrorCode(@Valid @RequestBody SysErrorCodeCreateReqVO createReqVO) { | ||||
|     public CommonResult<Long> createErrorCode(@Valid @RequestBody ErrorCodeCreateReqVO createReqVO) { | ||||
|         return success(errorCodeService.createErrorCode(createReqVO)); | ||||
|     } | ||||
| 
 | ||||
|     @PutMapping("/update") | ||||
|     @ApiOperation("更新错误码") | ||||
|     @PreAuthorize("@ss.hasPermission('system:error-code:update')") | ||||
|     public CommonResult<Boolean> updateErrorCode(@Valid @RequestBody SysErrorCodeUpdateReqVO updateReqVO) { | ||||
|     public CommonResult<Boolean> updateErrorCode(@Valid @RequestBody ErrorCodeUpdateReqVO updateReqVO) { | ||||
|         errorCodeService.updateErrorCode(updateReqVO); | ||||
|         return success(true); | ||||
|     } | ||||
| @@ -61,29 +61,29 @@ public class SysErrorCodeController { | ||||
|     @ApiOperation("获得错误码") | ||||
|     @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | ||||
|     @PreAuthorize("@ss.hasPermission('system:error-code:query')") | ||||
|     public CommonResult<SysErrorCodeRespVO> getErrorCode(@RequestParam("id") Long id) { | ||||
|         SysErrorCodeDO errorCode = errorCodeService.getErrorCode(id); | ||||
|         return success(SysErrorCodeConvert.INSTANCE.convert(errorCode)); | ||||
|     public CommonResult<ErrorCodeRespVO> getErrorCode(@RequestParam("id") Long id) { | ||||
|         ErrorCodeDO errorCode = errorCodeService.getErrorCode(id); | ||||
|         return success(ErrorCodeConvert.INSTANCE.convert(errorCode)); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/page") | ||||
|     @ApiOperation("获得错误码分页") | ||||
|     @PreAuthorize("@ss.hasPermission('system:error-code:query')") | ||||
|     public CommonResult<PageResult<SysErrorCodeRespVO>> getErrorCodePage(@Valid SysErrorCodePageReqVO pageVO) { | ||||
|         PageResult<SysErrorCodeDO> pageResult = errorCodeService.getErrorCodePage(pageVO); | ||||
|         return success(SysErrorCodeConvert.INSTANCE.convertPage(pageResult)); | ||||
|     public CommonResult<PageResult<ErrorCodeRespVO>> getErrorCodePage(@Valid ErrorCodePageReqVO pageVO) { | ||||
|         PageResult<ErrorCodeDO> pageResult = errorCodeService.getErrorCodePage(pageVO); | ||||
|         return success(ErrorCodeConvert.INSTANCE.convertPage(pageResult)); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/export-excel") | ||||
|     @ApiOperation("导出错误码 Excel") | ||||
|     @PreAuthorize("@ss.hasPermission('system:error-code:export')") | ||||
|     @OperateLog(type = EXPORT) | ||||
|     public void exportErrorCodeExcel(@Valid SysErrorCodeExportReqVO exportReqVO, | ||||
|     public void exportErrorCodeExcel(@Valid ErrorCodeExportReqVO exportReqVO, | ||||
|               HttpServletResponse response) throws IOException { | ||||
|         List<SysErrorCodeDO> list = errorCodeService.getErrorCodeList(exportReqVO); | ||||
|         List<ErrorCodeDO> list = errorCodeService.getErrorCodeList(exportReqVO); | ||||
|         // 导出 Excel | ||||
|         List<SysErrorCodeExcelVO> datas = SysErrorCodeConvert.INSTANCE.convertList02(list); | ||||
|         ExcelUtils.write(response, "错误码.xls", "数据", SysErrorCodeExcelVO.class, datas); | ||||
|         List<ErrorCodeExcelVO> datas = ErrorCodeConvert.INSTANCE.convertList02(list); | ||||
|         ExcelUtils.write(response, "错误码.xls", "数据", ErrorCodeExcelVO.class, datas); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.errorcode.vo; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.errorcode.vo; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.Data; | ||||
| @@ -10,7 +10,7 @@ import javax.validation.constraints.NotNull; | ||||
| * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | ||||
| */ | ||||
| @Data | ||||
| public class SysErrorCodeBaseVO { | ||||
| public class ErrorCodeBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "应用名", required = true, example = "dashboard") | ||||
|     @NotNull(message = "应用名不能为空") | ||||
| @@ -1,14 +1,14 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.sms.vo.template; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.errorcode.vo; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
| 
 | ||||
| @ApiModel("短信模板创建 Request VO") | ||||
| @ApiModel("管理后台 - 错误码创建 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class SysSmsTemplateCreateReqVO extends SysSmsTemplateBaseVO { | ||||
| public class ErrorCodeCreateReqVO extends ErrorCodeBaseVO { | ||||
| 
 | ||||
| } | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.errorcode.vo; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.errorcode.vo; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | ||||
| import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | ||||
| @@ -14,7 +14,7 @@ import java.util.Date; | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| @Data | ||||
| public class SysErrorCodeExcelVO { | ||||
| public class ErrorCodeExcelVO { | ||||
| 
 | ||||
|     @ExcelProperty("错误码编号") | ||||
|     private Long id; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.errorcode.vo; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.errorcode.vo; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -9,9 +9,9 @@ import java.util.Date; | ||||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||||
| 
 | ||||
| @ApiModel(value = "错误码 Excel 导出 Request VO", description = "参数和 InfErrorCodePageReqVO 是一致的") | ||||
| @ApiModel(value = "管理后台 - 错误码 Excel 导出 Request VO", description = "参数和 InfErrorCodePageReqVO 是一致的") | ||||
| @Data | ||||
| public class SysErrorCodeExportReqVO { | ||||
| public class ErrorCodeExportReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "错误码类型", example = "1") | ||||
|     private Integer type; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.errorcode.vo; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.errorcode.vo; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| @@ -12,11 +12,11 @@ import java.util.Date; | ||||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||||
| 
 | ||||
| @ApiModel("错误码分页 Request VO") | ||||
| @ApiModel("管理后台 - 错误码分页 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class SysErrorCodePageReqVO extends PageParam { | ||||
| public class ErrorCodePageReqVO extends PageParam { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "错误码类型", example = "1", notes = "参见 SysErrorCodeTypeEnum 枚举类") | ||||
|     private Integer type; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.errorcode.vo; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.errorcode.vo; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -8,11 +8,11 @@ import lombok.ToString; | ||||
| 
 | ||||
| import java.util.Date; | ||||
| 
 | ||||
| @ApiModel("错误码 Response VO") | ||||
| @ApiModel("管理后台 - 错误码 Response VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class SysErrorCodeRespVO extends SysErrorCodeBaseVO { | ||||
| public class ErrorCodeRespVO extends ErrorCodeBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "错误码编号", required = true, example = "1024") | ||||
|     private Long id; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.errorcode.vo; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.errorcode.vo; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -8,11 +8,11 @@ import lombok.ToString; | ||||
| 
 | ||||
| import javax.validation.constraints.NotNull; | ||||
| 
 | ||||
| @ApiModel("错误码更新 Request VO") | ||||
| @ApiModel("管理后台 - 错误码更新 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class SysErrorCodeUpdateReqVO extends SysErrorCodeBaseVO { | ||||
| public class ErrorCodeUpdateReqVO extends ErrorCodeBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "错误码编号", required = true, example = "1024") | ||||
|     @NotNull(message = "错误码编号不能为空") | ||||
| @@ -1,16 +1,16 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.logger; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.logger; | ||||
| 
 | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.logger.SysLoginLogDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | ||||
| import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | ||||
| import cn.iocoder.yudao.module.system.controller.logger.vo.loginlog.SysLoginLogExcelVO; | ||||
| import cn.iocoder.yudao.module.system.controller.logger.vo.loginlog.SysLoginLogExportReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.logger.vo.loginlog.SysLoginLogPageReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.logger.vo.loginlog.SysLoginLogRespVO; | ||||
| import cn.iocoder.yudao.module.system.convert.logger.SysLoginLogConvert; | ||||
| import cn.iocoder.yudao.module.system.service.logger.SysLoginLogService; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog.LoginLogExcelVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog.LoginLogExportReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog.LoginLogPageReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog.LoginLogRespVO; | ||||
| import cn.iocoder.yudao.module.system.convert.logger.LoginLogConvert; | ||||
| import cn.iocoder.yudao.module.system.service.logger.LoginLogService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import org.springframework.security.access.prepost.PreAuthorize; | ||||
| @@ -27,33 +27,33 @@ import java.util.List; | ||||
| 
 | ||||
| import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; | ||||
| 
 | ||||
| @Api(tags = "登录日志") | ||||
| @Api(tags = "管理后台 - 登录日志") | ||||
| @RestController | ||||
| @RequestMapping("/system/login-log") | ||||
| @Validated | ||||
| public class SysLoginLogController { | ||||
| public class LoginLogController { | ||||
| 
 | ||||
|     @Resource | ||||
|     private SysLoginLogService loginLogService; | ||||
|     private LoginLogService loginLogService; | ||||
| 
 | ||||
|     @GetMapping("/page") | ||||
|     @ApiOperation("获得登录日志分页列表") | ||||
|     @PreAuthorize("@ss.hasPermission('system:login-log:query')") | ||||
|     public CommonResult<PageResult<SysLoginLogRespVO>> getLoginLogPage(@Valid SysLoginLogPageReqVO reqVO) { | ||||
|     public CommonResult<PageResult<LoginLogRespVO>> getLoginLogPage(@Valid LoginLogPageReqVO reqVO) { | ||||
|         PageResult<SysLoginLogDO> page = loginLogService.getLoginLogPage(reqVO); | ||||
|         return CommonResult.success(SysLoginLogConvert.INSTANCE.convertPage(page)); | ||||
|         return CommonResult.success(LoginLogConvert.INSTANCE.convertPage(page)); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/export") | ||||
|     @ApiOperation("导出登录日志 Excel") | ||||
|     @PreAuthorize("@ss.hasPermission('system:login-log:export')") | ||||
|     @OperateLog(type = EXPORT) | ||||
|     public void exportLoginLog(HttpServletResponse response, @Valid SysLoginLogExportReqVO reqVO) throws IOException { | ||||
|     public void exportLoginLog(HttpServletResponse response, @Valid LoginLogExportReqVO reqVO) throws IOException { | ||||
|         List<SysLoginLogDO> list = loginLogService.getLoginLogList(reqVO); | ||||
|         // 拼接数据 | ||||
|         List<SysLoginLogExcelVO> data = SysLoginLogConvert.INSTANCE.convertList(list); | ||||
|         List<LoginLogExcelVO> data = LoginLogConvert.INSTANCE.convertList(list); | ||||
|         // 输出 | ||||
|         ExcelUtils.write(response, "登录日志.xls", "数据列表", SysLoginLogExcelVO.class, data); | ||||
|         ExcelUtils.write(response, "登录日志.xls", "数据列表", LoginLogExcelVO.class, data); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| @@ -1,3 +1,4 @@ | ||||
| ### 请求 /system/operate-log/demo 接口 => 成功 | ||||
| GET {{baseUrl}}/system/operate-log/demo | ||||
| Authorization: Bearer {{token}} | ||||
| tenant-id: {{adminTenentId}} | ||||
| @@ -1,12 +1,12 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.logger; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.logger; | ||||
| 
 | ||||
| import cn.iocoder.yudao.module.system.controller.logger.vo.operatelog.SysOperateLogExcelVO; | ||||
| import cn.iocoder.yudao.module.system.controller.logger.vo.operatelog.SysOperateLogExportReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.logger.vo.operatelog.SysOperateLogPageReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.logger.vo.operatelog.SysOperateLogRespVO; | ||||
| import cn.iocoder.yudao.module.system.convert.logger.SysOperateLogConvert; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.logger.SysOperateLogDO; | ||||
| import cn.iocoder.yudao.module.system.service.logger.SysOperateLogService; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog.OperateLogExcelVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog.OperateLogExportReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog.OperateLogPageReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog.OperateLogRespVO; | ||||
| import cn.iocoder.yudao.module.system.convert.logger.OperateLogConvert; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.logger.OperateLogDO; | ||||
| import cn.iocoder.yudao.module.system.service.logger.OperateLogService; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.user.SysUserDO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.service.user.SysUserCoreService; | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| @@ -35,30 +35,30 @@ import java.util.Map; | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; | ||||
| 
 | ||||
| @Api(tags = "操作日志") | ||||
| @Api(tags = "管理后台 - 操作日志") | ||||
| @RestController | ||||
| @RequestMapping("/system/operate-log") | ||||
| @Validated | ||||
| public class SysOperateLogController { | ||||
| public class OperateLogController { | ||||
| 
 | ||||
|     @Resource | ||||
|     private SysOperateLogService operateLogService; | ||||
|     private OperateLogService operateLogService; | ||||
|     @Resource | ||||
|     private SysUserCoreService userCoreService; | ||||
| 
 | ||||
|     @GetMapping("/page") | ||||
|     @ApiOperation("查看操作日志分页列表") | ||||
|     @PreAuthorize("@ss.hasPermission('system:operate-log:query')") | ||||
|     public CommonResult<PageResult<SysOperateLogRespVO>> pageOperateLog(@Valid SysOperateLogPageReqVO reqVO) { | ||||
|         PageResult<SysOperateLogDO> pageResult = operateLogService.getOperateLogPage(reqVO); | ||||
|     public CommonResult<PageResult<OperateLogRespVO>> pageOperateLog(@Valid OperateLogPageReqVO reqVO) { | ||||
|         PageResult<OperateLogDO> pageResult = operateLogService.getOperateLogPage(reqVO); | ||||
| 
 | ||||
|         // 获得拼接需要的数据 | ||||
|         Collection<Long> userIds = CollectionUtils.convertList(pageResult.getList(), SysOperateLogDO::getUserId); | ||||
|         Collection<Long> userIds = CollectionUtils.convertList(pageResult.getList(), OperateLogDO::getUserId); | ||||
|         Map<Long, SysUserDO> userMap = userCoreService.getUserMap(userIds); | ||||
|         // 拼接数据 | ||||
|         List<SysOperateLogRespVO> list = new ArrayList<>(pageResult.getList().size()); | ||||
|         List<OperateLogRespVO> list = new ArrayList<>(pageResult.getList().size()); | ||||
|         pageResult.getList().forEach(operateLog -> { | ||||
|             SysOperateLogRespVO respVO = SysOperateLogConvert.INSTANCE.convert(operateLog); | ||||
|             OperateLogRespVO respVO = OperateLogConvert.INSTANCE.convert(operateLog); | ||||
|             list.add(respVO); | ||||
|             // 拼接用户信息 | ||||
|             MapUtils.findAndThen(userMap, operateLog.getUserId(), user -> respVO.setUserNickname(user.getNickname())); | ||||
| @@ -70,16 +70,16 @@ public class SysOperateLogController { | ||||
|     @GetMapping("/export") | ||||
|     @PreAuthorize("@ss.hasPermission('system:operate-log:export')") | ||||
|     @OperateLog(type = EXPORT) | ||||
|     public void exportOperateLog(HttpServletResponse response, @Valid SysOperateLogExportReqVO reqVO) throws IOException { | ||||
|         List<SysOperateLogDO> list = operateLogService.getOperateLogs(reqVO); | ||||
|     public void exportOperateLog(HttpServletResponse response, @Valid OperateLogExportReqVO reqVO) throws IOException { | ||||
|         List<OperateLogDO> list = operateLogService.getOperateLogs(reqVO); | ||||
| 
 | ||||
|         // 获得拼接需要的数据 | ||||
|         Collection<Long> userIds = CollectionUtils.convertList(list, SysOperateLogDO::getUserId); | ||||
|         Collection<Long> userIds = CollectionUtils.convertList(list, OperateLogDO::getUserId); | ||||
|         Map<Long, SysUserDO> userMap = userCoreService.getUserMap(userIds); | ||||
|         // 拼接数据 | ||||
|         List<SysOperateLogExcelVO> excelDataList = SysOperateLogConvert.INSTANCE.convertList(list, userMap); | ||||
|         List<OperateLogExcelVO> excelDataList = OperateLogConvert.INSTANCE.convertList(list, userMap); | ||||
|         // 输出 | ||||
|         ExcelUtils.write(response, "操作日志.xls", "数据列表", SysOperateLogExcelVO.class, excelDataList); | ||||
|         ExcelUtils.write(response, "操作日志.xls", "数据列表", OperateLogExcelVO.class, excelDataList); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.logger.vo.loginlog; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.Data; | ||||
| @@ -13,7 +13,7 @@ import javax.validation.constraints.Size; | ||||
|  * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | ||||
|  */ | ||||
| @Data | ||||
| public class SysLoginLogBaseVO { | ||||
| public class LoginLogBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "日志类型", required = true, example = "1", notes = "参见 SysLoginLogTypeEnum 枚举类") | ||||
|     @NotNull(message = "日志类型不能为空") | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.logger.vo.loginlog; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | ||||
| import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | ||||
| @@ -12,7 +12,7 @@ import java.util.Date; | ||||
|  * 登录日志 Excel 导出响应 VO | ||||
|  */ | ||||
| @Data | ||||
| public class SysLoginLogExcelVO { | ||||
| public class LoginLogExcelVO { | ||||
| 
 | ||||
|     @ExcelProperty("日志主键") | ||||
|     private Long id; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.logger.vo.loginlog; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -9,9 +9,9 @@ import java.util.Date; | ||||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||||
| 
 | ||||
| @ApiModel("登录日志分页列表 Request VO") | ||||
| @ApiModel("管理后台 - 登录日志分页列表 Request VO") | ||||
| @Data | ||||
| public class SysLoginLogExportReqVO { | ||||
| public class LoginLogExportReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "用户 IP", example = "127.0.0.1", notes = "模拟匹配") | ||||
|     private String userIp; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.logger.vo.loginlog; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| @@ -11,10 +11,10 @@ import java.util.Date; | ||||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||||
| 
 | ||||
| @ApiModel("登录日志分页列表 Request VO") | ||||
| @ApiModel("管理后台 - 登录日志分页列表 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysLoginLogPageReqVO extends PageParam { | ||||
| public class LoginLogPageReqVO extends PageParam { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "用户 IP", example = "127.0.0.1", notes = "模拟匹配") | ||||
|     private String userIp; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.logger.vo.loginlog; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -9,11 +9,11 @@ import lombok.ToString; | ||||
| import javax.validation.constraints.NotNull; | ||||
| import java.util.Date; | ||||
| 
 | ||||
| @ApiModel("登录日志 Response VO") | ||||
| @ApiModel("管理后台 - 登录日志 Response VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class SysLoginLogRespVO extends SysLoginLogBaseVO { | ||||
| public class LoginLogRespVO extends LoginLogBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "日志编号", required = true, example = "1024") | ||||
|     private Long id; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.logger.vo.operatelog; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.Data; | ||||
| @@ -13,7 +13,7 @@ import java.util.Map; | ||||
|  * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | ||||
|  */ | ||||
| @Data | ||||
| public class SysOperateLogBaseVO { | ||||
| public class OperateLogBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "链路追踪编号", required = true, example = "89aca178-a370-411c-ae02-3f0d672be4ab") | ||||
|     @NotEmpty(message = "链路追踪编号不能为空") | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.logger.vo.operatelog; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | ||||
| import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | ||||
| @@ -12,7 +12,7 @@ import java.util.Date; | ||||
|  * 操作日志 Excel 导出响应 VO | ||||
|  */ | ||||
| @Data | ||||
| public class SysOperateLogExcelVO { | ||||
| public class OperateLogExcelVO { | ||||
| 
 | ||||
|     @ExcelProperty("日志编号") | ||||
|     private Long id; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.logger.vo.operatelog; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -9,9 +9,9 @@ import java.util.Date; | ||||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||||
| 
 | ||||
| @ApiModel("操作日志分页列表 Request VO") | ||||
| @ApiModel("管理后台 - 操作日志分页列表 Request VO") | ||||
| @Data | ||||
| public class SysOperateLogExportReqVO { | ||||
| public class OperateLogExportReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "操作模块", example = "订单", notes = "模拟匹配") | ||||
|     private String module; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.logger.vo.operatelog; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| @@ -10,9 +10,9 @@ import java.util.Date; | ||||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||||
| 
 | ||||
| @ApiModel("操作日志分页列表 Request VO") | ||||
| @ApiModel("管理后台 - 操作日志分页列表 Request VO") | ||||
| @Data | ||||
| public class SysOperateLogPageReqVO extends PageParam { | ||||
| public class OperateLogPageReqVO extends PageParam { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "操作模块", example = "订单", notes = "模拟匹配") | ||||
|     private String module; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.logger.vo.operatelog; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -6,11 +6,11 @@ import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
| 
 | ||||
| @ApiModel("操作日志 Response VO") | ||||
| @ApiModel("管理后台 - 操作日志 Response VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class SysOperateLogRespVO extends SysOperateLogBaseVO { | ||||
| public class OperateLogRespVO extends OperateLogBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "日志编号", required = true, example = "1024") | ||||
|     private Long id; | ||||
| @@ -1,13 +1,13 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.notice; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.notice; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.module.system.controller.notice.vo.SysNoticeCreateReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.notice.vo.SysNoticePageReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.notice.vo.SysNoticeRespVO; | ||||
| import cn.iocoder.yudao.module.system.controller.notice.vo.SysNoticeUpdateReqVO; | ||||
| import cn.iocoder.yudao.module.system.convert.notice.SysNoticeConvert; | ||||
| import cn.iocoder.yudao.module.system.service.notice.SysNoticeService; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticeCreateReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticePageReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticeRespVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticeUpdateReqVO; | ||||
| import cn.iocoder.yudao.module.system.convert.notice.NoticeConvert; | ||||
| import cn.iocoder.yudao.module.system.service.notice.NoticeService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| @@ -20,19 +20,19 @@ import javax.validation.Valid; | ||||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| 
 | ||||
| @Api(tags = "通知公告") | ||||
| @Api(tags = "管理后台 - 通知公告") | ||||
| @RestController | ||||
| @RequestMapping("/system/notice") | ||||
| @Validated | ||||
| public class SysNoticeController { | ||||
| public class NoticeController { | ||||
| 
 | ||||
|     @Resource | ||||
|     private SysNoticeService noticeService; | ||||
|     private NoticeService noticeService; | ||||
| 
 | ||||
|     @PostMapping("/create") | ||||
|     @ApiOperation("创建通知公告") | ||||
|     @PreAuthorize("@ss.hasPermission('system:notice:create')") | ||||
|     public CommonResult<Long> createNotice(@Valid @RequestBody SysNoticeCreateReqVO reqVO) { | ||||
|     public CommonResult<Long> createNotice(@Valid @RequestBody NoticeCreateReqVO reqVO) { | ||||
|         Long noticeId = noticeService.createNotice(reqVO); | ||||
|         return success(noticeId); | ||||
|     } | ||||
| @@ -40,7 +40,7 @@ public class SysNoticeController { | ||||
|     @PutMapping("/update") | ||||
|     @ApiOperation("修改通知公告") | ||||
|     @PreAuthorize("@ss.hasPermission('system:notice:update')") | ||||
|     public CommonResult<Boolean> updateNotice(@Valid @RequestBody SysNoticeUpdateReqVO reqVO) { | ||||
|     public CommonResult<Boolean> updateNotice(@Valid @RequestBody NoticeUpdateReqVO reqVO) { | ||||
|         noticeService.updateNotice(reqVO); | ||||
|         return success(true); | ||||
|     } | ||||
| @@ -57,16 +57,16 @@ public class SysNoticeController { | ||||
|     @GetMapping("/page") | ||||
|     @ApiOperation("获取通知公告列表") | ||||
|     @PreAuthorize("@ss.hasPermission('system:notice:query')") | ||||
|     public CommonResult<PageResult<SysNoticeRespVO>> pageNotices(@Validated SysNoticePageReqVO reqVO) { | ||||
|         return success(SysNoticeConvert.INSTANCE.convertPage(noticeService.pageNotices(reqVO))); | ||||
|     public CommonResult<PageResult<NoticeRespVO>> pageNotices(@Validated NoticePageReqVO reqVO) { | ||||
|         return success(NoticeConvert.INSTANCE.convertPage(noticeService.pageNotices(reqVO))); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/get") | ||||
|     @ApiOperation("获得通知公告") | ||||
|     @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | ||||
|     @PreAuthorize("@ss.hasPermission('system:notice:query')") | ||||
|     public CommonResult<SysNoticeRespVO> getNotice(@RequestParam("id") Long id) { | ||||
|         return success(SysNoticeConvert.INSTANCE.convert(noticeService.getNotice(id))); | ||||
|     public CommonResult<NoticeRespVO> getNotice(@RequestParam("id") Long id) { | ||||
|         return success(NoticeConvert.INSTANCE.convert(noticeService.getNotice(id))); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.notice.vo; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.notice.vo; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.Data; | ||||
| @@ -12,7 +12,7 @@ import javax.validation.constraints.Size; | ||||
|  * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | ||||
|  */ | ||||
| @Data | ||||
| public class SysNoticeBaseVO { | ||||
| public class NoticeBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "公告标题", required = true, example = "小博主") | ||||
|     @NotBlank(message = "公告标题不能为空") | ||||
| @@ -0,0 +1,11 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.admin.notice.vo; | ||||
|  | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
|  | ||||
| @ApiModel("管理后台 - 通知公告创建 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class NoticeCreateReqVO extends NoticeBaseVO { | ||||
| } | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.notice.vo; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.notice.vo; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| @@ -6,10 +6,10 @@ import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| 
 | ||||
| @ApiModel("通知公告分页 Request VO") | ||||
| @ApiModel("管理后台 - 通知公告分页 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysNoticePageReqVO extends PageParam { | ||||
| public class NoticePageReqVO extends PageParam { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "通知公告名称", example = "芋道", notes = "模糊匹配") | ||||
|     private String title; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.notice.vo; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.notice.vo; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -7,10 +7,10 @@ import lombok.EqualsAndHashCode; | ||||
| 
 | ||||
| import java.util.Date; | ||||
| 
 | ||||
| @ApiModel("通知公告信息 Response VO") | ||||
| @ApiModel("管理后台 - 通知公告信息 Response VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysNoticeRespVO extends SysNoticeBaseVO { | ||||
| public class NoticeRespVO extends NoticeBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "通知公告序号", required = true, example = "1024") | ||||
|     private Long id; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.notice.vo; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.notice.vo; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -7,10 +7,10 @@ import lombok.EqualsAndHashCode; | ||||
| 
 | ||||
| import javax.validation.constraints.NotNull; | ||||
| 
 | ||||
| @ApiModel("岗位公告更新 Request VO") | ||||
| @ApiModel("管理后台 - 岗位公告更新 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysNoticeUpdateReqVO extends SysNoticeBaseVO { | ||||
| public class NoticeUpdateReqVO extends NoticeBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "岗位公告编号", required = true, example = "1024") | ||||
|     @NotNull(message = "岗位公告编号不能为空") | ||||
| @@ -1,3 +1,4 @@ | ||||
| ### 请求 /menu/list 接口 => 成功 | ||||
| GET {{baseUrl}}/system/menu/list | ||||
| Authorization: Bearer {{token}} | ||||
| tenant-id: {{adminTenentId}} | ||||
| @@ -1,11 +1,11 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.permission; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.permission; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.module.system.controller.permission.vo.menu.*; | ||||
| import cn.iocoder.yudao.module.system.convert.permission.SysMenuConvert; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.permission.SysMenuDO; | ||||
| import cn.iocoder.yudao.module.system.service.permission.SysMenuService; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu.*; | ||||
| import cn.iocoder.yudao.module.system.convert.permission.MenuConvert; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO; | ||||
| import cn.iocoder.yudao.module.system.service.permission.MenuService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| @@ -20,19 +20,19 @@ import java.util.List; | ||||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| 
 | ||||
| @Api(tags = "菜单") | ||||
| @Api(tags = "管理后台 - 菜单") | ||||
| @RestController | ||||
| @RequestMapping("/system/menu") | ||||
| @Validated | ||||
| public class SysMenuController { | ||||
| public class MenuController { | ||||
| 
 | ||||
|     @Resource | ||||
|     private SysMenuService menuService; | ||||
|     private MenuService menuService; | ||||
| 
 | ||||
|     @PostMapping("/create") | ||||
|     @ApiOperation("创建菜单") | ||||
|     @PreAuthorize("@ss.hasPermission('system:menu:create')") | ||||
|     public CommonResult<Long> createMenu(@Valid @RequestBody SysMenuCreateReqVO reqVO) { | ||||
|     public CommonResult<Long> createMenu(@Valid @RequestBody MenuCreateReqVO reqVO) { | ||||
|         Long menuId = menuService.createMenu(reqVO); | ||||
|         return success(menuId); | ||||
|     } | ||||
| @@ -40,7 +40,7 @@ public class SysMenuController { | ||||
|     @PutMapping("/update") | ||||
|     @ApiOperation("修改菜单") | ||||
|     @PreAuthorize("@ss.hasPermission('system:menu:update')") | ||||
|     public CommonResult<Boolean> updateMenu(@Valid @RequestBody SysMenuUpdateReqVO reqVO) { | ||||
|     public CommonResult<Boolean> updateMenu(@Valid @RequestBody MenuUpdateReqVO reqVO) { | ||||
|         menuService.updateMenu(reqVO); | ||||
|         return success(true); | ||||
|     } | ||||
| @@ -57,30 +57,30 @@ public class SysMenuController { | ||||
|     @GetMapping("/list") | ||||
|     @ApiOperation("获取菜单列表") | ||||
|     @PreAuthorize("@ss.hasPermission('system:menu:query')") | ||||
|     public CommonResult<List<SysMenuRespVO>> getMenus(SysMenuListReqVO reqVO) { | ||||
|         List<SysMenuDO> list = menuService.getMenus(reqVO); | ||||
|         list.sort(Comparator.comparing(SysMenuDO::getSort)); | ||||
|         return success(SysMenuConvert.INSTANCE.convertList(list)); | ||||
|     public CommonResult<List<MenuRespVO>> getMenus(MenuListReqVO reqVO) { | ||||
|         List<MenuDO> list = menuService.getMenus(reqVO); | ||||
|         list.sort(Comparator.comparing(MenuDO::getSort)); | ||||
|         return success(MenuConvert.INSTANCE.convertList(list)); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/list-all-simple") | ||||
|     @ApiOperation(value = "获取菜单精简信息列表", notes = "只包含被开启的菜单,主要用于前端的下拉选项") | ||||
|     public CommonResult<List<SysMenuSimpleRespVO>> getSimpleMenus() { | ||||
|     public CommonResult<List<MenuSimpleRespVO>> getSimpleMenus() { | ||||
|         // 获得菜单列表,只要开启状态的 | ||||
|         SysMenuListReqVO reqVO = new SysMenuListReqVO(); | ||||
|         MenuListReqVO reqVO = new MenuListReqVO(); | ||||
|         reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); | ||||
|         List<SysMenuDO> list = menuService.getMenus(reqVO); | ||||
|         List<MenuDO> list = menuService.getMenus(reqVO); | ||||
|         // 排序后,返回个诶前端 | ||||
|         list.sort(Comparator.comparing(SysMenuDO::getSort)); | ||||
|         return success(SysMenuConvert.INSTANCE.convertList02(list)); | ||||
|         list.sort(Comparator.comparing(MenuDO::getSort)); | ||||
|         return success(MenuConvert.INSTANCE.convertList02(list)); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/get") | ||||
|     @ApiOperation("获取菜单信息") | ||||
|     @PreAuthorize("@ss.hasPermission('system:menu:query')") | ||||
|     public CommonResult<SysMenuRespVO> getMenu(Long id) { | ||||
|         SysMenuDO menu = menuService.getMenu(id); | ||||
|         return success(SysMenuConvert.INSTANCE.convert(menu)); | ||||
|     public CommonResult<MenuRespVO> getMenu(Long id) { | ||||
|         MenuDO menu = menuService.getMenu(id); | ||||
|         return success(MenuConvert.INSTANCE.convert(menu)); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| @@ -1,10 +1,10 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.permission; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.permission; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.module.system.controller.permission.vo.permission.SysPermissionAssignRoleDataScopeReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.permission.vo.permission.SysPermissionAssignRoleMenuReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.permission.vo.permission.SysPermissionAssignUserRoleReqVO; | ||||
| import cn.iocoder.yudao.module.system.service.permission.SysPermissionService; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.permission.vo.permission.PermissionAssignRoleDataScopeReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.permission.vo.permission.PermissionAssignRoleMenuReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.permission.vo.permission.PermissionAssignUserRoleReqVO; | ||||
| import cn.iocoder.yudao.module.system.service.permission.PermissionService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| @@ -12,6 +12,7 @@ import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import javax.validation.Valid; | ||||
| import java.util.Set; | ||||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| @@ -21,13 +22,15 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
|  * | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| @Api(tags = "权限") | ||||
| @Api(tags = "管理后台 - 权限") | ||||
| @RestController | ||||
| @RequestMapping("/system/permission") | ||||
| public class SysPermissionController { | ||||
| public class PermissionController { | ||||
| 
 | ||||
|     @Resource | ||||
|     private SysPermissionService permissionService; | ||||
|     private PermissionService permissionService; | ||||
| 
 | ||||
|     // TODO @芋艿:处理下全新啊标识 | ||||
| 
 | ||||
|     @ApiOperation("获得角色拥有的菜单编号") | ||||
|     @ApiImplicitParam(name = "roleId", value = "角色编号", required = true, dataTypeClass = Long.class) | ||||
| @@ -40,7 +43,7 @@ public class SysPermissionController { | ||||
|     @PostMapping("/assign-role-menu") | ||||
|     @ApiOperation("赋予角色菜单") | ||||
| //    @RequiresPermissions("system:permission:assign-role-resource") | ||||
|     public CommonResult<Boolean> assignRoleMenu(@Validated @RequestBody SysPermissionAssignRoleMenuReqVO reqVO) { | ||||
|     public CommonResult<Boolean> assignRoleMenu(@Validated @RequestBody PermissionAssignRoleMenuReqVO reqVO) { | ||||
|         permissionService.assignRoleMenu(reqVO.getRoleId(), reqVO.getMenuIds()); | ||||
|         return success(true); | ||||
|     } | ||||
| @@ -48,8 +51,7 @@ public class SysPermissionController { | ||||
|     @PostMapping("/assign-role-data-scope") | ||||
|     @ApiOperation("赋予角色数据权限") | ||||
| //    @RequiresPermissions("system:permission:assign-role-data-scope") | ||||
|     public CommonResult<Boolean> assignRoleDataScope( | ||||
|             @Validated @RequestBody SysPermissionAssignRoleDataScopeReqVO reqVO) { | ||||
|     public CommonResult<Boolean> assignRoleDataScope(@Valid @RequestBody PermissionAssignRoleDataScopeReqVO reqVO) { | ||||
|         permissionService.assignRoleDataScope(reqVO.getRoleId(), reqVO.getDataScope(), reqVO.getDataScopeDeptIds()); | ||||
|         return success(true); | ||||
|     } | ||||
| @@ -65,7 +67,7 @@ public class SysPermissionController { | ||||
|     @ApiOperation("赋予用户角色") | ||||
|     @PostMapping("/assign-user-role") | ||||
| //    @RequiresPermissions("system:permission:assign-user-role") | ||||
|     public CommonResult<Boolean> assignUserRole(@Validated @RequestBody SysPermissionAssignUserRoleReqVO reqVO) { | ||||
|     public CommonResult<Boolean> assignUserRole(@Validated @RequestBody PermissionAssignUserRoleReqVO reqVO) { | ||||
|         permissionService.assignUserRole(reqVO.getUserId(), reqVO.getRoleIds()); | ||||
|         return success(true); | ||||
|     } | ||||
| @@ -2,6 +2,7 @@ | ||||
| POST {{baseUrl}}/system/role/create | ||||
| Authorization: Bearer {{token}} | ||||
| Content-Type: application/json | ||||
| tenant-id: {{adminTenentId}} | ||||
| 
 | ||||
| { | ||||
|   "name": "测试角色", | ||||
| @@ -13,7 +14,7 @@ Content-Type: application/json | ||||
| POST {{baseUrl}}/system/role/update | ||||
| Authorization: Bearer {{token}} | ||||
| Content-Type: application/json | ||||
| 
 | ||||
| tenant-id: {{adminTenentId}} | ||||
| 
 | ||||
| { | ||||
|   "id": 100, | ||||
| @@ -25,6 +26,7 @@ Content-Type: application/json | ||||
| POST {{baseUrl}}/system/role/delete | ||||
| Content-Type: application/x-www-form-urlencoded | ||||
| Authorization: Bearer {{token}} | ||||
| tenant-id: {{adminTenentId}} | ||||
| 
 | ||||
| roleId=14 | ||||
| 
 | ||||
| @@ -32,10 +34,12 @@ roleId=14 | ||||
| GET {{baseUrl}}/system/role/get?id=100 | ||||
| Content-Type: application/x-www-form-urlencoded | ||||
| Authorization: Bearer {{token}} | ||||
| tenant-id: {{adminTenentId}} | ||||
| 
 | ||||
| ### /role/page 成功 | ||||
| GET {{baseUrl}}/system/role/page?pageNo=1&pageSize=10 | ||||
| Authorization: Bearer {{token}} | ||||
| tenant-id: {{adminTenentId}} | ||||
| 
 | ||||
| ### | ||||
| 
 | ||||
| @@ -1,14 +1,14 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.permission; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.permission; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | ||||
| import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | ||||
| import cn.iocoder.yudao.module.system.controller.permission.vo.role.*; | ||||
| import cn.iocoder.yudao.module.system.convert.permission.SysRoleConvert; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.*; | ||||
| import cn.iocoder.yudao.module.system.convert.permission.RoleConvert; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.permission.SysRoleDO; | ||||
| import cn.iocoder.yudao.module.system.service.permission.SysRoleService; | ||||
| import cn.iocoder.yudao.module.system.service.permission.RoleService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| @@ -27,26 +27,26 @@ import java.util.List; | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; | ||||
| 
 | ||||
| @Api(tags = "角色") | ||||
| @Api(tags = "管理后台 - 角色") | ||||
| @RestController | ||||
| @RequestMapping("/system/role") | ||||
| @Validated | ||||
| public class SysRoleController { | ||||
| public class RoleController { | ||||
| 
 | ||||
|     @Resource | ||||
|     private SysRoleService roleService; | ||||
|     private RoleService roleService; | ||||
| 
 | ||||
|     @PostMapping("/create") | ||||
|     @ApiOperation("创建角色") | ||||
|     @PreAuthorize("@ss.hasPermission('system:role:create')") | ||||
|     public CommonResult<Long> createRole(@Valid @RequestBody SysRoleCreateReqVO reqVO) { | ||||
|     public CommonResult<Long> createRole(@Valid @RequestBody RoleCreateReqVO reqVO) { | ||||
|         return success(roleService.createRole(reqVO)); | ||||
|     } | ||||
| 
 | ||||
|     @PutMapping("/update") | ||||
|     @ApiOperation("修改角色") | ||||
|     @PreAuthorize("@ss.hasPermission('system:role:update')") | ||||
|     public CommonResult<Boolean> updateRole(@Valid @RequestBody SysRoleUpdateReqVO reqVO) { | ||||
|     public CommonResult<Boolean> updateRole(@Valid @RequestBody RoleUpdateReqVO reqVO) { | ||||
|         roleService.updateRole(reqVO); | ||||
|         return success(true); | ||||
|     } | ||||
| @@ -54,7 +54,7 @@ public class SysRoleController { | ||||
|     @PutMapping("/update-status") | ||||
|     @ApiOperation("修改角色状态") | ||||
|     @PreAuthorize("@ss.hasPermission('system:role:update')") | ||||
|     public CommonResult<Boolean> updateRoleStatus(@Valid @RequestBody SysRoleUpdateStatusReqVO reqVO) { | ||||
|     public CommonResult<Boolean> updateRoleStatus(@Valid @RequestBody RoleUpdateStatusReqVO reqVO) { | ||||
|         roleService.updateRoleStatus(reqVO.getId(), reqVO.getStatus()); | ||||
|         return success(true); | ||||
|     } | ||||
| @@ -71,36 +71,36 @@ public class SysRoleController { | ||||
|     @GetMapping("/get") | ||||
|     @ApiOperation("获得角色信息") | ||||
|     @PreAuthorize("@ss.hasPermission('system:role:query')") | ||||
|     public CommonResult<SysRoleRespVO> getRole(@RequestParam("id") Long id) { | ||||
|     public CommonResult<RoleRespVO> getRole(@RequestParam("id") Long id) { | ||||
|         SysRoleDO role = roleService.getRole(id); | ||||
|         return success(SysRoleConvert.INSTANCE.convert(role)); | ||||
|         return success(RoleConvert.INSTANCE.convert(role)); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/page") | ||||
|     @ApiOperation("获得角色分页") | ||||
|     @PreAuthorize("@ss.hasPermission('system:role:query')") | ||||
|     public CommonResult<PageResult<SysRoleDO>> getRolePage(SysRolePageReqVO reqVO) { | ||||
|     public CommonResult<PageResult<SysRoleDO>> getRolePage(RolePageReqVO reqVO) { | ||||
|         return success(roleService.getRolePage(reqVO)); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/list-all-simple") | ||||
|     @ApiOperation(value = "获取角色精简信息列表", notes = "只包含被开启的角色,主要用于前端的下拉选项") | ||||
|     public CommonResult<List<SysRoleSimpleRespVO>> getSimpleRoles() { | ||||
|     public CommonResult<List<RoleSimpleRespVO>> getSimpleRoles() { | ||||
|         // 获得角色列表,只要开启状态的 | ||||
|         List<SysRoleDO> list = roleService.getRoles(Collections.singleton(CommonStatusEnum.ENABLE.getStatus())); | ||||
|         // 排序后,返回个诶前端 | ||||
|         list.sort(Comparator.comparing(SysRoleDO::getSort)); | ||||
|         return success(SysRoleConvert.INSTANCE.convertList02(list)); | ||||
|         return success(RoleConvert.INSTANCE.convertList02(list)); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/export") | ||||
|     @OperateLog(type = EXPORT) | ||||
|     @PreAuthorize("@ss.hasPermission('system:role:export')") | ||||
|     public void export(HttpServletResponse response, @Validated SysRoleExportReqVO reqVO) throws IOException { | ||||
|     public void export(HttpServletResponse response, @Validated RoleExportReqVO reqVO) throws IOException { | ||||
|         List<SysRoleDO> list = roleService.getRoleList(reqVO); | ||||
|         List<SysRoleExcelVO> data = SysRoleConvert.INSTANCE.convertList03(list); | ||||
|         List<RoleExcelVO> data = RoleConvert.INSTANCE.convertList03(list); | ||||
|         // 输出 | ||||
|         ExcelUtils.write(response, "角色数据.xls", "角色列表", SysRoleExcelVO.class, data); | ||||
|         ExcelUtils.write(response, "角色数据.xls", "角色列表", RoleExcelVO.class, data); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.permission.vo.menu; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.Data; | ||||
| @@ -12,7 +12,7 @@ import javax.validation.constraints.Size; | ||||
|  * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | ||||
|  */ | ||||
| @Data | ||||
| public class SysMenuBaseVO { | ||||
| public class MenuBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "菜单名称", required = true, example = "芋道") | ||||
|     @NotBlank(message = "菜单名称不能为空") | ||||
| @@ -0,0 +1,10 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu; | ||||
|  | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import lombok.*; | ||||
|  | ||||
| @ApiModel("管理后台 - 菜单创建 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class MenuCreateReqVO extends MenuBaseVO { | ||||
| } | ||||
| @@ -1,12 +1,12 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.permission.vo.menu; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| @ApiModel("菜单列表 Request VO") | ||||
| @ApiModel("管理后台 - 菜单列表 Request VO") | ||||
| @Data | ||||
| public class SysMenuListReqVO { | ||||
| public class MenuListReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "菜单名称", example = "芋道", notes = "模糊匹配") | ||||
|     private String name; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.permission.vo.menu; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -9,12 +9,12 @@ import lombok.NoArgsConstructor; | ||||
| 
 | ||||
| import java.util.Date; | ||||
| 
 | ||||
| @ApiModel("菜单信息 Response VO") | ||||
| @ApiModel("管理后台 - 菜单信息 Response VO") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysMenuRespVO extends SysMenuBaseVO { | ||||
| public class MenuRespVO extends MenuBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "菜单编号", required = true, example = "1024") | ||||
|     private Long id; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.permission.vo.menu; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -6,11 +6,11 @@ import lombok.AllArgsConstructor; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
| 
 | ||||
| @ApiModel("菜单精简信息 Response VO") | ||||
| @ApiModel("管理后台 - 菜单精简信息 Response VO") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class SysMenuSimpleRespVO { | ||||
| public class MenuSimpleRespVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "菜单编号", required = true, example = "1024") | ||||
|     private Long id; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.permission.vo.menu; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -6,10 +6,10 @@ import lombok.*; | ||||
| 
 | ||||
| import javax.validation.constraints.NotNull; | ||||
| 
 | ||||
| @ApiModel("菜单更新 Request VO") | ||||
| @ApiModel("管理后台 - 菜单更新 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysMenuUpdateReqVO extends SysMenuBaseVO { | ||||
| public class MenuUpdateReqVO extends MenuBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "菜单编号", required = true, example = "1024") | ||||
|     @NotNull(message = "菜单编号不能为空") | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.permission.vo.permission; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.permission.vo.permission; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -8,9 +8,9 @@ import javax.validation.constraints.NotNull; | ||||
| import java.util.Collections; | ||||
| import java.util.Set; | ||||
| 
 | ||||
| @ApiModel("赋予角色数据权限 Request VO") | ||||
| @ApiModel("管理后台 - 赋予角色数据权限 Request VO") | ||||
| @Data | ||||
| public class SysPermissionAssignRoleDataScopeReqVO { | ||||
| public class PermissionAssignRoleDataScopeReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "角色编号", required = true, example = "1") | ||||
|     @NotNull(message = "角色编号不能为空") | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.permission.vo.permission; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.permission.vo.permission; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -8,9 +8,9 @@ import javax.validation.constraints.NotNull; | ||||
| import java.util.Collections; | ||||
| import java.util.Set; | ||||
| 
 | ||||
| @ApiModel("赋予角色菜单 Request VO") | ||||
| @ApiModel("管理后台 - 赋予角色菜单 Request VO") | ||||
| @Data | ||||
| public class SysPermissionAssignRoleMenuReqVO { | ||||
| public class PermissionAssignRoleMenuReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "角色编号", required = true, example = "1") | ||||
|     @NotNull(message = "角色编号不能为空") | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.permission.vo.permission; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.permission.vo.permission; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -8,9 +8,9 @@ import javax.validation.constraints.NotNull; | ||||
| import java.util.Collections; | ||||
| import java.util.Set; | ||||
| 
 | ||||
| @ApiModel("赋予用户角色 Request VO") | ||||
| @ApiModel("管理后台 - 赋予用户角色 Request VO") | ||||
| @Data | ||||
| public class SysPermissionAssignUserRoleReqVO { | ||||
| public class PermissionAssignUserRoleReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "角色编号", required = true, example = "1") | ||||
|     @NotNull(message = "角色编号不能为空") | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.permission.vo.role; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.permission.vo.role; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.Data; | ||||
| @@ -12,7 +12,7 @@ import javax.validation.constraints.Size; | ||||
|  * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | ||||
|  */ | ||||
| @Data | ||||
| public class SysRoleBaseVO { | ||||
| public class RoleBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "角色名称", required = true, example = "管理员") | ||||
|     @NotBlank(message = "角色名称不能为空") | ||||
| @@ -0,0 +1,12 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.admin.permission.vo.role; | ||||
|  | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
|  | ||||
| @ApiModel("管理后台 - 角色创建 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class RoleCreateReqVO extends RoleBaseVO { | ||||
|  | ||||
| } | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.permission.vo.role; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.permission.vo.role; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | ||||
| import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | ||||
| @@ -10,7 +10,7 @@ import lombok.Data; | ||||
|  * 角色 Excel 导出响应 VO | ||||
|  */ | ||||
| @Data | ||||
| public class SysRoleExcelVO { | ||||
| public class RoleExcelVO { | ||||
| 
 | ||||
|     @ExcelProperty("角色序号") | ||||
|     private Long id; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.permission.vo.role; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.permission.vo.role; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -9,9 +9,9 @@ import java.util.Date; | ||||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||||
| 
 | ||||
| @ApiModel("角色分页 Request VO") | ||||
| @ApiModel("管理后台 - 角色分页 Request VO") | ||||
| @Data | ||||
| public class SysRoleExportReqVO { | ||||
| public class RoleExportReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "角色名称", example = "芋道", notes = "模糊匹配") | ||||
|     private String name; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.permission.vo.role; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.permission.vo.role; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| @@ -11,10 +11,10 @@ import java.util.Date; | ||||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||||
| 
 | ||||
| @ApiModel("角色分页 Request VO") | ||||
| @ApiModel("管理后台 - 角色分页 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysRolePageReqVO extends PageParam { | ||||
| public class RolePageReqVO extends PageParam { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "角色名称", example = "芋道", notes = "模糊匹配") | ||||
|     private String name; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.permission.vo.role; | ||||
| package cn.iocoder.yudao.module.system.controller.admin.permission.vo.role; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -10,12 +10,12 @@ import lombok.NoArgsConstructor; | ||||
| import java.util.Date; | ||||
| import java.util.Set; | ||||
| 
 | ||||
| @ApiModel("角色信息 Response VO") | ||||
| @ApiModel("管理后台 - 角色信息 Response VO") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysRoleRespVO extends SysRoleBaseVO { | ||||
| public class RoleRespVO extends RoleBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "角色编号", required = true, example = "1") | ||||
|     private Long id; | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user
	 YunaiV
					YunaiV