mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 10:18:42 +08:00 
			
		
		
		
	多模块重构 4:system 模块的创建,去除 Sys
This commit is contained in:
		| @@ -3,19 +3,19 @@ package cn.iocoder.yudao.module.system.controller.admin.auth; | ||||
| 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.dal.dataobject.permission.SysRoleDO; | ||||
| import cn.iocoder.yudao.module.system.enums.permission.MenuTypeEnum; | ||||
| 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; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.user.UserDO; | ||||
| import cn.iocoder.yudao.module.system.service.social.SocialUserService; | ||||
| import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | ||||
| import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.framework.common.util.collection.SetUtils; | ||||
| import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | ||||
| import cn.iocoder.yudao.module.system.service.user.UserService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | ||||
| @@ -45,14 +45,15 @@ public class AuthController { | ||||
|     @Autowired | ||||
|     @SuppressWarnings("SpringJavaAutowiredFieldsWarningInspection") // AuthService 存在重名 | ||||
|     private AuthService authService; | ||||
|     @Resource | ||||
|     private SysUserCoreService userCoreService; | ||||
|     @Autowired | ||||
|     @SuppressWarnings("SpringJavaAutowiredFieldsWarningInspection") // UserService 存在重名 | ||||
|     private UserService userService; | ||||
|     @Resource | ||||
|     private RoleService roleService; | ||||
|     @Resource | ||||
|     private PermissionService permissionService; | ||||
|     @Resource | ||||
|     private SysSocialCoreService socialCoreService; | ||||
|     private SocialUserService socialCoreService; | ||||
|  | ||||
|     @PostMapping("/login") | ||||
|     @ApiOperation("使用账号密码登录") | ||||
| @@ -67,7 +68,7 @@ public class AuthController { | ||||
|     @ApiOperation("获取登录用户的权限信息") | ||||
|     public CommonResult<AuthPermissionInfoRespVO> getPermissionInfo() { | ||||
|         // 获得用户信息 | ||||
|         SysUserDO user = userCoreService.getUser(getLoginUserId()); | ||||
|         UserDO user = userService.getUser(getLoginUserId()); | ||||
|         if (user == null) { | ||||
|             return null; | ||||
|         } | ||||
|   | ||||
| @@ -3,19 +3,19 @@ package cn.iocoder.yudao.module.system.controller.admin.auth; | ||||
| 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.dal.dataobject.dept.SysDeptDO; | ||||
| 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; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.service.dept.SysDeptCoreService; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.service.user.SysUserCoreService; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.auth.SysUserSessionDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.user.UserDO; | ||||
| import cn.iocoder.yudao.module.system.service.dept.SysDeptCoreService; | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.common.util.collection.MapUtils; | ||||
| import cn.iocoder.yudao.module.system.service.user.UserService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.security.access.prepost.PreAuthorize; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
| @@ -35,10 +35,9 @@ public class UserSessionController { | ||||
|  | ||||
|     @Resource | ||||
|     private UserSessionService userSessionService; | ||||
|     @Resource | ||||
|     private SysUserSessionCoreService userSessionCoreService; | ||||
|     @Resource | ||||
|     private SysUserCoreService userCoreService; | ||||
|     @Autowired | ||||
|     @SuppressWarnings("SpringJavaAutowiredFieldsWarningInspection") // UserService 存在重名 | ||||
|     private UserService userService; | ||||
|  | ||||
|     @Resource | ||||
|     private SysDeptCoreService deptCoreService; | ||||
| @@ -51,10 +50,10 @@ public class UserSessionController { | ||||
|         PageResult<SysUserSessionDO> pageResult = userSessionService.getUserSessionPage(reqVO); | ||||
|  | ||||
|         // 获得拼接需要的数据 | ||||
|         Map<Long, SysUserDO> userMap = userCoreService.getUserMap( | ||||
|         Map<Long, UserDO> userMap = userService.getUserMap( | ||||
|                 convertList(pageResult.getList(), SysUserSessionDO::getUserId)); | ||||
|         Map<Long, SysDeptDO> deptMap = deptCoreService.getDeptMap( | ||||
|                 convertList(userMap.values(), SysUserDO::getDeptId)); | ||||
|                 convertList(userMap.values(), UserDO::getDeptId)); | ||||
|         // 拼接结果返回 | ||||
|         List<UserSessionPageItemRespVO> sessionList = new ArrayList<>(pageResult.getList().size()); | ||||
|         pageResult.getList().forEach(session -> { | ||||
| @@ -76,7 +75,7 @@ public class UserSessionController { | ||||
|             example = "fe50b9f6-d177-44b1-8da9-72ea34f63db7") | ||||
|     @PreAuthorize("@ss.hasPermission('system:user-session:delete')") | ||||
|     public CommonResult<Boolean> deleteUserSession(@RequestParam("id") String id) { | ||||
|         userSessionCoreService.deleteUserSession(id); | ||||
|         userSessionService.deleteUserSession(id); | ||||
|         return success(true); | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| 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.module.system.enums.social.SocialTypeEnum; | ||||
| import cn.iocoder.yudao.framework.common.validation.InEnum; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -20,7 +20,7 @@ import javax.validation.constraints.NotNull; | ||||
| public class AuthSocialBindReqVO { | ||||
|  | ||||
|     @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") | ||||
|     @InEnum(SysSocialTypeEnum.class) | ||||
|     @InEnum(SocialTypeEnum.class) | ||||
|     @NotNull(message = "社交平台的类型不能为空") | ||||
|     private Integer type; | ||||
|  | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| 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; | ||||
| import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.AllArgsConstructor; | ||||
| @@ -22,7 +22,7 @@ import javax.validation.constraints.Pattern; | ||||
| public class AuthSocialLogin2ReqVO { | ||||
|  | ||||
|     @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") | ||||
|     @InEnum(SysSocialTypeEnum.class) | ||||
|     @InEnum(SocialTypeEnum.class) | ||||
|     @NotNull(message = "社交平台的类型不能为空") | ||||
|     private Integer type; | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| 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.module.system.enums.social.SocialTypeEnum; | ||||
| import cn.iocoder.yudao.framework.common.validation.InEnum; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| @@ -20,7 +20,7 @@ import javax.validation.constraints.NotNull; | ||||
| public class AuthSocialLoginReqVO { | ||||
|  | ||||
|     @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") | ||||
|     @InEnum(SysSocialTypeEnum.class) | ||||
|     @InEnum(SocialTypeEnum.class) | ||||
|     @NotNull(message = "社交平台的类型不能为空") | ||||
|     private Integer type; | ||||
|  | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| 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; | ||||
| import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.AllArgsConstructor; | ||||
| @@ -20,7 +20,7 @@ import javax.validation.constraints.NotNull; | ||||
| public class AuthSocialUnbindReqVO { | ||||
|  | ||||
|     @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") | ||||
|     @InEnum(SysSocialTypeEnum.class) | ||||
|     @InEnum(SocialTypeEnum.class) | ||||
|     @NotNull(message = "社交平台的类型不能为空") | ||||
|     private Integer type; | ||||
|  | ||||
|   | ||||
| @@ -1,11 +1,11 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dept; | ||||
|  | ||||
| import cn.iocoder.yudao.coreservice.modules.system.service.dept.SysDeptCoreService; | ||||
| import cn.iocoder.yudao.module.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.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.dal.dataobject.dept.SysDeptDO; | ||||
| import cn.iocoder.yudao.module.system.service.dept.DeptService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
|   | ||||
| @@ -7,7 +7,7 @@ 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.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.dal.dataobject.dept.SysPostDO; | ||||
| import cn.iocoder.yudao.module.system.service.dept.PostService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
|   | ||||
| @@ -2,7 +2,7 @@ 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; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.enums.SysDictTypeConstants; | ||||
| import cn.iocoder.yudao.module.system.enums.DictTypeConstants; | ||||
| import com.alibaba.excel.annotation.ExcelProperty; | ||||
| import lombok.Data; | ||||
|  | ||||
| @@ -25,7 +25,7 @@ public class PostExcelVO { | ||||
|     private Integer sort; | ||||
|  | ||||
|     @ExcelProperty(value = "状态", converter = DictConvert.class) | ||||
|     @DictFormat(SysDictTypeConstants.COMMON_STATUS) | ||||
|     @DictFormat(DictTypeConstants.COMMON_STATUS) | ||||
|     private String status; | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.admin.dict; | ||||
|  | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.dict.SysDictDataDO; | ||||
| import cn.iocoder.yudao.module.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; | ||||
|   | ||||
| @@ -2,7 +2,7 @@ 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; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.enums.SysDictTypeConstants; | ||||
| import cn.iocoder.yudao.module.system.enums.DictTypeConstants; | ||||
| import com.alibaba.excel.annotation.ExcelProperty; | ||||
| import lombok.Data; | ||||
|  | ||||
| @@ -28,7 +28,7 @@ public class DictDataExcelVO { | ||||
|     private String dictType; | ||||
|  | ||||
|     @ExcelProperty(value = "状态", converter = DictConvert.class) | ||||
|     @DictFormat(SysDictTypeConstants.COMMON_STATUS) | ||||
|     @DictFormat(DictTypeConstants.COMMON_STATUS) | ||||
|     private Integer status; | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -2,7 +2,7 @@ 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; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.enums.SysDictTypeConstants; | ||||
| import cn.iocoder.yudao.module.system.enums.DictTypeConstants; | ||||
| import com.alibaba.excel.annotation.ExcelProperty; | ||||
| import lombok.Data; | ||||
|  | ||||
| @@ -22,7 +22,7 @@ public class DictTypeExcelVO { | ||||
|     private String type; | ||||
|  | ||||
|     @ExcelProperty(value = "状态", converter = DictConvert.class) | ||||
|     @DictFormat(SysDictTypeConstants.COMMON_STATUS) | ||||
|     @DictFormat(DictTypeConstants.COMMON_STATUS) | ||||
|     private Integer status; | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| package cn.iocoder.yudao.module.system.controller.admin.logger; | ||||
|  | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.logger.SysLoginLogDO; | ||||
| import cn.iocoder.yudao.module.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; | ||||
|   | ||||
| @@ -7,16 +7,17 @@ import cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog.Oper | ||||
| 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.module.system.dal.dataobject.user.UserDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | ||||
| import cn.iocoder.yudao.framework.common.util.collection.MapUtils; | ||||
| import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | ||||
| import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | ||||
| import cn.iocoder.yudao.module.system.service.user.UserService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.security.access.prepost.PreAuthorize; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | ||||
| @@ -43,8 +44,9 @@ public class OperateLogController { | ||||
|  | ||||
|     @Resource | ||||
|     private OperateLogService operateLogService; | ||||
|     @Resource | ||||
|     private SysUserCoreService userCoreService; | ||||
|     @Autowired | ||||
|     @SuppressWarnings("SpringJavaAutowiredFieldsWarningInspection") // UserService 存在重名 | ||||
|     private UserService userService; | ||||
|  | ||||
|     @GetMapping("/page") | ||||
|     @ApiOperation("查看操作日志分页列表") | ||||
| @@ -54,7 +56,7 @@ public class OperateLogController { | ||||
|  | ||||
|         // 获得拼接需要的数据 | ||||
|         Collection<Long> userIds = CollectionUtils.convertList(pageResult.getList(), OperateLogDO::getUserId); | ||||
|         Map<Long, SysUserDO> userMap = userCoreService.getUserMap(userIds); | ||||
|         Map<Long, UserDO> userMap = userService.getUserMap(userIds); | ||||
|         // 拼接数据 | ||||
|         List<OperateLogRespVO> list = new ArrayList<>(pageResult.getList().size()); | ||||
|         pageResult.getList().forEach(operateLog -> { | ||||
| @@ -75,7 +77,7 @@ public class OperateLogController { | ||||
|  | ||||
|         // 获得拼接需要的数据 | ||||
|         Collection<Long> userIds = CollectionUtils.convertList(list, OperateLogDO::getUserId); | ||||
|         Map<Long, SysUserDO> userMap = userCoreService.getUserMap(userIds); | ||||
|         Map<Long, UserDO> userMap = userService.getUserMap(userIds); | ||||
|         // 拼接数据 | ||||
|         List<OperateLogExcelVO> excelDataList = OperateLogConvert.INSTANCE.convertList(list, userMap); | ||||
|         // 输出 | ||||
|   | ||||
| @@ -2,7 +2,7 @@ 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; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.enums.SysDictTypeConstants; | ||||
| import cn.iocoder.yudao.module.system.enums.DictTypeConstants; | ||||
| import com.alibaba.excel.annotation.ExcelProperty; | ||||
| import lombok.Data; | ||||
|  | ||||
| @@ -21,11 +21,11 @@ public class LoginLogExcelVO { | ||||
|     private String username; | ||||
|  | ||||
|     @ExcelProperty(value = "日志类型", converter = DictConvert.class) | ||||
|     @DictFormat(SysDictTypeConstants.LOGIN_TYPE) | ||||
|     @DictFormat(DictTypeConstants.LOGIN_TYPE) | ||||
|     private Integer logType; | ||||
|  | ||||
|     @ExcelProperty(value = "登录结果", converter = DictConvert.class) | ||||
|     @DictFormat(SysDictTypeConstants.LOGIN_RESULT) | ||||
|     @DictFormat(DictTypeConstants.LOGIN_RESULT) | ||||
|     private Integer result; | ||||
|  | ||||
|     @ExcelProperty("登录 IP") | ||||
|   | ||||
| @@ -2,7 +2,7 @@ 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; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.enums.SysDictTypeConstants; | ||||
| import cn.iocoder.yudao.module.system.enums.DictTypeConstants; | ||||
| import com.alibaba.excel.annotation.ExcelProperty; | ||||
| import lombok.Data; | ||||
|  | ||||
| @@ -24,7 +24,7 @@ public class OperateLogExcelVO { | ||||
|     private String name; | ||||
|  | ||||
|     @ExcelProperty(value = "操作类型", converter = DictConvert.class) | ||||
|     @DictFormat(SysDictTypeConstants.OPERATE_TYPE) | ||||
|     @DictFormat(DictTypeConstants.OPERATE_TYPE) | ||||
|     private String type; | ||||
|  | ||||
|     @ExcelProperty("操作人") | ||||
|   | ||||
| @@ -7,7 +7,7 @@ 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.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.dal.dataobject.permission.SysRoleDO; | ||||
| import cn.iocoder.yudao.module.system.service.permission.RoleService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
|   | ||||
| @@ -2,7 +2,7 @@ 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; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.enums.SysDictTypeConstants; | ||||
| import cn.iocoder.yudao.module.system.enums.DictTypeConstants; | ||||
| import com.alibaba.excel.annotation.ExcelProperty; | ||||
| import lombok.Data; | ||||
|  | ||||
| @@ -28,7 +28,7 @@ public class RoleExcelVO { | ||||
|     private Integer dataScope; | ||||
|  | ||||
|     @ExcelProperty(value = "角色状态", converter = DictConvert.class) | ||||
|     @DictFormat(SysDictTypeConstants.COMMON_STATUS) | ||||
|     @DictFormat(DictTypeConstants.COMMON_STATUS) | ||||
|     private String status; | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.system.controller.admin.sms; | ||||
|  | ||||
| import cn.hutool.core.util.URLUtil; | ||||
| import cn.hutool.extra.servlet.ServletUtil; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.service.sms.SysSmsCoreService; | ||||
| import cn.iocoder.yudao.module.system.service.sms.SysSmsSendService; | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | ||||
| import cn.iocoder.yudao.framework.sms.core.enums.SmsChannelEnum; | ||||
| @@ -25,7 +25,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| public class SmsCallbackController { | ||||
|  | ||||
|     @Resource | ||||
|     private SysSmsCoreService smsCoreService; | ||||
|     private SysSmsSendService smsCoreService; | ||||
|  | ||||
|     @PostMapping("/sms/yunpian") | ||||
|     @ApiOperation(value = "云片短信的回调", notes = "参见 https://www.yunpian.com/official/document/sms/zh_cn/domestic_push_report 文档") | ||||
|   | ||||
| @@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.system.controller.admin.sms; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.*; | ||||
| import cn.iocoder.yudao.module.system.convert.sms.SmsChannelConvert; | ||||
| import cn.iocoder.yudao.module.system.service.sms.SmsChannelService; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.sms.SysSmsChannelDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsChannelDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import io.swagger.annotations.Api; | ||||
|   | ||||
| @@ -6,7 +6,7 @@ import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogPageReqV | ||||
| import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SysSmsLogRespVO; | ||||
| import cn.iocoder.yudao.module.system.convert.sms.SmsLogConvert; | ||||
| import cn.iocoder.yudao.module.system.service.sms.SmsLogService; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.sms.SysSmsLogDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsLogDO; | ||||
| 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; | ||||
|   | ||||
| @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.system.controller.admin.sms; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.*; | ||||
| import cn.iocoder.yudao.module.system.convert.sms.SmsTemplateConvert; | ||||
| import cn.iocoder.yudao.module.system.service.sms.SmsTemplateService; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.sms.SysSmsTemplateDO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.service.sms.SysSmsCoreService; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsTemplateDO; | ||||
| import cn.iocoder.yudao.module.system.service.sms.SysSmsSendService; | ||||
| 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; | ||||
| @@ -32,7 +32,7 @@ public class SmsTemplateController { | ||||
|     @Resource | ||||
|     private SmsTemplateService smsTemplateService; | ||||
|     @Resource | ||||
|     private SysSmsCoreService smsCoreService; | ||||
|     private SysSmsSendService smsCoreService; | ||||
|  | ||||
|     @PostMapping("/create") | ||||
|     @ApiOperation("创建短信模板") | ||||
|   | ||||
| @@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.system.controller.admin.sms.vo.log; | ||||
| import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | ||||
| import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | ||||
| import cn.iocoder.yudao.framework.excel.core.convert.JsonConvert; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.enums.SysDictTypeConstants; | ||||
| import cn.iocoder.yudao.module.system.enums.DictTypeConstants; | ||||
| import com.alibaba.excel.annotation.ExcelProperty; | ||||
| import lombok.Data; | ||||
|  | ||||
| @@ -34,7 +34,7 @@ public class SmsLogExcelVO { | ||||
|     private String templateCode; | ||||
|  | ||||
|     @ExcelProperty(value = "短信类型", converter = DictConvert.class) | ||||
|     @DictFormat(SysDictTypeConstants.SMS_TEMPLATE_TYPE) | ||||
|     @DictFormat(DictTypeConstants.SMS_TEMPLATE_TYPE) | ||||
|     private Integer templateType; | ||||
|  | ||||
|     @ExcelProperty("短信内容") | ||||
| @@ -53,11 +53,11 @@ public class SmsLogExcelVO { | ||||
|     private Long userId; | ||||
|  | ||||
|     @ExcelProperty(value = "用户类型", converter = DictConvert.class) | ||||
|     @DictFormat(SysDictTypeConstants.USER_TYPE) | ||||
|     @DictFormat(DictTypeConstants.USER_TYPE) | ||||
|     private Integer userType; | ||||
|  | ||||
|     @ExcelProperty(value = "发送状态", converter = DictConvert.class) | ||||
|     @DictFormat(SysDictTypeConstants.SMS_SEND_STATUS) | ||||
|     @DictFormat(DictTypeConstants.SMS_SEND_STATUS) | ||||
|     private Integer sendStatus; | ||||
|  | ||||
|     @ExcelProperty("发送时间") | ||||
| @@ -82,7 +82,7 @@ public class SmsLogExcelVO { | ||||
|     private String apiSerialNo; | ||||
|  | ||||
|     @ExcelProperty(value = "接收状态", converter = DictConvert.class) | ||||
|     @DictFormat(SysDictTypeConstants.SMS_RECEIVE_STATUS) | ||||
|     @DictFormat(DictTypeConstants.SMS_RECEIVE_STATUS) | ||||
|     private Integer receiveStatus; | ||||
|  | ||||
|     @ExcelProperty("接收时间") | ||||
|   | ||||
| @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.system.controller.admin.sms.vo.template; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | ||||
| import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.enums.SysDictTypeConstants; | ||||
| import cn.iocoder.yudao.module.system.enums.DictTypeConstants; | ||||
| import com.alibaba.excel.annotation.ExcelProperty; | ||||
| import lombok.Data; | ||||
|  | ||||
| @@ -20,11 +20,11 @@ public class SmsTemplateExcelVO { | ||||
|     private Long id; | ||||
|  | ||||
|     @ExcelProperty(value = "短信签名", converter = DictConvert.class) | ||||
|     @DictFormat(SysDictTypeConstants.SMS_TEMPLATE_TYPE) | ||||
|     @DictFormat(DictTypeConstants.SMS_TEMPLATE_TYPE) | ||||
|     private Integer type; | ||||
|  | ||||
|     @ExcelProperty(value = "开启状态", converter = DictConvert.class) | ||||
|     @DictFormat(SysDictTypeConstants.COMMON_STATUS) | ||||
|     @DictFormat(DictTypeConstants.COMMON_STATUS) | ||||
|     private Integer status; | ||||
|  | ||||
|     @ExcelProperty("模板编码") | ||||
| @@ -46,7 +46,7 @@ public class SmsTemplateExcelVO { | ||||
|     private Long channelId; | ||||
|  | ||||
|     @ExcelProperty(value = "短信渠道编码", converter = DictConvert.class) | ||||
|     @DictFormat(SysDictTypeConstants.SMS_CHANNEL_CODE) | ||||
|     @DictFormat(DictTypeConstants.SMS_CHANNEL_CODE) | ||||
|     private String channelCode; | ||||
|  | ||||
|     @ExcelProperty("创建时间") | ||||
|   | ||||
| @@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.system.controller.admin.tenant; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.*; | ||||
| import cn.iocoder.yudao.module.system.convert.tenant.TenantConvert; | ||||
| import cn.iocoder.yudao.module.system.service.tenant.TenantService; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.tenant.SysTenantDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.tenant.SysTenantDO; | ||||
| 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; | ||||
|   | ||||
| @@ -3,12 +3,11 @@ package cn.iocoder.yudao.module.system.controller.admin.user; | ||||
| import cn.hutool.core.collection.CollUtil; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.*; | ||||
| import cn.iocoder.yudao.module.system.convert.user.UserConvert; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.dept.SysDeptDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; | ||||
| import cn.iocoder.yudao.module.system.service.user.UserService; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.user.SysUserDO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.enums.common.SysSexEnum; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.service.dept.SysDeptCoreService; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.service.user.SysUserCoreService; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.user.UserDO; | ||||
| import cn.iocoder.yudao.module.system.enums.common.SysSexEnum; | ||||
| import cn.iocoder.yudao.module.system.service.dept.SysDeptCoreService; | ||||
| import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| @@ -19,6 +18,7 @@ import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.security.access.prepost.PreAuthorize; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
| @@ -41,11 +41,10 @@ import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.E | ||||
| @Validated | ||||
| public class UserController { | ||||
|  | ||||
|     @Resource | ||||
|     @Autowired | ||||
|     @SuppressWarnings("SpringJavaAutowiredFieldsWarningInspection") // UserService 存在重名 | ||||
|     private UserService userService; | ||||
|     @Resource | ||||
|     private SysUserCoreService userCoreService; | ||||
|     @Resource | ||||
|     private SysDeptCoreService deptCoreService; | ||||
|  | ||||
|     @PostMapping("/create") | ||||
| @@ -94,13 +93,13 @@ public class UserController { | ||||
|     @PreAuthorize("@ss.hasPermission('system:user:list')") | ||||
|     public CommonResult<PageResult<UserPageItemRespVO>> getUserPage(@Valid UserPageReqVO reqVO) { | ||||
|         // 获得用户分页列表 | ||||
|         PageResult<SysUserDO> pageResult = userService.getUserPage(reqVO); | ||||
|         PageResult<UserDO> pageResult = userService.getUserPage(reqVO); | ||||
|         if (CollUtil.isEmpty(pageResult.getList())) { | ||||
|             return success(new PageResult<>(pageResult.getTotal())); // 返回空 | ||||
|         } | ||||
|  | ||||
|         // 获得拼接需要的数据 | ||||
|         Collection<Long> deptIds = convertList(pageResult.getList(), SysUserDO::getDeptId); | ||||
|         Collection<Long> deptIds = convertList(pageResult.getList(), UserDO::getDeptId); | ||||
|         Map<Long, SysDeptDO> deptMap = deptCoreService.getDeptMap(deptIds); | ||||
|         // 拼接结果返回 | ||||
|         List<UserPageItemRespVO> userList = new ArrayList<>(pageResult.getList().size()); | ||||
| @@ -116,7 +115,7 @@ public class UserController { | ||||
|     @ApiOperation(value = "获取用户精简信息列表", notes = "只包含被开启的用户,主要用于前端的下拉选项") | ||||
|     public CommonResult<List<UserSimpleRespVO>> getSimpleUsers() { | ||||
|         // 获用户门列表,只要开启状态的 | ||||
|         List<SysUserDO> list = userService.getUsersByStatus(CommonStatusEnum.ENABLE.getStatus()); | ||||
|         List<UserDO> list = userService.getUsersByStatus(CommonStatusEnum.ENABLE.getStatus()); | ||||
|         // 排序后,返回给前端 | ||||
|         return success(UserConvert.INSTANCE.convertList04(list)); | ||||
|     } | ||||
| @@ -126,7 +125,7 @@ public class UserController { | ||||
|     @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | ||||
|     @PreAuthorize("@ss.hasPermission('system:user:query')") | ||||
|     public CommonResult<UserRespVO> getInfo(@RequestParam("id") Long id) { | ||||
|         return success(UserConvert.INSTANCE.convert(userCoreService.getUser(id))); | ||||
|         return success(UserConvert.INSTANCE.convert(userService.getUser(id))); | ||||
|     } | ||||
|  | ||||
|     @GetMapping("/export") | ||||
| @@ -136,12 +135,13 @@ public class UserController { | ||||
|     public void exportUsers(@Validated UserExportReqVO reqVO, | ||||
|                             HttpServletResponse response) throws IOException { | ||||
|         // 获得用户列表 | ||||
|         List<SysUserDO> users = userService.getUsers(reqVO); | ||||
|         List<UserDO> users = userService.getUsers(reqVO); | ||||
|  | ||||
|         // 获得拼接需要的数据 | ||||
|         Collection<Long> deptIds = convertList(users, SysUserDO::getDeptId); | ||||
|         Collection<Long> deptIds = convertList(users, UserDO::getDeptId); | ||||
|         Map<Long, SysDeptDO> deptMap = deptCoreService.getDeptMap(deptIds); | ||||
|         Map<Long, SysUserDO> deptLeaderUserMap = userCoreService.getUserMap(convertSet(deptMap.values(), SysDeptDO::getLeaderUserId)); | ||||
|         Map<Long, UserDO> deptLeaderUserMap = userService.getUserMap( | ||||
|                 convertSet(deptMap.values(), SysDeptDO::getLeaderUserId)); | ||||
|         // 拼接数据 | ||||
|         List<UserExcelVO> excelUsers = new ArrayList<>(users.size()); | ||||
|         users.forEach(user -> { | ||||
|   | ||||
| @@ -9,20 +9,20 @@ import cn.iocoder.yudao.module.system.service.dept.PostService; | ||||
| import cn.iocoder.yudao.module.system.service.permission.PermissionService; | ||||
| import cn.iocoder.yudao.module.system.service.permission.RoleService; | ||||
| import cn.iocoder.yudao.module.system.service.user.UserService; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.dept.SysDeptDO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.dept.SysPostDO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.permission.SysRoleDO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.social.SysSocialUserDO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.user.SysUserDO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.service.dept.SysDeptCoreService; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.service.social.SysSocialCoreService; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.service.user.SysUserCoreService; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysPostDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.permission.SysRoleDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.social.SysSocialUserDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.user.UserDO; | ||||
| import cn.iocoder.yudao.module.system.service.dept.SysDeptCoreService; | ||||
| import cn.iocoder.yudao.module.system.service.social.SocialUserService; | ||||
| import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | ||||
| import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import io.swagger.annotations.Api; | ||||
| 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.*; | ||||
| import org.springframework.web.multipart.MultipartFile; | ||||
| @@ -43,11 +43,10 @@ import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUti | ||||
| @Slf4j | ||||
| public class UserProfileController { | ||||
|  | ||||
|     @Resource | ||||
|     @Autowired | ||||
|     @SuppressWarnings("SpringJavaAutowiredFieldsWarningInspection") // UserService 存在重名 | ||||
|     private UserService userService; | ||||
|     @Resource | ||||
|     private SysUserCoreService userCoreService; | ||||
|     @Resource | ||||
|     private SysDeptCoreService deptCoreService; | ||||
|  | ||||
|     @Resource | ||||
| @@ -57,13 +56,13 @@ public class UserProfileController { | ||||
|     @Resource | ||||
|     private RoleService roleService; | ||||
|     @Resource | ||||
|     private SysSocialCoreService socialService; | ||||
|     private SocialUserService socialService; | ||||
|  | ||||
|     @GetMapping("/get") | ||||
|     @ApiOperation("获得登录用户信息") | ||||
|     public CommonResult<UserProfileRespVO> profile() { | ||||
|         // 获得用户基本信息 | ||||
|         SysUserDO user = userCoreService.getUser(getLoginUserId()); | ||||
|         UserDO user = userService.getUser(getLoginUserId()); | ||||
|         UserProfileRespVO resp = UserConvert.INSTANCE.convert03(user); | ||||
|         // 获得用户角色 | ||||
|         List<SysRoleDO> userRoles = roleService.getRolesFromCache(permissionService.getUserRoleIdListByUserId(user.getId())); | ||||
|   | ||||
| @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.system.controller.admin.user.vo.user; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | ||||
| import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.enums.SysDictTypeConstants; | ||||
| import cn.iocoder.yudao.module.system.enums.DictTypeConstants; | ||||
| import com.alibaba.excel.annotation.ExcelProperty; | ||||
| import lombok.Data; | ||||
|  | ||||
| @@ -30,11 +30,11 @@ public class UserExcelVO { | ||||
|     private String mobile; | ||||
|  | ||||
|     @ExcelProperty(value = "用户性别", converter = DictConvert.class) | ||||
|     @DictFormat(SysDictTypeConstants.USER_SEX) | ||||
|     @DictFormat(DictTypeConstants.USER_SEX) | ||||
|     private Integer sex; | ||||
|  | ||||
|     @ExcelProperty(value = "帐号状态", converter = DictConvert.class) | ||||
|     @DictFormat(SysDictTypeConstants.COMMON_STATUS) | ||||
|     @DictFormat(DictTypeConstants.COMMON_STATUS) | ||||
|     private Integer status; | ||||
|  | ||||
|     @ExcelProperty("最后登录IP") | ||||
|   | ||||
| @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.system.controller.admin.user.vo.user; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | ||||
| import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.enums.SysDictTypeConstants; | ||||
| import cn.iocoder.yudao.module.system.enums.DictTypeConstants; | ||||
| import com.alibaba.excel.annotation.ExcelProperty; | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Builder; | ||||
| @@ -36,11 +36,11 @@ public class UserImportExcelVO { | ||||
|     private String mobile; | ||||
|  | ||||
|     @ExcelProperty(value = "用户性别", converter = DictConvert.class) | ||||
|     @DictFormat(SysDictTypeConstants.USER_SEX) | ||||
|     @DictFormat(DictTypeConstants.USER_SEX) | ||||
|     private Integer sex; | ||||
|  | ||||
|     @ExcelProperty(value = "账号状态", converter = DictConvert.class) | ||||
|     @DictFormat(SysDictTypeConstants.COMMON_STATUS) | ||||
|     @DictFormat(DictTypeConstants.COMMON_STATUS) | ||||
|     private Integer status; | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -3,9 +3,9 @@ package cn.iocoder.yudao.module.system.convert.auth; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.auth.vo.auth.AuthMenuRespVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.auth.vo.auth.AuthPermissionInfoRespVO; | ||||
| 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.dal.dataobject.permission.SysRoleDO; | ||||
| import cn.iocoder.yudao.module.system.enums.permission.MenuIdEnum; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.user.SysUserDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.user.UserDO; | ||||
| import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | ||||
| import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | ||||
| import cn.iocoder.yudao.framework.security.core.LoginUser; | ||||
| @@ -22,14 +22,14 @@ public interface AuthConvert { | ||||
|     AuthConvert INSTANCE = Mappers.getMapper(AuthConvert.class); | ||||
|  | ||||
|     @Mapping(source = "updateTime", target = "updateTime", ignore = true) // 字段相同,但是含义不同,忽略 | ||||
|     LoginUser convert0(SysUserDO bean); | ||||
|     LoginUser convert0(UserDO bean); | ||||
|  | ||||
|     default LoginUser convert(SysUserDO bean) { | ||||
|     default LoginUser convert(UserDO bean) { | ||||
|         // 目的,为了设置 UserTypeEnum.ADMIN.getValue() | ||||
|         return convert0(bean).setUserType(UserTypeEnum.ADMIN.getValue()); | ||||
|     } | ||||
|  | ||||
|     default AuthPermissionInfoRespVO convert(SysUserDO user, List<SysRoleDO> roleList, List<MenuDO> menuList) { | ||||
|     default AuthPermissionInfoRespVO convert(UserDO user, List<SysRoleDO> roleList, List<MenuDO> menuList) { | ||||
|         return AuthPermissionInfoRespVO.builder() | ||||
|             .user(AuthPermissionInfoRespVO.UserVO.builder().id(user.getId()).nickname(user.getNickname()).avatar(user.getAvatar()).build()) | ||||
|             .roles(CollectionUtils.convertSet(roleList, SysRoleDO::getCode)) | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| package cn.iocoder.yudao.module.system.convert.auth; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.controller.admin.auth.vo.session.UserSessionPageItemRespVO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.auth.SysUserSessionDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.auth.SysUserSessionDO; | ||||
| import org.mapstruct.Mapper; | ||||
| import org.mapstruct.factory.Mappers; | ||||
|  | ||||
|   | ||||
| @@ -4,7 +4,7 @@ import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptCreateRe | ||||
| import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptRespVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptSimpleRespVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptUpdateReqVO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.dept.SysDeptDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; | ||||
| import org.mapstruct.Mapper; | ||||
| import org.mapstruct.factory.Mappers; | ||||
|  | ||||
|   | ||||
| @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.system.convert.dept; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.*; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.dept.SysPostDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysPostDO; | ||||
| import org.mapstruct.Mapper; | ||||
| import org.mapstruct.factory.Mappers; | ||||
|  | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| package cn.iocoder.yudao.module.system.convert.dict; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.*; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.dict.SysDictDataDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.dict.SysDictDataDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO; | ||||
| import org.mapstruct.Mapper; | ||||
|   | ||||
| @@ -0,0 +1,20 @@ | ||||
| package cn.iocoder.yudao.module.system.convert.dict; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.dict.SysDictDataDO; | ||||
| import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO; | ||||
| import org.mapstruct.Mapper; | ||||
| import org.mapstruct.factory.Mappers; | ||||
|  | ||||
| import java.util.Collection; | ||||
| import java.util.List; | ||||
|  | ||||
| @Mapper | ||||
| public interface SysDictDataCoreConvert { | ||||
|  | ||||
|     SysDictDataCoreConvert INSTANCE = Mappers.getMapper(SysDictDataCoreConvert.class); | ||||
|  | ||||
|     DictDataRespDTO convert02(SysDictDataDO bean); | ||||
|  | ||||
|     List<DictDataRespDTO> convertList03(Collection<SysDictDataDO> list); | ||||
|  | ||||
| } | ||||
| @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.system.convert.logger; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog.LoginLogExcelVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog.LoginLogRespVO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.logger.SysLoginLogDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.logger.SysLoginLogDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import org.mapstruct.Mapper; | ||||
| import org.mapstruct.factory.Mappers; | ||||
|   | ||||
| @@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.system.convert.logger; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog.OperateLogExcelVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog.OperateLogRespVO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.logger.OperateLogDO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.user.SysUserDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.user.UserDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.common.util.collection.MapUtils; | ||||
| import cn.iocoder.yudao.framework.operatelog.core.dto.OperateLogCreateReqDTO; | ||||
| @@ -27,7 +27,7 @@ public interface OperateLogConvert { | ||||
|  | ||||
|     OperateLogRespVO convert(OperateLogDO bean); | ||||
|  | ||||
|     default List<OperateLogExcelVO> convertList(List<OperateLogDO> list, Map<Long, SysUserDO> userMap) { | ||||
|     default List<OperateLogExcelVO> convertList(List<OperateLogDO> list, Map<Long, UserDO> userMap) { | ||||
|         return list.stream().map(operateLog -> { | ||||
|             OperateLogExcelVO excelVO = convert02(operateLog); | ||||
|             MapUtils.findAndThen(userMap, operateLog.getId(), user -> excelVO.setUserNickname(user.getNickname())); | ||||
|   | ||||
| @@ -0,0 +1,15 @@ | ||||
| package cn.iocoder.yudao.module.system.convert.logger; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.logger.SysLoginLogDO; | ||||
| import cn.iocoder.yudao.module.system.service.logger.dto.LoginLogCreateReqDTO; | ||||
| import org.mapstruct.Mapper; | ||||
| import org.mapstruct.factory.Mappers; | ||||
|  | ||||
| @Mapper | ||||
| public interface SysLoginLogCoreConvert { | ||||
|  | ||||
|     SysLoginLogCoreConvert INSTANCE = Mappers.getMapper(SysLoginLogCoreConvert.class); | ||||
|  | ||||
|     SysLoginLogDO convert(LoginLogCreateReqDTO bean); | ||||
|  | ||||
| } | ||||
| @@ -1,7 +1,7 @@ | ||||
| package cn.iocoder.yudao.module.system.convert.permission; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.*; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.permission.SysRoleDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.permission.SysRoleDO; | ||||
| import org.mapstruct.Mapper; | ||||
| import org.mapstruct.factory.Mappers; | ||||
|  | ||||
|   | ||||
| @@ -4,7 +4,7 @@ import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannel | ||||
| import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelRespVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelSimpleRespVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelUpdateReqVO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.sms.SysSmsChannelDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsChannelDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties; | ||||
| import org.mapstruct.Mapper; | ||||
|   | ||||
| @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.system.convert.sms; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogExcelVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SysSmsLogRespVO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.sms.SysSmsLogDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsLogDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import org.mapstruct.Mapper; | ||||
| import org.mapstruct.factory.Mappers; | ||||
|   | ||||
| @@ -4,7 +4,7 @@ import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTempla | ||||
| import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateExcelVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateRespVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateUpdateReqVO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.sms.SysSmsTemplateDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsTemplateDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import org.mapstruct.Mapper; | ||||
| import org.mapstruct.factory.Mappers; | ||||
|   | ||||
| @@ -4,7 +4,7 @@ import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantCreateReq | ||||
| import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantExcelVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantRespVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantUpdateReqVO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.tenant.SysTenantDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.tenant.SysTenantDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import org.mapstruct.Mapper; | ||||
| import org.mapstruct.factory.Mappers; | ||||
|   | ||||
| @@ -4,11 +4,11 @@ import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfi | ||||
| import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.*; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.dept.SysDeptDO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.dept.SysPostDO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.permission.SysRoleDO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.social.SysSocialUserDO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.user.SysUserDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysPostDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.permission.SysRoleDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.social.SysSocialUserDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.user.UserDO; | ||||
| import org.mapstruct.Mapper; | ||||
| import org.mapstruct.factory.Mappers; | ||||
|  | ||||
| @@ -19,31 +19,31 @@ public interface UserConvert { | ||||
|  | ||||
|     UserConvert INSTANCE = Mappers.getMapper(UserConvert.class); | ||||
|  | ||||
|     UserPageItemRespVO convert(SysUserDO bean); | ||||
|     UserPageItemRespVO convert(UserDO bean); | ||||
|  | ||||
|     UserPageItemRespVO.Dept convert(SysDeptDO bean); | ||||
|  | ||||
|     SysUserDO convert(UserCreateReqVO bean); | ||||
|     UserDO convert(UserCreateReqVO bean); | ||||
|  | ||||
|     SysUserDO convert(UserUpdateReqVO bean); | ||||
|     UserDO convert(UserUpdateReqVO bean); | ||||
|  | ||||
|     UserExcelVO convert02(SysUserDO bean); | ||||
|     UserExcelVO convert02(UserDO bean); | ||||
|  | ||||
|     SysUserDO convert(UserImportExcelVO bean); | ||||
|     UserDO convert(UserImportExcelVO bean); | ||||
|  | ||||
|     UserProfileRespVO convert03(SysUserDO bean); | ||||
|     UserProfileRespVO convert03(UserDO bean); | ||||
|  | ||||
|     List<UserProfileRespVO.Role> convertList(List<SysRoleDO> list); | ||||
|  | ||||
|     UserProfileRespVO.Dept convert02(SysDeptDO bean); | ||||
|  | ||||
|     SysUserDO convert(UserProfileUpdateReqVO bean); | ||||
|     UserDO convert(UserProfileUpdateReqVO bean); | ||||
|  | ||||
|     SysUserDO convert(UserProfileUpdatePasswordReqVO bean); | ||||
|     UserDO convert(UserProfileUpdatePasswordReqVO bean); | ||||
|  | ||||
|     List<UserProfileRespVO.Post> convertList02(List<SysPostDO> list); | ||||
|  | ||||
|     List<UserProfileRespVO.SocialUser> convertList03(List<SysSocialUserDO> list); | ||||
|  | ||||
|     List<UserSimpleRespVO> convertList04(List<SysUserDO> list); | ||||
|     List<UserSimpleRespVO> convertList04(List<UserDO> list); | ||||
| } | ||||
|   | ||||
| @@ -0,0 +1,68 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.dataobject.auth; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | ||||
| import cn.iocoder.yudao.framework.security.core.LoginUser; | ||||
| import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; | ||||
| import com.baomidou.mybatisplus.annotation.IdType; | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.Builder; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
|  | ||||
| import java.util.Date; | ||||
|  | ||||
| /** | ||||
|  * 在线用户表 | ||||
|  * | ||||
|  * 我们已经将 {@link LoginUser} 缓存在 Redis 当中。 | ||||
|  * 这里额外存储在线用户到 MySQL 中,目的是为了方便管理界面可以灵活查询。 | ||||
|  * 同时,通过定时轮询 SysUserSessionDO 表,可以主动删除 Redis 的缓存,因为 Redis 的过期删除是延迟的。 | ||||
|  * | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| @TableName(value = "sys_user_session", autoResultMap = true) | ||||
| @Data | ||||
| @Builder | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysUserSessionDO extends TenantBaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 会话编号, 即 sessionId | ||||
|      */ | ||||
|     @TableId(type = IdType.INPUT) | ||||
|     private String id; | ||||
|     /** | ||||
|      * 用户编号 | ||||
|      * | ||||
|      * 关联 SysUserDO.id 或者 MbrUserDO.id | ||||
|      */ | ||||
|     private Long userId; | ||||
|     /** | ||||
|      * 用户类型 | ||||
|      * | ||||
|      * 枚举 {@link UserTypeEnum} | ||||
|      */ | ||||
|     private Integer userType; | ||||
|  | ||||
|     /** | ||||
|      * 用户账号 | ||||
|      * | ||||
|      * 冗余,因为账号可以变更 | ||||
|      */ | ||||
|     private String username; | ||||
|  | ||||
|     /** | ||||
|      * 用户 IP | ||||
|      */ | ||||
|     private String userIp; | ||||
|     /** | ||||
|      * 浏览器 UA | ||||
|      */ | ||||
|     private String userAgent; | ||||
|     /** | ||||
|      * 会话超时时间 | ||||
|      */ | ||||
|     private Date sessionTimeout; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,62 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.dataobject.dept; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.user.UserDO; | ||||
| import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | ||||
| import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
|  | ||||
| /** | ||||
|  * 部门表 | ||||
|  * | ||||
|  * @author ruoyi | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| @TableName("sys_dept") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysDeptDO extends TenantBaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 部门ID | ||||
|      */ | ||||
|     @TableId | ||||
|     private Long id; | ||||
|     /** | ||||
|      * 部门名称 | ||||
|      */ | ||||
|     private String name; | ||||
|     /** | ||||
|      * 父部门ID | ||||
|      * | ||||
|      * 关联 {@link #id} | ||||
|      */ | ||||
|     private Long parentId; | ||||
|     /** | ||||
|      * 显示顺序 | ||||
|      */ | ||||
|     private Integer sort; | ||||
|     /** | ||||
|      * 负责人 | ||||
|      * | ||||
|      * 关联 {@link UserDO#getId()} | ||||
|      */ | ||||
|     private Long leaderUserId; | ||||
|     /** | ||||
|      * 联系电话 | ||||
|      */ | ||||
|     private String phone; | ||||
|     /** | ||||
|      * 邮箱 | ||||
|      */ | ||||
|     private String email; | ||||
|     /** | ||||
|      * 部门状态 | ||||
|      * | ||||
|      * 枚举 {@link CommonStatusEnum} | ||||
|      */ | ||||
|     private Integer status; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,48 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.dataobject.dept; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | ||||
| import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
|  | ||||
| /** | ||||
|  * 岗位表 | ||||
|  * | ||||
|  * @author ruoyi | ||||
|  */ | ||||
| @TableName("sys_post") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysPostDO extends TenantBaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 岗位序号 | ||||
|      */ | ||||
|     @TableId | ||||
|     private Long id; | ||||
|     /** | ||||
|      * 岗位名称 | ||||
|      */ | ||||
|     private String name; | ||||
|     /** | ||||
|      * 岗位编码 | ||||
|      */ | ||||
|     private String code; | ||||
|     /** | ||||
|      * 岗位排序 | ||||
|      */ | ||||
|     private Integer sort; | ||||
|     /** | ||||
|      * 状态 | ||||
|      * | ||||
|      * 枚举 {@link CommonStatusEnum} | ||||
|      */ | ||||
|     private Integer status; | ||||
|     /** | ||||
|      * 备注 | ||||
|      */ | ||||
|     private String remark; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,54 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.dataobject.dict; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
|  | ||||
| /** | ||||
|  * 字典数据表 | ||||
|  * | ||||
|  * @author ruoyi | ||||
|  */ | ||||
| @TableName("sys_dict_data") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysDictDataDO extends BaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 字典数据编号 | ||||
|      */ | ||||
|     @TableId | ||||
|     private Long id; | ||||
|     /** | ||||
|      * 字典排序 | ||||
|      */ | ||||
|     private Integer sort; | ||||
|     /** | ||||
|      * 字典标签 | ||||
|      */ | ||||
|     private String label; | ||||
|     /** | ||||
|      * 字典值 | ||||
|      */ | ||||
|     private String value; | ||||
|     /** | ||||
|      * 字典类型 | ||||
|      * | ||||
|      * 冗余 {@link SysDictDataDO#getDictType()} | ||||
|      */ | ||||
|     private String dictType; | ||||
|     /** | ||||
|      * 状态 | ||||
|      * | ||||
|      * 枚举 {@link CommonStatusEnum} | ||||
|      */ | ||||
|     private Integer status; | ||||
|     /** | ||||
|      * 备注 | ||||
|      */ | ||||
|     private String remark; | ||||
|  | ||||
| } | ||||
| @@ -1,6 +1,6 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.dataobject.logger; | ||||
|  | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.user.SysUserDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.user.UserDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum; | ||||
| import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; | ||||
| @@ -48,7 +48,7 @@ public class OperateLogDO extends TenantBaseDO { | ||||
|     /** | ||||
|      * 用户编号 | ||||
|      * | ||||
|      * {@link SysUserDO#getId()} | ||||
|      * {@link UserDO#getId()} | ||||
|      */ | ||||
|     private Long userId; | ||||
|     /** | ||||
|   | ||||
| @@ -0,0 +1,70 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.dataobject.logger; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| import cn.iocoder.yudao.module.system.enums.logger.SysLoginLogTypeEnum; | ||||
| import cn.iocoder.yudao.module.system.enums.logger.SysLoginResultEnum; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
|  | ||||
| /** | ||||
|  * 登录日志表 | ||||
|  * | ||||
|  * 注意,包括登录和登出两种行为 | ||||
|  * | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| @TableName("sys_login_log") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class SysLoginLogDO extends BaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 日志主键 | ||||
|      */ | ||||
|     private Long id; | ||||
|     /** | ||||
|      * 日志类型 | ||||
|      * | ||||
|      * 枚举 {@link SysLoginLogTypeEnum} | ||||
|      */ | ||||
|     private Integer logType; | ||||
|     /** | ||||
|      * 链路追踪编号 | ||||
|      */ | ||||
|     private String traceId; | ||||
|     /** | ||||
|      * 用户编号 | ||||
|      */ | ||||
|     private Long userId; | ||||
|     /** | ||||
|      * 用户类型 | ||||
|      * | ||||
|      * 枚举 {@link UserTypeEnum} | ||||
|      */ | ||||
|     private Integer userType; | ||||
|     /** | ||||
|      * 用户账号 | ||||
|      * | ||||
|      * 冗余,因为账号可以变更 | ||||
|      */ | ||||
|     private String username; | ||||
|     /** | ||||
|      * 登录结果 | ||||
|      * | ||||
|      * 枚举 {@link SysLoginResultEnum} | ||||
|      */ | ||||
|     private Integer result; | ||||
|     /** | ||||
|      * 用户 IP | ||||
|      */ | ||||
|     private String userIp; | ||||
|     /** | ||||
|      * 浏览器 UA | ||||
|      */ | ||||
|     private String userAgent; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.dataobject; | ||||
| @@ -0,0 +1,75 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.dataobject.permission; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.type.JsonLongSetTypeHandler; | ||||
| import cn.iocoder.yudao.framework.security.core.enums.DataScopeEnum; | ||||
| import com.baomidou.mybatisplus.annotation.TableField; | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
|  | ||||
| import java.util.Set; | ||||
|  | ||||
| /** | ||||
|  * 角色 DO | ||||
|  * | ||||
|  * @author ruoyi | ||||
|  */ | ||||
| @TableName(value = "sys_role", autoResultMap = true) | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysRoleDO extends BaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 角色ID | ||||
|      */ | ||||
|     @TableId | ||||
|     private Long id; | ||||
|     /** | ||||
|      * 角色名称 | ||||
|      */ | ||||
|     private String name; | ||||
|     /** | ||||
|      * 角色标识 | ||||
|      * | ||||
|      * 枚举 | ||||
|      */ | ||||
|     private String code; | ||||
|     /** | ||||
|      * 角色排序 | ||||
|      */ | ||||
|     private Integer sort; | ||||
|     /** | ||||
|      * 角色状态 | ||||
|      * | ||||
|      * 枚举 {@link CommonStatusEnum} | ||||
|      */ | ||||
|     private Integer status; | ||||
|     /** | ||||
|      * 角色类型 | ||||
|      * | ||||
|      * 枚举 | ||||
|      */ | ||||
|     private Integer type; | ||||
|     /** | ||||
|      * 备注 | ||||
|      */ | ||||
|     private String remark; | ||||
|  | ||||
|     /** | ||||
|      * 数据范围 | ||||
|      * | ||||
|      * 枚举 {@link DataScopeEnum} | ||||
|      */ | ||||
|     private Integer dataScope; | ||||
|     /** | ||||
|      * 数据范围(指定部门数组) | ||||
|      * | ||||
|      * 适用于 {@link #dataScope} 的值为 {@link DataScopeEnum#DEPT_CUSTOM} 时 | ||||
|      */ | ||||
|     @TableField(typeHandler = JsonLongSetTypeHandler.class) | ||||
|     private Set<Long> dataScopeDeptIds; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,33 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.dataobject.permission; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
|  | ||||
| /** | ||||
|  * 用户和角色关联 | ||||
|  * | ||||
|  * @author ruoyi | ||||
|  */ | ||||
| @TableName("sys_user_role") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SysUserRoleDO extends BaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 自增主键 | ||||
|      */ | ||||
|     @TableId | ||||
|     private Long id; | ||||
|     /** | ||||
|      * 用户 ID | ||||
|      */ | ||||
|     private Long userId; | ||||
|     /** | ||||
|      * 角色 ID | ||||
|      */ | ||||
|     private Long roleId; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,60 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.dataobject.sms; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| import cn.iocoder.yudao.framework.sms.core.enums.SmsChannelEnum; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
|  | ||||
| /** | ||||
|  * 短信渠道 DO | ||||
|  * | ||||
|  * @author zzf | ||||
|  * @since 2021-01-25 | ||||
|  */ | ||||
| @TableName(value = "sys_sms_channel", autoResultMap = true) | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class SysSmsChannelDO extends BaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 渠道编号 | ||||
|      */ | ||||
|     private Long id; | ||||
|     /** | ||||
|      * 短信签名 | ||||
|      */ | ||||
|     private String signature; | ||||
|     /** | ||||
|      * 渠道编码 | ||||
|      * | ||||
|      * 枚举 {@link SmsChannelEnum} | ||||
|      */ | ||||
|     private String code; | ||||
|     /** | ||||
|      * 启用状态 | ||||
|      * | ||||
|      * 枚举 {@link CommonStatusEnum} | ||||
|      */ | ||||
|     private Integer status; | ||||
|     /** | ||||
|      * 备注 | ||||
|      */ | ||||
|     private String remark; | ||||
|     /** | ||||
|      * 短信 API 的账号 | ||||
|      */ | ||||
|     private String apiKey; | ||||
|     /** | ||||
|      * 短信 API 的秘钥 | ||||
|      */ | ||||
|     private String apiSecret; | ||||
|     /** | ||||
|      * 短信发送回调 URL | ||||
|      */ | ||||
|     private String callbackUrl; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,173 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.dataobject.sms; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.enums.sms.SysSmsReceiveStatusEnum; | ||||
| import cn.iocoder.yudao.module.system.enums.sms.SysSmsSendStatusEnum; | ||||
| import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| import cn.iocoder.yudao.framework.sms.core.enums.SmsFrameworkErrorCodeConstants; | ||||
| import com.baomidou.mybatisplus.annotation.TableField; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; | ||||
| import lombok.*; | ||||
|  | ||||
| import java.util.Date; | ||||
| import java.util.Map; | ||||
|  | ||||
| /** | ||||
|  * 短信日志 DO | ||||
|  * | ||||
|  * @author zzf | ||||
|  * @since 2021-01-25 | ||||
|  */ | ||||
| @TableName(value = "sys_sms_log", autoResultMap = true) | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| @Builder | ||||
| @AllArgsConstructor | ||||
| @NoArgsConstructor | ||||
| public class SysSmsLogDO extends BaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 自增编号 | ||||
|      */ | ||||
|     private Long id; | ||||
|  | ||||
|     // ========= 渠道相关字段 ========= | ||||
|  | ||||
|     /** | ||||
|      * 短信渠道编号 | ||||
|      * | ||||
|      * 关联 {@link SysSmsChannelDO#getId()} | ||||
|      */ | ||||
|     private Long channelId; | ||||
|     /** | ||||
|      * 短信渠道编码 | ||||
|      * | ||||
|      * 冗余 {@link SysSmsChannelDO#getCode()} | ||||
|      */ | ||||
|     private String channelCode; | ||||
|  | ||||
|     // ========= 模板相关字段 ========= | ||||
|  | ||||
|     /** | ||||
|      * 模板编号 | ||||
|      * | ||||
|      * 关联 {@link SysSmsTemplateDO#getId()} | ||||
|      */ | ||||
|     private Long templateId; | ||||
|     /** | ||||
|      * 模板编码 | ||||
|      * | ||||
|      * 冗余 {@link SysSmsTemplateDO#getCode()} | ||||
|      */ | ||||
|     private String templateCode; | ||||
|     /** | ||||
|      * 短信类型 | ||||
|      * | ||||
|      * 冗余 {@link SysSmsTemplateDO#getType()} | ||||
|      */ | ||||
|     private Integer templateType; | ||||
|     /** | ||||
|      * 基于 {@link SysSmsTemplateDO#getContent()} 格式化后的内容 | ||||
|      */ | ||||
|     private String templateContent; | ||||
|     /** | ||||
|      * 基于 {@link SysSmsTemplateDO#getParams()} 输入后的参数 | ||||
|      */ | ||||
|     @TableField(typeHandler = JacksonTypeHandler.class) | ||||
|     private Map<String, Object> templateParams; | ||||
|     /** | ||||
|      * 短信 API 的模板编号 | ||||
|      * | ||||
|      * 冗余 {@link SysSmsTemplateDO#getApiTemplateId()} | ||||
|      */ | ||||
|     private String apiTemplateId; | ||||
|  | ||||
|     // ========= 手机相关字段 ========= | ||||
|  | ||||
|     /** | ||||
|      * 手机号 | ||||
|      */ | ||||
|     private String mobile; | ||||
|     /** | ||||
|      * 用户编号 | ||||
|      */ | ||||
|     private Long userId; | ||||
|     /** | ||||
|      * 用户类型 | ||||
|      * | ||||
|      * 枚举 {@link UserTypeEnum} | ||||
|      */ | ||||
|     private Integer userType; | ||||
|  | ||||
|     // ========= 发送相关字段 ========= | ||||
|  | ||||
|     /** | ||||
|      * 发送状态 | ||||
|      * | ||||
|      * 枚举 {@link SysSmsSendStatusEnum} | ||||
|      */ | ||||
|     private Integer sendStatus; | ||||
|     /** | ||||
|      * 发送时间 | ||||
|      */ | ||||
|     private Date sendTime; | ||||
|     /** | ||||
|      * 发送结果的编码 | ||||
|      * | ||||
|      * 枚举 {@link SmsFrameworkErrorCodeConstants} | ||||
|      */ | ||||
|     private Integer sendCode; | ||||
|     /** | ||||
|      * 发送结果的提示 | ||||
|      * | ||||
|      * 一般情况下,使用 {@link SmsFrameworkErrorCodeConstants} | ||||
|      * 异常情况下,通过格式化 Exception 的提示存储 | ||||
|      */ | ||||
|     private String sendMsg; | ||||
|     /** | ||||
|      * 短信 API 发送结果的编码 | ||||
|      * | ||||
|      * 由于第三方的错误码可能是字符串,所以使用 String 类型 | ||||
|      */ | ||||
|     private String apiSendCode; | ||||
|     /** | ||||
|      * 短信 API 发送失败的提示 | ||||
|      */ | ||||
|     private String apiSendMsg; | ||||
|     /** | ||||
|      * 短信 API 发送返回的唯一请求 ID | ||||
|      * | ||||
|      * 用于和短信 API 进行定位于排错 | ||||
|      */ | ||||
|     private String apiRequestId; | ||||
|     /** | ||||
|      * 短信 API 发送返回的序号 | ||||
|      * | ||||
|      * 用于和短信 API 平台的发送记录关联 | ||||
|      */ | ||||
|     private String apiSerialNo; | ||||
|  | ||||
|     // ========= 接收相关字段 ========= | ||||
|  | ||||
|     /** | ||||
|      * 接收状态 | ||||
|      * | ||||
|      * 枚举 {@link SysSmsReceiveStatusEnum} | ||||
|      */ | ||||
|     private Integer receiveStatus; | ||||
|     /** | ||||
|      * 接收时间 | ||||
|      */ | ||||
|     private Date receiveTime; | ||||
|     /** | ||||
|      * 短信 API 接收结果的编码 | ||||
|      */ | ||||
|     private String apiReceiveCode; | ||||
|     /** | ||||
|      * 短信 API 接收结果的提示 | ||||
|      */ | ||||
|     private String apiReceiveMsg; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,89 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.dataobject.sms; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.enums.sms.SysSmsTemplateTypeEnum; | ||||
| import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| import com.baomidou.mybatisplus.annotation.TableField; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
|  | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|  * 短信模板 DO | ||||
|  * | ||||
|  * @author zzf | ||||
|  * @since 2021-01-25 | ||||
|  */ | ||||
| @TableName(value = "sys_sms_template", autoResultMap = true) | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class SysSmsTemplateDO extends BaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 自增编号 | ||||
|      */ | ||||
|     private Long id; | ||||
|  | ||||
|     // ========= 模板相关字段 ========= | ||||
|  | ||||
|     /** | ||||
|      * 短信类型 | ||||
|      * | ||||
|      * 枚举 {@link SysSmsTemplateTypeEnum} | ||||
|      */ | ||||
|     private Integer type; | ||||
|     /** | ||||
|      * 启用状态 | ||||
|      * | ||||
|      * 枚举 {@link CommonStatusEnum} | ||||
|      */ | ||||
|     private Integer status; | ||||
|     /** | ||||
|      * 模板编码,保证唯一 | ||||
|      */ | ||||
|     private String code; | ||||
|     /** | ||||
|      * 模板名称 | ||||
|      */ | ||||
|     private String name; | ||||
|     /** | ||||
|      * 模板内容 | ||||
|      * | ||||
|      * 内容的参数,使用 {} 包括,例如说 {name} | ||||
|      */ | ||||
|     private String content; | ||||
|     /** | ||||
|      * 参数数组(自动根据内容生成) | ||||
|      */ | ||||
|     @TableField(typeHandler = JacksonTypeHandler.class) | ||||
|     private List<String> params; | ||||
|     /** | ||||
|      * 备注 | ||||
|      */ | ||||
|     private String remark; | ||||
|     /** | ||||
|      * 短信 API 的模板编号 | ||||
|      */ | ||||
|     private String apiTemplateId; | ||||
|  | ||||
|     // ========= 渠道相关字段 ========= | ||||
|  | ||||
|     /** | ||||
|      * 短信渠道编号 | ||||
|      * | ||||
|      * 关联 {@link SysSmsChannelDO#getId()} | ||||
|      */ | ||||
|     private Long channelId; | ||||
|     /** | ||||
|      * 短信渠道编码 | ||||
|      * | ||||
|      * 冗余 {@link SysSmsChannelDO#getCode()} | ||||
|      */ | ||||
|     private String channelCode; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,82 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.dataobject.social; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.user.UserDO; | ||||
| import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.*; | ||||
|  | ||||
| /** | ||||
|  * 社交用户 | ||||
|  * 通过 {@link SysSocialUserDO#getUserId()} 关联到对应的 {@link UserDO} | ||||
|  * | ||||
|  * @author weir | ||||
|  */ | ||||
| @TableName(value = "sys_social_user", autoResultMap = true) | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @Builder | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class SysSocialUserDO extends BaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 自增主键 | ||||
|      */ | ||||
|     @TableId | ||||
|     private Long id; | ||||
|     /** | ||||
|      * 关联的用户编号 | ||||
|      */ | ||||
|     private Long userId; | ||||
|     /** | ||||
|      * 用户类型 | ||||
|      * | ||||
|      * 枚举 {@link UserTypeEnum} | ||||
|      */ | ||||
|     private Integer userType; | ||||
|  | ||||
|     /** | ||||
|      * 社交平台的类型 | ||||
|      * | ||||
|      * 枚举 {@link UserTypeEnum} | ||||
|      */ | ||||
|     private Integer type; | ||||
|  | ||||
|     /** | ||||
|      * 社交 openid | ||||
|      */ | ||||
|     private String openid; | ||||
|     /** | ||||
|      * 社交 token | ||||
|      */ | ||||
|     private String token; | ||||
|     /** | ||||
|      * 社交的全局编号 | ||||
|      * | ||||
|      * 例如说,微信平台的 https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html | ||||
|      * 如果没有 unionId 的平台,直接使用 openid 作为该字段的值 | ||||
|      */ | ||||
|     private String unionId; | ||||
|     /** | ||||
|      * 原始 Token 数据,一般是 JSON 格式 | ||||
|      */ | ||||
|     private String rawTokenInfo; | ||||
|  | ||||
|     /** | ||||
|      * 用户昵称 | ||||
|      */ | ||||
|     private String nickname; | ||||
|     /** | ||||
|      * 用户头像 | ||||
|      */ | ||||
|     private String avatar; | ||||
|     /** | ||||
|      * 原始用户数据,一般是 JSON 格式 | ||||
|      */ | ||||
|     private String rawUserInfo; | ||||
|  | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,45 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.dataobject.tenant; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.*; | ||||
|  | ||||
| /** | ||||
|  * 租户 DO | ||||
|  * | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| @TableName(value = "sys_tenant", autoResultMap = true) | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| @Builder | ||||
| @AllArgsConstructor | ||||
| @NoArgsConstructor | ||||
| public class SysTenantDO extends BaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 租户编号,自增 | ||||
|      */ | ||||
|     private Long id; | ||||
|     /** | ||||
|      * 租户名,唯一 | ||||
|      */ | ||||
|     private String name; | ||||
|     /** | ||||
|      * 联系人 | ||||
|      */ | ||||
|     private String contactName; | ||||
|     /** | ||||
|      * 联系手机 | ||||
|      */ | ||||
|     private String contactMobile; | ||||
|     /** | ||||
|      * 帐号状态 | ||||
|      * | ||||
|      * 枚举 {@link CommonStatusEnum} | ||||
|      */ | ||||
|     private Integer status; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,94 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.dataobject.user; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.enums.common.SysSexEnum; | ||||
| import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.type.JsonLongSetTypeHandler; | ||||
| import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; | ||||
| import com.baomidou.mybatisplus.annotation.TableField; | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.*; | ||||
| import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; | ||||
|  | ||||
| import java.util.Date; | ||||
| import java.util.Set; | ||||
|  | ||||
| /** | ||||
|  * 管理后台的用户 DO | ||||
|  * | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| @TableName(value = "sys_user", autoResultMap = true) | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @Builder | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class UserDO extends TenantBaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 用户ID | ||||
|      */ | ||||
|     @TableId | ||||
|     private Long id; | ||||
|     /** | ||||
|      * 用户账号 | ||||
|      */ | ||||
|     private String username; | ||||
|     /** | ||||
|      * 加密后的密码 | ||||
|      * | ||||
|      * 因为目前使用 {@link BCryptPasswordEncoder} 加密器,所以无需自己处理 salt 盐 | ||||
|      */ | ||||
|     private String password; | ||||
|     /** | ||||
|      * 用户昵称 | ||||
|      */ | ||||
|     private String nickname; | ||||
|     /** | ||||
|      * 备注 | ||||
|      */ | ||||
|     private String remark; | ||||
|     /** | ||||
|      * 部门ID | ||||
|      */ | ||||
|     private Long deptId; | ||||
|     /** | ||||
|      * 岗位编号数组 | ||||
|      */ | ||||
|     @TableField(typeHandler = JsonLongSetTypeHandler.class) | ||||
|     private Set<Long> postIds; | ||||
|     /** | ||||
|      * 用户邮箱 | ||||
|      */ | ||||
|     private String email; | ||||
|     /** | ||||
|      * 手机号码 | ||||
|      */ | ||||
|     private String mobile; | ||||
|     /** | ||||
|      * 用户性别 | ||||
|      * | ||||
|      * 枚举类 {@link SysSexEnum} | ||||
|      */ | ||||
|     private Integer sex; | ||||
|     /** | ||||
|      * 用户头像 | ||||
|      */ | ||||
|     private String avatar; | ||||
|     /** | ||||
|      * 帐号状态 | ||||
|      * | ||||
|      * 枚举 {@link CommonStatusEnum} | ||||
|      */ | ||||
|     private Integer status; | ||||
|     /** | ||||
|      * 最后登录IP | ||||
|      */ | ||||
|     private String loginIp; | ||||
|     /** | ||||
|      * 最后登录时间 | ||||
|      */ | ||||
|     private Date loginDate; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,10 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.mysql.auth; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.auth.SysUserSessionDO; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
|  | ||||
| @Mapper | ||||
| public interface SysUserSessionCoreMapper extends BaseMapperX<SysUserSessionDO> { | ||||
|  | ||||
| } | ||||
| @@ -1,7 +1,7 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.mysql.auth; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.controller.admin.auth.vo.session.UserSessionPageReqVO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.auth.SysUserSessionDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.auth.SysUserSessionDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; | ||||
|   | ||||
| @@ -0,0 +1,9 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.mysql.dept; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
|  | ||||
| @Mapper | ||||
| public interface SysDeptCoreMapper extends BaseMapperX<SysDeptDO> { | ||||
| } | ||||
| @@ -4,7 +4,7 @@ import cn.iocoder.yudao.framework.mybatis.core.enums.SqlConstants; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.dept.SysDeptDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; | ||||
| import com.baomidou.mybatisplus.annotation.InterceptorIgnore; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
|   | ||||
| @@ -0,0 +1,9 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.mysql.dept; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysPostDO; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
|  | ||||
| @Mapper | ||||
| public interface SysPostCoreMapper extends BaseMapperX<SysPostDO> { | ||||
| } | ||||
| @@ -5,7 +5,7 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostExportReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostPageReqVO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.dept.SysPostDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysPostDO; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
|  | ||||
|   | ||||
| @@ -3,11 +3,12 @@ package cn.iocoder.yudao.module.system.dal.mysql.dict; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.enums.SqlConstants; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataExportReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataPageReqVO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.dict.SysDictDataDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.dict.SysDictDataDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
|  | ||||
| import java.util.Arrays; | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.mysql.logger; | ||||
|  | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.logger.SysLoginLogDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.logger.SysLoginLogDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; | ||||
|   | ||||
| @@ -0,0 +1,10 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.mysql.logger; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.logger.SysLoginLogDO; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
|  | ||||
| @Mapper | ||||
| public interface SysLoginLogCoreMapper extends BaseMapperX<SysLoginLogDO> { | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.mysql; | ||||
| @@ -0,0 +1,9 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.mysql.permission; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.permission.SysRoleDO; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
|  | ||||
| @Mapper | ||||
| public interface SysRoleCoreMapper extends BaseMapperX<SysRoleDO> { | ||||
| } | ||||
| @@ -5,7 +5,7 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleExportReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RolePageReqVO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.permission.SysRoleDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.permission.SysRoleDO; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
| import org.springframework.lang.Nullable; | ||||
|   | ||||
| @@ -0,0 +1,17 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.mysql.permission; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.permission.SysUserRoleDO; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
|  | ||||
| import java.util.Collection; | ||||
| import java.util.List; | ||||
|  | ||||
| @Mapper | ||||
| public interface SysUserRoleCoreMapper extends BaseMapperX<SysUserRoleDO>  { | ||||
|  | ||||
|     default List<SysUserRoleDO> selectListByRoleIds(Collection<Long> roleIds) { | ||||
|         return selectList(SysUserRoleDO::getRoleId, roleIds); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -1,7 +1,7 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.mysql.permission; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.permission.SysUserRoleDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.permission.SysUserRoleDO; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
|  | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.mysql.sms; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelPageReqVO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.sms.SysSmsChannelDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsChannelDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; | ||||
|   | ||||
| @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.system.dal.mysql.sms; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogExportReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogPageReqVO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.sms.SysSmsLogDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsLogDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; | ||||
|   | ||||
| @@ -1,23 +1,27 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.mysql.sms; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateExportReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplatePageReqVO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.sms.SysSmsTemplateDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsTemplateDO; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
| import org.apache.ibatis.annotations.Select; | ||||
|  | ||||
| import java.util.Date; | ||||
| import java.util.List; | ||||
|  | ||||
| @Mapper | ||||
| public interface SysSmsTemplateMapper extends BaseMapperX<SysSmsTemplateDO> { | ||||
|  | ||||
|     @Select("SELECT id FROM sys_sms_template WHERE update_time > #{maxUpdateTime} LIMIT 1") | ||||
|     Long selectExistsByUpdateTimeAfter(Date maxUpdateTime); | ||||
|  | ||||
|     default SysSmsTemplateDO selectByCode(String code) { | ||||
|         return selectOne(SysSmsTemplateDO::getCode, code); | ||||
|     } | ||||
|  | ||||
|     // TODO 这种参数都一样的得想办法封装一下 | ||||
|     default PageResult<SysSmsTemplateDO> selectPage(SmsTemplatePageReqVO reqVO) { | ||||
|         return selectPage(reqVO, new LambdaQueryWrapperX<SysSmsTemplateDO>() | ||||
|                 .eqIfPresent(SysSmsTemplateDO::getType, reqVO.getType()) | ||||
|   | ||||
| @@ -0,0 +1,28 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.mysql.social; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.social.SysSocialUserDO; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
|  | ||||
| import java.util.Collection; | ||||
| import java.util.List; | ||||
|  | ||||
| @Mapper | ||||
| public interface SysSocialUserMapper extends BaseMapperX<SysSocialUserDO> { | ||||
|  | ||||
|     default List<SysSocialUserDO> selectListByTypeAndUnionId(Integer userType, Collection<Integer> types, String unionId) { | ||||
|         return selectList(new QueryWrapper<SysSocialUserDO>().eq("user_type", userType) | ||||
|                 .in("type", types).eq("union_id", unionId)); | ||||
|     } | ||||
|  | ||||
|     default List<SysSocialUserDO> selectListByTypeAndUserId(Integer userType, Collection<Integer> types, Long userId) { | ||||
|         return selectList(new QueryWrapper<SysSocialUserDO>().eq("user_type", userType) | ||||
|                 .in("type", types).eq("user_id", userId)); | ||||
|     } | ||||
|  | ||||
|     default List<SysSocialUserDO> selectListByUserId(Integer userType, Long userId) { | ||||
|         return selectList(new QueryWrapper<SysSocialUserDO>().eq("user_type", userType).eq("user_id", userId)); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,9 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.mysql.tenant; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.tenant.SysTenantDO; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
|  | ||||
| @Mapper | ||||
| public interface SysTenantCoreMapper extends BaseMapperX<SysTenantDO> { | ||||
| } | ||||
| @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.system.dal.mysql.tenant; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantExportReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantPageReqVO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.tenant.SysTenantDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.tenant.SysTenantDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | ||||
|   | ||||
| @@ -1,77 +0,0 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.mysql.user; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserExportReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserPageReqVO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.user.SysUserDO; | ||||
| import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
| import jodd.util.StringPool; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
|  | ||||
| import java.util.Collection; | ||||
| import java.util.List; | ||||
| import java.util.Optional; | ||||
|  | ||||
| @Mapper | ||||
| public interface SysUserMapper extends BaseMapperX<SysUserDO> { | ||||
|  | ||||
|     default SysUserDO selectByUsername(String username) { | ||||
|         return selectOne(new LambdaQueryWrapper<SysUserDO>().eq(SysUserDO::getUsername, username)); | ||||
|     } | ||||
|  | ||||
|     default SysUserDO selectByEmail(String email) { | ||||
|         return selectOne(new LambdaQueryWrapper<SysUserDO>().eq(SysUserDO::getEmail, email)); | ||||
|     } | ||||
|  | ||||
|     default SysUserDO selectByMobile(String mobile) { | ||||
|         return selectOne(new LambdaQueryWrapper<SysUserDO>().eq(SysUserDO::getMobile, mobile)); | ||||
|     } | ||||
|  | ||||
|     default PageResult<SysUserDO> selectPage(UserPageReqVO reqVO, Collection<Long> deptIds) { | ||||
|         return selectPage(reqVO, new LambdaQueryWrapperX<SysUserDO>() | ||||
|                 .likeIfPresent(SysUserDO::getUsername, reqVO.getUsername()) | ||||
|                 .likeIfPresent(SysUserDO::getMobile, reqVO.getMobile()) | ||||
|                 .eqIfPresent(SysUserDO::getStatus, reqVO.getStatus()) | ||||
|                 .betweenIfPresent(SysUserDO::getCreateTime, reqVO.getBeginTime(), reqVO.getEndTime()) | ||||
|                 .inIfPresent(SysUserDO::getDeptId, deptIds)); | ||||
|     } | ||||
|  | ||||
|     default List<SysUserDO> selectList(UserExportReqVO reqVO, Collection<Long> deptIds) { | ||||
|         return selectList(new LambdaQueryWrapperX<SysUserDO>() | ||||
|                 .likeIfPresent(SysUserDO::getUsername, reqVO.getUsername()) | ||||
|                 .likeIfPresent(SysUserDO::getMobile, reqVO.getMobile()) | ||||
|                 .eqIfPresent(SysUserDO::getStatus, reqVO.getStatus()) | ||||
|                 .betweenIfPresent(SysUserDO::getCreateTime, reqVO.getBeginTime(), reqVO.getEndTime()) | ||||
|                 .inIfPresent(SysUserDO::getDeptId, deptIds)); | ||||
|     } | ||||
|  | ||||
|     default List<SysUserDO> selectListByNickname(String nickname) { | ||||
|         return selectList(new LambdaQueryWrapperX<SysUserDO>().like(SysUserDO::getNickname, nickname)); | ||||
|     } | ||||
|  | ||||
|     default List<SysUserDO> selectListByUsername(String username) { | ||||
|         return selectList(new LambdaQueryWrapperX<SysUserDO>().like(SysUserDO::getUsername, username)); | ||||
|     } | ||||
|  | ||||
|     // TODO 芋艿:可废弃该方法 | ||||
|     default List<SysUserDO> selectListByDepartIdAndPostId(Long departId, Long postId) { | ||||
|         return selectList(new LambdaQueryWrapperX<SysUserDO>() | ||||
|                 .eq(SysUserDO::getStatus, CommonStatusEnum.ENABLE.getStatus()) | ||||
|                 .eq(SysUserDO::getDeptId, departId) | ||||
|                 // TODO @jason: 封装一个 StringUtils .toString 。如果空的时候,设置为 null。会更简洁 | ||||
|                 .likeIfPresent(SysUserDO::getPostIds, Optional.ofNullable(postId).map(t -> String.valueOf(postId)).orElse(StringPool.EMPTY))); | ||||
|     } | ||||
|  | ||||
|     default List<SysUserDO> selectListByStatus(Integer status) { | ||||
|         return selectList(SysUserDO::getStatus, status); | ||||
|     } | ||||
|  | ||||
|     default List<SysUserDO> selectListByDeptIds(Collection<Long> deptIds) { | ||||
|         return selectList(SysUserDO::getDeptId, deptIds); | ||||
|     } | ||||
|  | ||||
| } | ||||
|  | ||||
| @@ -0,0 +1,68 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.mysql.user; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserExportReqVO; | ||||
| import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserPageReqVO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.user.UserDO; | ||||
| import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
| import jodd.util.StringPool; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
|  | ||||
| import java.util.Collection; | ||||
| import java.util.List; | ||||
| import java.util.Optional; | ||||
|  | ||||
| @Mapper | ||||
| public interface UserMapper extends BaseMapperX<UserDO> { | ||||
|  | ||||
|     default UserDO selectByUsername(String username) { | ||||
|         return selectOne(new LambdaQueryWrapper<UserDO>().eq(UserDO::getUsername, username)); | ||||
|     } | ||||
|  | ||||
|     default UserDO selectByEmail(String email) { | ||||
|         return selectOne(new LambdaQueryWrapper<UserDO>().eq(UserDO::getEmail, email)); | ||||
|     } | ||||
|  | ||||
|     default UserDO selectByMobile(String mobile) { | ||||
|         return selectOne(new LambdaQueryWrapper<UserDO>().eq(UserDO::getMobile, mobile)); | ||||
|     } | ||||
|  | ||||
|     default PageResult<UserDO> selectPage(UserPageReqVO reqVO, Collection<Long> deptIds) { | ||||
|         return selectPage(reqVO, new LambdaQueryWrapperX<UserDO>() | ||||
|                 .likeIfPresent(UserDO::getUsername, reqVO.getUsername()) | ||||
|                 .likeIfPresent(UserDO::getMobile, reqVO.getMobile()) | ||||
|                 .eqIfPresent(UserDO::getStatus, reqVO.getStatus()) | ||||
|                 .betweenIfPresent(UserDO::getCreateTime, reqVO.getBeginTime(), reqVO.getEndTime()) | ||||
|                 .inIfPresent(UserDO::getDeptId, deptIds)); | ||||
|     } | ||||
|  | ||||
|     default List<UserDO> selectList(UserExportReqVO reqVO, Collection<Long> deptIds) { | ||||
|         return selectList(new LambdaQueryWrapperX<UserDO>() | ||||
|                 .likeIfPresent(UserDO::getUsername, reqVO.getUsername()) | ||||
|                 .likeIfPresent(UserDO::getMobile, reqVO.getMobile()) | ||||
|                 .eqIfPresent(UserDO::getStatus, reqVO.getStatus()) | ||||
|                 .betweenIfPresent(UserDO::getCreateTime, reqVO.getBeginTime(), reqVO.getEndTime()) | ||||
|                 .inIfPresent(UserDO::getDeptId, deptIds)); | ||||
|     } | ||||
|  | ||||
|     default List<UserDO> selectListByNickname(String nickname) { | ||||
|         return selectList(new LambdaQueryWrapperX<UserDO>().like(UserDO::getNickname, nickname)); | ||||
|     } | ||||
|  | ||||
|     default List<UserDO> selectListByUsername(String username) { | ||||
|         return selectList(new LambdaQueryWrapperX<UserDO>().like(UserDO::getUsername, username)); | ||||
|     } | ||||
|  | ||||
|     default List<UserDO> selectListByStatus(Integer status) { | ||||
|         return selectList(UserDO::getStatus, status); | ||||
|     } | ||||
|  | ||||
|     default List<UserDO> selectListByDeptIds(Collection<Long> deptIds) { | ||||
|         return selectList(UserDO::getDeptId, deptIds); | ||||
|     } | ||||
|  | ||||
| } | ||||
|  | ||||
| @@ -1,6 +1,10 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.redis; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.redis.core.RedisKeyDefine; | ||||
| import cn.iocoder.yudao.framework.security.core.LoginUser; | ||||
| import me.zhyd.oauth.model.AuthUser; | ||||
|  | ||||
| import java.time.Duration; | ||||
|  | ||||
| import static cn.iocoder.yudao.framework.redis.core.RedisKeyDefine.KeyTypeEnum.STRING; | ||||
|  | ||||
| @@ -14,5 +18,17 @@ public interface SysRedisKeyConstants { | ||||
|     RedisKeyDefine CAPTCHA_CODE = new RedisKeyDefine("验证码的缓存", | ||||
|             "captcha_code:%s", // 参数为 uuid | ||||
|             STRING, String.class, RedisKeyDefine.TimeoutTypeEnum.DYNAMIC); | ||||
|  | ||||
|     RedisKeyDefine LOGIN_USER = new RedisKeyDefine("登录用户的缓存", | ||||
|             "login_user:%s", // 参数为 sessionId | ||||
|             STRING, LoginUser.class, RedisKeyDefine.TimeoutTypeEnum.DYNAMIC); | ||||
|  | ||||
|     RedisKeyDefine SOCIAL_AUTH_USER = new RedisKeyDefine("社交登陆的授权用户", | ||||
|             "social_auth_user:%d:%s", // 参数为 type,code | ||||
|             STRING, AuthUser.class, Duration.ofDays(1)); | ||||
|  | ||||
|     RedisKeyDefine SOCIAL_AUTH_STATE = new RedisKeyDefine("社交登陆的 state", | ||||
|             "social_auth_state:%s", // 参数为 state | ||||
|             STRING, String.class, Duration.ofHours(24)); // 值为 state | ||||
|      | ||||
| } | ||||
|   | ||||
| @@ -0,0 +1,18 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.redis; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.redis.core.RedisKeyDefine; | ||||
| import cn.iocoder.yudao.framework.security.core.LoginUser; | ||||
| import me.zhyd.oauth.model.AuthUser; | ||||
|  | ||||
| import java.time.Duration; | ||||
|  | ||||
| import static cn.iocoder.yudao.framework.redis.core.RedisKeyDefine.KeyTypeEnum.STRING; | ||||
|  | ||||
| /** | ||||
|  * System Redis Key 枚举类 | ||||
|  * | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| public interface SysRedisKeyCoreConstants { | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,47 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.redis.auth; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.util.json.JsonUtils; | ||||
| import cn.iocoder.yudao.framework.security.config.SecurityProperties; | ||||
| import cn.iocoder.yudao.framework.security.core.LoginUser; | ||||
| import org.springframework.data.redis.core.StringRedisTemplate; | ||||
| import org.springframework.stereotype.Repository; | ||||
|  | ||||
| import javax.annotation.Resource; | ||||
|  | ||||
| import static cn.iocoder.yudao.module.system.dal.redis.SysRedisKeyConstants.LOGIN_USER; | ||||
|  | ||||
| /** | ||||
|  * {@link LoginUser} 的 RedisDAO | ||||
|  * | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| @Repository | ||||
| public class LoginUserRedisDAO { | ||||
|  | ||||
|     @Resource | ||||
|     private StringRedisTemplate stringRedisTemplate; | ||||
|  | ||||
|     @Resource | ||||
|     private SecurityProperties securityProperties; | ||||
|  | ||||
|     public LoginUser get(String sessionId) { | ||||
|         String redisKey = formatKey(sessionId); | ||||
|         return JsonUtils.parseObject(stringRedisTemplate.opsForValue().get(redisKey), LoginUser.class); | ||||
|     } | ||||
|  | ||||
|     public void set(String sessionId, LoginUser loginUser) { | ||||
|         String redisKey = formatKey(sessionId); | ||||
|         stringRedisTemplate.opsForValue().set(redisKey, JsonUtils.toJsonString(loginUser), | ||||
|                 securityProperties.getSessionTimeout()); | ||||
|     } | ||||
|  | ||||
|     public void delete(String sessionId) { | ||||
|         String redisKey = formatKey(sessionId); | ||||
|         stringRedisTemplate.delete(redisKey); | ||||
|     } | ||||
|  | ||||
|     private static String formatKey(String sessionId) { | ||||
|         return String.format(LOGIN_USER.getKeyTemplate(), sessionId); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,39 @@ | ||||
| package cn.iocoder.yudao.module.system.dal.redis.social; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.util.json.JsonUtils; | ||||
| import me.zhyd.oauth.model.AuthCallback; | ||||
| import me.zhyd.oauth.model.AuthUser; | ||||
| import org.springframework.data.redis.core.StringRedisTemplate; | ||||
| import org.springframework.stereotype.Repository; | ||||
|  | ||||
| import javax.annotation.Resource; | ||||
|  | ||||
| import static cn.iocoder.yudao.module.system.dal.redis.SysRedisKeyConstants.SOCIAL_AUTH_USER; | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * 社交 {@link me.zhyd.oauth.model.AuthUser} 的 RedisDAO | ||||
|  * | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| @Repository | ||||
| public class SocialAuthUserRedisDAO { | ||||
|  | ||||
|     @Resource | ||||
|     private StringRedisTemplate stringRedisTemplate; | ||||
|  | ||||
|     public AuthUser get(Integer type, AuthCallback authCallback) { | ||||
|         String redisKey = formatKey(type, authCallback.getCode()); | ||||
|         return JsonUtils.parseObject(stringRedisTemplate.opsForValue().get(redisKey), AuthUser.class); | ||||
|     } | ||||
|  | ||||
|     public void set(Integer type, AuthCallback authCallback, AuthUser authUser) { | ||||
|         String redisKey = formatKey(type, authCallback.getCode()); | ||||
|         stringRedisTemplate.opsForValue().set(redisKey, JsonUtils.toJsonString(authUser), SOCIAL_AUTH_USER.getTimeout()); | ||||
|     } | ||||
|  | ||||
|     private static String formatKey(Integer type, String code) { | ||||
|         return String.format(SOCIAL_AUTH_USER.getKeyTemplate(), type, code); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,53 @@ | ||||
| package cn.iocoder.yudao.module.system.enums; | ||||
|  | ||||
| /** | ||||
|  * System 字典类型的枚举类 | ||||
|  * | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| public interface DictTypeConstants { | ||||
|  | ||||
|     String USER_TYPE = "user_type"; // 用户类型 | ||||
|     String COMMON_STATUS = "sys_common_status"; // 系统状态 | ||||
|  | ||||
|     String USER_SEX = "sys_user_sex"; // 用户性别 | ||||
|     String OPERATE_TYPE = "sys_operate_type"; // 操作类型 | ||||
|     String LOGIN_TYPE = "sys_login_type"; // 登录日志的类型 | ||||
|     String LOGIN_RESULT = "sys_login_result"; // 登录结果 | ||||
|     String CONFIG_TYPE = "sys_config_type"; // 参数配置类型 | ||||
|     String BOOLEAN_STRING = "sys_boolean_string"; // Boolean 是否类型 | ||||
|  | ||||
|     String SMS_CHANNEL_CODE = "sys_sms_channel_code"; // 短信渠道编码 | ||||
|     String SMS_TEMPLATE_TYPE = "sys_sms_template_type"; // 短信模板类型 | ||||
|     String SMS_SEND_STATUS = "sys_sms_send_status"; // 短信发送状态 | ||||
|     String SMS_RECEIVE_STATUS = "sys_sms_receive_status"; // 短信接收状态 | ||||
|  | ||||
|     /** | ||||
|      * 支付-订单-订单状态 | ||||
|      */ | ||||
|     String PAY_ORDER_STATUS = "pay_order_status"; | ||||
|  | ||||
|     /** | ||||
|      * 支付-订单-订单回调商户状态 | ||||
|      */ | ||||
|     String PAY_ORDER_NOTIFY_STATUS = "pay_order_notify_status"; | ||||
|  | ||||
|     /** | ||||
|      * 支付-订单-订单退款状态 | ||||
|      */ | ||||
|     String PAY_ORDER_REFUND_STATUS = "pay_order_refund_status"; | ||||
|  | ||||
|     /** | ||||
|      * 支付-退款订单-退款状态 | ||||
|      */ | ||||
|     String PAY_REFUND_ORDER_STATUS = "pay_refund_order_status"; | ||||
|  | ||||
|     /** | ||||
|      * 支付-退款订单-退款类别 | ||||
|      */ | ||||
|     String PAY_REFUND_ORDER_TYPE = "pay_refund_order_type"; | ||||
|  | ||||
|     String BPM_TASK_ASSIGN_RULE_TYPE = "bpm_task_assign_rule_type"; // 任务分配规则类型 | ||||
|     String BPM_TASK_ASSIGN_SCRIPT = "bpm_task_assign_script"; // 任务分配自定义脚本 | ||||
|  | ||||
| } | ||||
| @@ -1,98 +0,0 @@ | ||||
| package cn.iocoder.yudao.module.system.enums; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.exception.ErrorCode; | ||||
|  | ||||
| /** | ||||
|  * System 错误码枚举类 | ||||
|  * | ||||
|  * system 系统,使用 1-002-000-000 段 | ||||
|  */ | ||||
| public interface ErrorCodeConstants { | ||||
|  | ||||
|     // ========== AUTH 模块 1002000000 ========== | ||||
|     ErrorCode AUTH_LOGIN_BAD_CREDENTIALS = new ErrorCode(1002000000, "登录失败,账号密码不正确"); | ||||
|     ErrorCode AUTH_LOGIN_USER_DISABLED = new ErrorCode(1002000001, "登录失败,账号被禁用"); | ||||
|     ErrorCode AUTH_LOGIN_FAIL_UNKNOWN = new ErrorCode(1002000002, "登录失败"); // 登录失败的兜底,未知原因 | ||||
|     ErrorCode AUTH_LOGIN_CAPTCHA_NOT_FOUND = new ErrorCode(1002000003, "验证码不存在"); | ||||
|     ErrorCode AUTH_LOGIN_CAPTCHA_CODE_ERROR = new ErrorCode(1002000004, "验证码不正确"); | ||||
|     ErrorCode AUTH_THIRD_LOGIN_NOT_BIND = new ErrorCode(1002000005, "未绑定账号,需要进行绑定"); | ||||
|     ErrorCode AUTH_TOKEN_EXPIRED = new ErrorCode(1002000006, "Token 已经过期"); | ||||
|  | ||||
|     // ========== 菜单模块 1002002000 ========== | ||||
|     ErrorCode MENU_NAME_DUPLICATE = new ErrorCode(1002002000, "已经存在该名字的菜单"); | ||||
|     ErrorCode MENU_PARENT_NOT_EXISTS = new ErrorCode(1002002001, "父菜单不存在"); | ||||
|     ErrorCode MENU_PARENT_ERROR = new ErrorCode(1002002002, "不能设置自己为父菜单"); | ||||
|     ErrorCode MENU_NOT_EXISTS = new ErrorCode(1002002003, "菜单不存在"); | ||||
|     ErrorCode MENU_EXISTS_CHILDREN = new ErrorCode(1002002004, "存在子菜单,无法删除"); | ||||
|     ErrorCode MENU_PARENT_NOT_DIR_OR_MENU = new ErrorCode(1002002005, "父菜单的类型必须是目录或者菜单"); | ||||
|  | ||||
|     // ========== 角色模块 1002003000 ========== | ||||
|     ErrorCode ROLE_NOT_EXISTS = new ErrorCode(1002003000, "角色不存在"); | ||||
|     ErrorCode ROLE_NAME_DUPLICATE = new ErrorCode(1002003001, "已经存在名为【{}】的角色"); | ||||
|     ErrorCode ROLE_CODE_DUPLICATE = new ErrorCode(1002003002, "已经存在编码为【{}】的角色"); | ||||
|     ErrorCode ROLE_CAN_NOT_UPDATE_SYSTEM_TYPE_ROLE = new ErrorCode(1002003004, "不能操作类型为系统内置的角色"); | ||||
|     ErrorCode ROLE_IS_DISABLE = new ErrorCode(1002003004, "名字为【{}】的角色已被禁用"); | ||||
|  | ||||
|     // ========== 用户模块 1002004000 ========== | ||||
|     ErrorCode USER_USERNAME_EXISTS = new ErrorCode(1002004000, "用户账号已经存在"); | ||||
|     ErrorCode USER_MOBILE_EXISTS = new ErrorCode(1002004001, "手机号已经存在"); | ||||
|     ErrorCode USER_EMAIL_EXISTS = new ErrorCode(1002004002, "邮箱已经存在"); | ||||
|     ErrorCode USER_NOT_EXISTS = new ErrorCode(1002004003, "用户不存在"); | ||||
|     ErrorCode USER_IMPORT_LIST_IS_EMPTY = new ErrorCode(1002004004, "导入用户数据不能为空!"); | ||||
|     ErrorCode USER_PASSWORD_FAILED = new ErrorCode(1002004005, "用户密码校验失败"); | ||||
|     ErrorCode USER_IS_DISABLE = new ErrorCode(1002003004, "名字为【{}】的用户已被禁用"); | ||||
|  | ||||
|     // ========== 部门模块 1002005000 ========== | ||||
|     ErrorCode DEPT_NAME_DUPLICATE = new ErrorCode(1002004001, "已经存在该名字的部门"); | ||||
|     ErrorCode DEPT_PARENT_NOT_EXITS = new ErrorCode(1002004002,"父级部门不存在"); | ||||
|     ErrorCode DEPT_NOT_FOUND = new ErrorCode(1002004003, "当前部门不存在"); | ||||
|     ErrorCode DEPT_EXITS_CHILDREN = new ErrorCode(1002004004, "存在子部门,无法删除"); | ||||
|     ErrorCode DEPT_PARENT_ERROR = new ErrorCode(1002004005, "不能设置自己为父部门"); | ||||
|     ErrorCode DEPT_EXISTS_USER = new ErrorCode(1002004006, "部门中存在员工,无法删除"); | ||||
|     ErrorCode DEPT_NOT_ENABLE = new ErrorCode(1002004007, "部门不处于开启状态,不允许选择"); | ||||
|     ErrorCode DEPT_PARENT_IS_CHILD = new ErrorCode(1002004008, "不能设置自己的子部门为父部门"); | ||||
|  | ||||
|     // ========== 岗位模块 1002005000 ========== | ||||
|     ErrorCode POST_NOT_FOUND = new ErrorCode(1002005001, "当前岗位不存在"); | ||||
|     ErrorCode POST_NOT_ENABLE = new ErrorCode(1002005002, "岗位({}) 不处于开启状态,不允许选择"); | ||||
|     ErrorCode POST_NAME_DUPLICATE = new ErrorCode(1002005001, "已经存在该名字的岗位"); | ||||
|     ErrorCode POST_CODE_DUPLICATE = new ErrorCode(1002005001, "已经存在该标识的岗位"); | ||||
|  | ||||
|     // ========== 字典类型 1002006000 ========== | ||||
|     ErrorCode DICT_TYPE_NOT_EXISTS = new ErrorCode(1002006001, "当前字典类型不存在"); | ||||
|     ErrorCode DICT_TYPE_NOT_ENABLE = new ErrorCode(1002006002, "字典类型不处于开启状态,不允许选择"); | ||||
|     ErrorCode DICT_TYPE_NAME_DUPLICATE = new ErrorCode(1002006003, "已经存在该名字的字典类型"); | ||||
|     ErrorCode DICT_TYPE_TYPE_DUPLICATE = new ErrorCode(1002006004, "已经存在该类型的字典类型"); | ||||
|     ErrorCode DICT_TYPE_HAS_CHILDREN = new ErrorCode(1002006004, "无法删除,该字典类型还有字典数据"); | ||||
|  | ||||
|     // ========== 字典数据 1002007000 ========== | ||||
|     ErrorCode DICT_DATA_NOT_EXISTS = new ErrorCode(1002007001, "当前字典数据不存在"); | ||||
|     ErrorCode DICT_DATA_NOT_ENABLE = new ErrorCode(1002007002, "字典数据({})不处于开启状态,不允许选择"); | ||||
|     ErrorCode DICT_DATA_VALUE_DUPLICATE = new ErrorCode(1002007003, "已经存在该值的字典数据"); | ||||
|  | ||||
|     // ========== 通知公告 1002008000 ========== | ||||
|     ErrorCode NOTICE_NOT_FOUND = new ErrorCode(1002008001, "当前通知公告不存在"); | ||||
|  | ||||
|     // ========== 文件 1002009000 ========== | ||||
|     ErrorCode FILE_PATH_EXISTS = new ErrorCode(1002009001, "文件路径已经存在"); | ||||
|     ErrorCode FILE_UPLOAD_FAILED = new ErrorCode(1002009002, "文件上传失败"); | ||||
|     ErrorCode FILE_IS_EMPTY= new ErrorCode(1002009003, "文件为空"); | ||||
|  | ||||
|     // ========== 短信渠道 1002011000 ========== | ||||
|     ErrorCode SMS_CHANNEL_NOT_EXISTS = new ErrorCode(1002011000, "短信渠道不存在"); | ||||
|     ErrorCode SMS_CHANNEL_DISABLE = new ErrorCode(1002011001, "短信渠道不处于开启状态,不允许选择"); | ||||
|     ErrorCode SMS_CHANNEL_HAS_CHILDREN = new ErrorCode(1002011002, "无法删除,该短信渠道还有短信模板"); | ||||
|  | ||||
|     // ========== 短信模板 1002011000 ========== | ||||
|     ErrorCode SMS_TEMPLATE_NOT_EXISTS = new ErrorCode(1002011000, "短信模板不存在"); | ||||
|     ErrorCode SMS_TEMPLATE_CODE_DUPLICATE = new ErrorCode(1002011001, "已经存在编码为【{}】的短信模板"); | ||||
|  | ||||
|     // ========== 租户模块 1002012000 ========== | ||||
|     ErrorCode TENANT_NOT_EXISTS = new ErrorCode(1002012000, "租户不存在"); | ||||
|  | ||||
|     // ========== 错误码模块 1002013000 ========== | ||||
|     ErrorCode ERROR_CODE_NOT_EXISTS = new ErrorCode(1002013000, "错误码不存在"); | ||||
|     ErrorCode ERROR_CODE_DUPLICATE = new ErrorCode(1002013001, "已经存在编码为【{}】的错误码"); | ||||
|  | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,27 @@ | ||||
| package cn.iocoder.yudao.module.system.enums.common; | ||||
|  | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Getter; | ||||
|  | ||||
| /** | ||||
|  * 性别的枚举值 | ||||
|  * | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| @Getter | ||||
| @AllArgsConstructor | ||||
| public enum SysSexEnum { | ||||
|  | ||||
|     /** 男 */ | ||||
|     MALE(1), | ||||
|     /** 女 */ | ||||
|     FEMALE(2), | ||||
|     /* 未知 */ | ||||
|     UNKNOWN(3); | ||||
|  | ||||
|     /** | ||||
|      * 性别 | ||||
|      */ | ||||
|     private final Integer sex; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,29 @@ | ||||
| package cn.iocoder.yudao.module.system.enums.logger; | ||||
|  | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Getter; | ||||
|  | ||||
| /** | ||||
|  * 登录日志的类型枚举 | ||||
|  */ | ||||
| @Getter | ||||
| @AllArgsConstructor | ||||
| public enum SysLoginLogTypeEnum { | ||||
|  | ||||
|     LOGIN_USERNAME(100), // 使用账号登录 | ||||
|     LOGIN_SOCIAL(101), // 使用社交登录 | ||||
|     LOGIN_MOCK(102), // 使用 Mock 登录 | ||||
|     LOGIN_MOBILE(103), // 使用手机登陆 | ||||
|     LOGIN_SMS(104), // 使用短信登陆 | ||||
|  | ||||
|     LOGOUT_SELF(200),  // 自己主动登出 | ||||
|     LOGOUT_TIMEOUT(201), // 超时登出 | ||||
|     LOGOUT_DELETE(202), // 强制退出 | ||||
|     ; | ||||
|  | ||||
|     /** | ||||
|      * 日志类型 | ||||
|      */ | ||||
|     private final Integer type; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,27 @@ | ||||
| package cn.iocoder.yudao.module.system.enums.logger; | ||||
|  | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Getter; | ||||
|  | ||||
| /** | ||||
|  * 登录结果的枚举类 | ||||
|  */ | ||||
| @Getter | ||||
| @AllArgsConstructor | ||||
| public enum SysLoginResultEnum { | ||||
|  | ||||
|     SUCCESS(0), // 成功 | ||||
|     BAD_CREDENTIALS(10), // 账号或密码不正确 | ||||
|     USER_DISABLED(20), // 用户被禁用 | ||||
|     CAPTCHA_NOT_FOUND(30), // 图片验证码不存在 | ||||
|     CAPTCHA_CODE_ERROR(31), // 图片验证码不正确 | ||||
|  | ||||
|     UNKNOWN_ERROR(100), // 未知异常 | ||||
|     ; | ||||
|  | ||||
|     /** | ||||
|      * 结果 | ||||
|      */ | ||||
|     private final Integer result; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,23 @@ | ||||
| package cn.iocoder.yudao.module.system.enums.sms; | ||||
|  | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Getter; | ||||
|  | ||||
| /** | ||||
|  * 短信的接收状态枚举 | ||||
|  * | ||||
|  * @author 芋道源码 | ||||
|  * @date 2021/2/1 13:39 | ||||
|  */ | ||||
| @Getter | ||||
| @AllArgsConstructor | ||||
| public enum SysSmsReceiveStatusEnum { | ||||
|  | ||||
|     INIT(0), // 初始化 | ||||
|     SUCCESS(10), // 接收成功 | ||||
|     FAILURE(20), // 接收失败 | ||||
|     ; | ||||
|  | ||||
|     private final int status; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,24 @@ | ||||
| package cn.iocoder.yudao.module.system.enums.sms; | ||||
|  | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Getter; | ||||
|  | ||||
| /** | ||||
|  * 短信的发送状态枚举 | ||||
|  * | ||||
|  * @author zzf | ||||
|  * @date 2021/2/1 13:39 | ||||
|  */ | ||||
| @Getter | ||||
| @AllArgsConstructor | ||||
| public enum SysSmsSendStatusEnum { | ||||
|  | ||||
|     INIT(0), // 初始化 | ||||
|     SUCCESS(10), // 发送成功 | ||||
|     FAILURE(20), // 发送失败 | ||||
|     IGNORE(30), // 忽略,即不发送 | ||||
|     ; | ||||
|  | ||||
|     private final int status; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,25 @@ | ||||
| package cn.iocoder.yudao.module.system.enums.sms; | ||||
|  | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Getter; | ||||
|  | ||||
| /** | ||||
|  * 短信的模板类型枚举 | ||||
|  * | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| @Getter | ||||
| @AllArgsConstructor | ||||
| public enum SysSmsTemplateTypeEnum { | ||||
|  | ||||
|     VERIFICATION_CODE(1), // 验证码 | ||||
|     NOTICE(2), // 通知 | ||||
|     PROMOTION(3), // 营销 | ||||
|     ; | ||||
|  | ||||
|     /** | ||||
|      * 类型 | ||||
|      */ | ||||
|     private final int type; | ||||
|  | ||||
| } | ||||
| @@ -1,7 +1,7 @@ | ||||
| package cn.iocoder.yudao.module.system.framework.datapermission.config; | ||||
|  | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.dept.SysDeptDO; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.dal.dataobject.user.SysUserDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; | ||||
| import cn.iocoder.yudao.module.system.dal.dataobject.user.UserDO; | ||||
| import cn.iocoder.yudao.framework.datapermission.core.dept.rule.DeptDataPermissionRuleCustomizer; | ||||
| import org.springframework.context.annotation.Bean; | ||||
| import org.springframework.context.annotation.Configuration; | ||||
| @@ -17,7 +17,7 @@ public class DataPermissionConfiguration { | ||||
|     @Bean | ||||
|     public DeptDataPermissionRuleCustomizer sysDeptDataPermissionRuleCustomizer() { | ||||
|         return rule -> { | ||||
|             rule.addDeptColumn(SysUserDO.class); | ||||
|             rule.addDeptColumn(UserDO.class); | ||||
|             rule.addDeptColumn(SysDeptDO.class, "id"); | ||||
|         }; | ||||
|     } | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| package cn.iocoder.yudao.module.system.mq.consumer.dict; | ||||
|  | ||||
| import cn.iocoder.yudao.coreservice.modules.system.service.dict.SysDictDataCoreService; | ||||
| import cn.iocoder.yudao.framework.mq.core.pubsub.AbstractChannelMessageListener; | ||||
| import cn.iocoder.yudao.module.system.mq.message.dict.DictDataRefreshMessage; | ||||
| import cn.iocoder.yudao.module.system.service.dict.DictDataService; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.springframework.stereotype.Component; | ||||
|  | ||||
| @@ -18,12 +18,12 @@ import javax.annotation.Resource; | ||||
| public class DictDataRefreshConsumer extends AbstractChannelMessageListener<DictDataRefreshMessage> { | ||||
|  | ||||
|     @Resource | ||||
|     private SysDictDataCoreService dictDataCoreService; | ||||
|     private DictDataService dictDataService; | ||||
|  | ||||
|     @Override | ||||
|     public void onMessage(DictDataRefreshMessage message) { | ||||
|         log.info("[onMessage][收到 DictData 刷新消息]"); | ||||
|         dictDataCoreService.initLocalCache(); | ||||
|         dictDataService.initLocalCache(); | ||||
|     } | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| package cn.iocoder.yudao.module.system.mq.consumer.sms; | ||||
|  | ||||
| import cn.iocoder.yudao.coreservice.modules.system.mq.message.sms.SysSmsSendMessage; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.service.sms.SysSmsCoreService; | ||||
| import cn.iocoder.yudao.module.system.mq.message.sms.SmsSendMessage; | ||||
| import cn.iocoder.yudao.module.system.service.sms.SysSmsSendService; | ||||
| import cn.iocoder.yudao.framework.mq.core.stream.AbstractStreamMessageListener; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.springframework.stereotype.Component; | ||||
| @@ -9,20 +9,20 @@ import org.springframework.stereotype.Component; | ||||
| import javax.annotation.Resource; | ||||
|  | ||||
| /** | ||||
|  * 针对 {@link SysSmsSendMessage} 的消费者 | ||||
|  * 针对 {@link SmsSendMessage} 的消费者 | ||||
|  * | ||||
|  * @author zzf | ||||
|  * @date 2021/3/9 16:35 | ||||
|  */ | ||||
| @Component | ||||
| @Slf4j | ||||
| public class SmsSendConsumer extends AbstractStreamMessageListener<SysSmsSendMessage> { | ||||
| public class SmsSendConsumer extends AbstractStreamMessageListener<SmsSendMessage> { | ||||
|  | ||||
|     @Resource | ||||
|     private SysSmsCoreService smsCoreService; | ||||
|     private SysSmsSendService smsCoreService; | ||||
|  | ||||
|     @Override | ||||
|     public void onMessage(SysSmsSendMessage message) { | ||||
|     public void onMessage(SmsSendMessage message) { | ||||
|         log.info("[onMessage][消息内容({})]", message); | ||||
|         smsCoreService.doSendSms(message); | ||||
|     } | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| package cn.iocoder.yudao.module.system.mq.consumer.sms; | ||||
|  | ||||
| import cn.iocoder.yudao.module.system.mq.message.sms.SmsTemplateRefreshMessage; | ||||
| import cn.iocoder.yudao.coreservice.modules.system.service.sms.SysSmsTemplateCoreService; | ||||
| import cn.iocoder.yudao.framework.mq.core.pubsub.AbstractChannelMessageListener; | ||||
| import cn.iocoder.yudao.module.system.service.sms.SmsTemplateService; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.springframework.stereotype.Component; | ||||
|  | ||||
| @@ -18,12 +18,12 @@ import javax.annotation.Resource; | ||||
| public class SmsTemplateRefreshConsumer extends AbstractChannelMessageListener<SmsTemplateRefreshMessage> { | ||||
|  | ||||
|     @Resource | ||||
|     private SysSmsTemplateCoreService smsTemplateCoreService; | ||||
|     private SmsTemplateService smsTemplateService; | ||||
|  | ||||
|     @Override | ||||
|     public void onMessage(SmsTemplateRefreshMessage message) { | ||||
|         log.info("[onMessage][收到 SmsTemplate 刷新消息]"); | ||||
|         smsTemplateCoreService.initLocalCache(); | ||||
|         smsTemplateService.initLocalCache(); | ||||
|     } | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -0,0 +1,50 @@ | ||||
| package cn.iocoder.yudao.module.system.mq.message.sms; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.core.KeyValue; | ||||
| import cn.iocoder.yudao.framework.mq.core.stream.AbstractStreamMessage; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
|  | ||||
| import javax.validation.constraints.NotNull; | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|  * 短信发送消息 | ||||
|  * | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class SmsSendMessage extends AbstractStreamMessage { | ||||
|  | ||||
|     /** | ||||
|      * 短信日志编号 | ||||
|      */ | ||||
|     @NotNull(message = "短信日志编号不能为空") | ||||
|     private Long logId; | ||||
|     /** | ||||
|      * 手机号 | ||||
|      */ | ||||
|     @NotNull(message = "手机号不能为空") | ||||
|     private String mobile; | ||||
|     /** | ||||
|      * 短信渠道编号 | ||||
|      */ | ||||
|     @NotNull(message = "短信渠道编号不能为空") | ||||
|     private Long channelId; | ||||
|     /** | ||||
|      * 短信 API 的模板编号 | ||||
|      */ | ||||
|     @NotNull(message = "短信 API 的模板编号不能为空") | ||||
|     private String apiTemplateId; | ||||
|     /** | ||||
|      * 短信模板参数 | ||||
|      */ | ||||
|     private List<KeyValue<String, Object>> templateParams; | ||||
|  | ||||
|     @Override | ||||
|     public String getStreamKey() { | ||||
|         return "system.sms.send"; | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,4 @@ | ||||
| /** | ||||
|  * 占位 | ||||
|  */ | ||||
| package cn.iocoder.yudao.module.system.mq.producer; | ||||
| @@ -1,12 +1,15 @@ | ||||
| package cn.iocoder.yudao.module.system.mq.producer.sms; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.core.KeyValue; | ||||
| import cn.iocoder.yudao.module.system.mq.message.sms.SmsChannelRefreshMessage; | ||||
| import cn.iocoder.yudao.module.system.mq.message.sms.SmsSendMessage; | ||||
| import cn.iocoder.yudao.module.system.mq.message.sms.SmsTemplateRefreshMessage; | ||||
| import cn.iocoder.yudao.framework.mq.core.RedisMQTemplate; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.springframework.stereotype.Component; | ||||
|  | ||||
| import javax.annotation.Resource; | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|  * Sms 短信相关消息的 Producer | ||||
| @@ -37,4 +40,20 @@ public class SmsProducer { | ||||
|         redisMQTemplate.send(message); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 发送 {@link SmsSendMessage} 消息 | ||||
|      * | ||||
|      * @param logId 短信日志编号 | ||||
|      * @param mobile 手机号 | ||||
|      * @param channelId 渠道编号 | ||||
|      * @param apiTemplateId 短信模板编号 | ||||
|      * @param templateParams 短信模板参数 | ||||
|      */ | ||||
|     public void sendSmsSendMessage(Long logId, String mobile, | ||||
|                                    Long channelId, String apiTemplateId, List<KeyValue<String, Object>> templateParams) { | ||||
|         SmsSendMessage message = new SmsSendMessage().setLogId(logId).setMobile(mobile); | ||||
|         message.setChannelId(channelId).setApiTemplateId(apiTemplateId).setTemplateParams(templateParams); | ||||
|         redisMQTemplate.send(message); | ||||
|     } | ||||
|  | ||||
| } | ||||
|   | ||||
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