From fd53bf329642a4322400ad48f07ccc3651545532 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 31 Jan 2022 00:33:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E6=A8=A1=E5=9D=97=E9=87=8D=E6=9E=84?= =?UTF-8?q?=204=EF=BC=9Asystem=20=E6=A8=A1=E5=9D=97=E7=9A=84=E8=B0=83?= =?UTF-8?q?=E6=95=B4=EF=BC=8C=E8=A7=A3=E5=86=B3=E5=8D=95=E5=85=83=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yaml | 2 +- .../src/test/resources/sql/clean.sql | 20 - .../src/test/resources/sql/create_tables.sql | 407 ------------------ .../app/auth/vo/AppAuthCheckCodeReqVO.java | 2 +- .../app/auth/vo/AppAuthSendSmsReqVO.java | 2 +- .../service/auth/MemberAuthServiceImpl.java | 11 +- .../service/auth/MemberAuthServiceTest.java | 10 +- .../user/MemberUserServiceImplTest.java | 12 +- .../test/resources/application-unit-test.yaml | 2 + .../src/test/resources/sql/clean.sql | 1 - .../src/test/resources/sql/create_tables.sql | 1 - .../controller/admin/auth/AuthController.java | 6 +- .../admin/auth/UserSessionController.java | 10 +- .../auth/vo/auth/AuthSocialBindReqVO.java | 2 +- .../auth/vo/auth/AuthSocialLogin2ReqVO.java | 2 +- .../auth/vo/auth/AuthSocialLoginReqVO.java | 2 +- .../auth/vo/auth/AuthSocialUnbindReqVO.java | 2 +- .../controller/admin/dept/DeptController.java | 10 +- .../controller/admin/dept/PostController.java | 8 +- .../admin/dept/vo/dept/DeptBaseVO.java | 2 +- .../admin/dept/vo/dept/DeptListReqVO.java | 2 +- .../admin/dept/vo/dept/DeptRespVO.java | 2 +- .../admin/dept/vo/post/PostBaseVO.java | 2 +- .../admin/dept/vo/post/PostExportReqVO.java | 4 +- .../admin/dept/vo/post/PostListReqVO.java | 2 +- .../admin/dept/vo/post/PostPageReqVO.java | 2 +- .../admin/dict/DictDataController.java | 6 +- .../admin/dict/vo/data/DictDataBaseVO.java | 4 +- .../dict/vo/data/DictDataExportReqVO.java | 2 +- .../admin/dict/vo/data/DictDataPageReqVO.java | 2 +- .../dict/vo/type/DictTypeExportReqVO.java | 2 +- .../admin/dict/vo/type/DictTypePageReqVO.java | 2 +- .../errorcode/vo/ErrorCodePageReqVO.java | 2 +- .../admin/errorcode/vo/ErrorCodeRespVO.java | 2 +- .../admin/logger/LoginLogController.java | 6 +- .../logger/vo/loginlog/LoginLogBaseVO.java | 4 +- .../vo/operatelog/OperateLogBaseVO.java | 2 +- .../vo/operatelog/OperateLogExportReqVO.java | 2 +- .../vo/operatelog/OperateLogPageReqVO.java | 2 +- .../admin/notice/vo/NoticeBaseVO.java | 2 +- .../admin/notice/vo/NoticePageReqVO.java | 2 +- .../admin/permission/vo/menu/MenuBaseVO.java | 4 +- .../permission/vo/menu/MenuListReqVO.java | 2 +- .../admin/permission/vo/menu/MenuRespVO.java | 2 +- .../PermissionAssignRoleDataScopeReqVO.java | 2 +- .../admin/permission/vo/role/RoleBaseVO.java | 2 +- .../permission/vo/role/RoleExportReqVO.java | 2 +- .../permission/vo/role/RolePageReqVO.java | 2 +- .../admin/permission/vo/role/RoleRespVO.java | 4 +- .../vo/role/RoleUpdateStatusReqVO.java | 4 +- .../admin/sms/SmsCallbackController.java | 6 +- .../admin/sms/SmsChannelController.java | 10 +- .../admin/sms/SmsLogController.java | 10 +- .../admin/sms/SmsTemplateController.java | 12 +- .../admin/sms/vo/log/SmsLogExportReqVO.java | 2 +- .../admin/sms/vo/log/SmsLogPageReqVO.java | 4 +- ...SysSmsLogRespVO.java => SmsLogRespVO.java} | 2 +- .../sms/vo/template/SmsTemplateBaseVO.java | 2 +- .../vo/template/SmsTemplateExportReqVO.java | 2 +- .../admin/tenant/TenantController.java | 12 +- .../admin/tenant/vo/TenantExportReqVO.java | 2 +- .../controller/admin/user/UserController.java | 14 +- .../admin/user/UserProfileController.java | 12 +- .../user/vo/profile/UserProfileRespVO.java | 4 +- .../vo/profile/UserProfileUpdateReqVO.java | 2 +- .../admin/user/vo/user/UserBaseVO.java | 4 +- .../admin/user/vo/user/UserExportReqVO.java | 4 +- .../admin/user/vo/user/UserPageReqVO.java | 2 +- .../admin/user/vo/user/UserRespVO.java | 2 +- .../user/vo/user/UserUpdateStatusReqVO.java | 4 +- .../convert/auth/UserSessionConvert.java | 4 +- .../system/convert/dept/DeptConvert.java | 12 +- .../system/convert/dept/PostConvert.java | 14 +- .../system/convert/dict/DictDataConvert.java | 18 +- .../convert/dict/SysDictDataCoreConvert.java | 20 - .../convert/logger/LoginLogConvert.java | 11 +- .../logger/SysLoginLogCoreConvert.java | 15 - .../system/convert/sms/SmsChannelConvert.java | 16 +- .../system/convert/sms/SmsLogConvert.java | 12 +- .../convert/sms/SmsTemplateConvert.java | 14 +- .../system/convert/tenant/TenantConvert.java | 14 +- .../system/convert/user/UserConvert.java | 14 +- ...sUserSessionDO.java => UserSessionDO.java} | 8 +- .../dept/{SysDeptDO.java => DeptDO.java} | 4 +- .../dept/{SysPostDO.java => PostDO.java} | 4 +- .../{SysDictDataDO.java => DictDataDO.java} | 6 +- .../{SysLoginLogDO.java => LoginLogDO.java} | 4 +- .../dal/dataobject/permission/MenuDO.java | 2 +- ...SysSmsChannelDO.java => SmsChannelDO.java} | 4 +- .../sms/{SysSmsLogDO.java => SmsLogDO.java} | 28 +- ...sSmsTemplateDO.java => SmsTemplateDO.java} | 12 +- ...SysSocialUserDO.java => SocialUserDO.java} | 6 +- .../{SysTenantDO.java => TenantDO.java} | 4 +- .../dal/dataobject/user/AdminUserDO.java | 6 +- .../mysql/auth/SysUserSessionCoreMapper.java | 10 - ...sionMapper.java => UserSessionMapper.java} | 12 +- .../{SysDeptMapper.java => DeptMapper.java} | 22 +- .../{SysPostMapper.java => PostMapper.java} | 24 +- .../dal/mysql/dept/SysDeptCoreMapper.java | 9 - .../dal/mysql/dept/SysPostCoreMapper.java | 9 - .../system/dal/mysql/dict/DictDataMapper.java | 54 +++ ...ictTypeMapper.java => DictTypeMapper.java} | 2 +- .../dal/mysql/dict/SysDictDataMapper.java | 55 --- ...orCodeMapper.java => ErrorCodeMapper.java} | 2 +- .../dal/mysql/logger/LoginLogMapper.java | 12 +- .../mysql/logger/SysLoginLogCoreMapper.java | 10 - ...SysNoticeMapper.java => NoticeMapper.java} | 2 +- .../dal/mysql/permission/RoleMenuMapper.java | 2 +- .../dal/mysql/sms/SmsChannelMapper.java | 10 +- .../system/dal/mysql/sms/SmsLogMapper.java | 12 +- .../dal/mysql/sms/SmsTemplateMapper.java | 52 +-- .../dal/mysql/social/SocialUserMapper.java | 28 ++ .../dal/mysql/social/SysSocialUserMapper.java | 28 -- .../dal/mysql/tenant/SysTenantCoreMapper.java | 9 - .../dal/mysql/tenant/SysTenantMapper.java | 44 -- .../system/dal/mysql/tenant/TenantMapper.java | 44 ++ ...yConstants.java => RedisKeyConstants.java} | 4 +- .../dal/redis/SysRedisKeyCoreConstants.java | 18 - .../dal/redis/auth/LoginUserRedisDAO.java | 2 +- .../dal/redis/common/CaptchaRedisDAO.java | 2 +- .../redis/social/SocialAuthUserRedisDAO.java | 2 +- .../common/{SysSexEnum.java => SexEnum.java} | 2 +- ...tusEnum.java => SmsReceiveStatusEnum.java} | 2 +- ...StatusEnum.java => SmsSendStatusEnum.java} | 2 +- ...TypeEnum.java => SmsTemplateTypeEnum.java} | 2 +- .../config/DataPermissionConfiguration.java | 4 +- .../mq/consumer/sms/SmsSendConsumer.java | 4 +- .../service/auth/AdminAuthServiceImpl.java | 12 +- .../service/auth/UserSessionService.java | 4 +- .../service/auth/UserSessionServiceImpl.java | 34 +- .../system/service/dept/DeptService.java | 18 +- .../system/service/dept/DeptServiceImpl.java | 58 +-- .../system/service/dept/PostService.java | 12 +- .../system/service/dept/PostServiceImpl.java | 30 +- .../system/service/dict/DictDataService.java | 10 +- .../service/dict/DictDataServiceImpl.java | 55 ++- .../service/dict/DictTypeServiceImpl.java | 4 +- .../errorcode/ErrorCodeServiceImpl.java | 4 +- .../service/logger/LoginLogService.java | 6 +- .../service/logger/LoginLogServiceImpl.java | 12 +- .../service/notice/NoticeServiceImpl.java | 4 +- .../service/permission/MenuServiceImpl.java | 2 +- .../permission/PermissionServiceImpl.java | 6 +- .../system/service/sms/SmsChannelService.java | 10 +- .../service/sms/SmsChannelServiceImpl.java | 18 +- .../system/service/sms/SmsLogService.java | 10 +- .../system/service/sms/SmsLogServiceImpl.java | 36 +- .../service/sms/SmsSendServiceImpl.java | 10 +- .../service/sms/SmsTemplateService.java | 14 +- .../service/sms/SmsTemplateServiceImpl.java | 40 +- .../service/social/SocialUserService.java | 6 +- .../service/social/SocialUserServiceImpl.java | 30 +- .../service/tenant/SysTenantCoreService.java | 11 - .../system/service/tenant/TenantService.java | 17 +- .../service/tenant/TenantServiceImpl.java | 31 +- .../tenant/impl/SysTenantCoreServiceImpl.java | 29 -- .../service/user/AdminUserServiceImpl.java | 4 +- .../auth/UserSessionServiceImplTest.java | 36 +- .../system/service/dept/DeptServiceTest.java | 48 +-- .../system/service/dept/PostServiceTest.java | 38 +- .../service/dict/DictDataServiceTest.java | 44 +- .../service/dict/DictTypeServiceTest.java | 4 +- .../errorcode/ErrorCodeServiceTest.java | 6 +- .../logger/LoginLogServiceImplTest.java | 12 +- .../logger/OperateLogServiceImplTest.java | 6 +- .../service/notice/NoticeServiceImplTest.java | 22 +- .../permission/PermissionServiceTest.java | 4 +- .../service/sms/SmsChannelServiceTest.java | 26 +- .../system/service/sms/SmsLogServiceTest.java | 80 ++-- ...rviceTest.java => SmsSendServiceTest.java} | 10 +- .../service/sms/SmsTemplateServiceTest.java | 62 +-- .../service/social/SocialUserServiceTest.java | 28 +- .../service/tenant/TenantServiceTest.java | 22 +- .../service/user/UserServiceImplTest.java | 91 ++-- .../test/resources/application-unit-test.yaml | 55 +++ .../src/test/resources/logback-spring.xml | 4 + .../src/test/resources/sql/clean.sql | 18 + .../src/test/resources/sql/create_tables.sql | 405 +++++++++++++++++ 178 files changed, 1467 insertions(+), 1545 deletions(-) rename yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/{SysSmsLogRespVO.java => SmsLogRespVO.java} (99%) delete mode 100644 yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/dict/SysDictDataCoreConvert.java delete mode 100644 yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/logger/SysLoginLogCoreConvert.java rename yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/auth/{SysUserSessionDO.java => UserSessionDO.java} (82%) rename yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/{SysDeptDO.java => DeptDO.java} (94%) rename yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/{SysPostDO.java => PostDO.java} (92%) rename yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dict/{SysDictDataDO.java => DictDataDO.java} (88%) rename yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/logger/{SysLoginLogDO.java => LoginLogDO.java} (95%) rename yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/{SysSmsChannelDO.java => SmsChannelDO.java} (91%) rename yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/{SysSmsLogDO.java => SmsLogDO.java} (81%) rename yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/{SysSmsTemplateDO.java => SmsTemplateDO.java} (83%) rename yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/social/{SysSocialUserDO.java => SocialUserDO.java} (89%) rename yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/tenant/{SysTenantDO.java => TenantDO.java} (89%) delete mode 100644 yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/auth/SysUserSessionCoreMapper.java rename yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/auth/{SysUserSessionMapper.java => UserSessionMapper.java} (54%) rename yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/{SysDeptMapper.java => DeptMapper.java} (51%) rename yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/{SysPostMapper.java => PostMapper.java} (55%) delete mode 100644 yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/SysDeptCoreMapper.java delete mode 100644 yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/SysPostCoreMapper.java create mode 100644 yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/DictDataMapper.java rename yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/{SysDictTypeMapper.java => DictTypeMapper.java} (96%) delete mode 100644 yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/SysDictDataMapper.java rename yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/errorcode/{SysErrorCodeMapper.java => ErrorCodeMapper.java} (97%) delete mode 100644 yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/logger/SysLoginLogCoreMapper.java rename yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/notice/{SysNoticeMapper.java => NoticeMapper.java} (91%) create mode 100644 yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/social/SocialUserMapper.java delete mode 100644 yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/social/SysSocialUserMapper.java delete mode 100644 yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/tenant/SysTenantCoreMapper.java delete mode 100755 yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/tenant/SysTenantMapper.java create mode 100755 yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/tenant/TenantMapper.java rename yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/{SysRedisKeyConstants.java => RedisKeyConstants.java} (96%) delete mode 100644 yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/SysRedisKeyCoreConstants.java rename yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/common/{SysSexEnum.java => SexEnum.java} (93%) rename yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/{SysSmsReceiveStatusEnum.java => SmsReceiveStatusEnum.java} (90%) rename yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/{SysSmsSendStatusEnum.java => SmsSendStatusEnum.java} (91%) rename yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/{SysSmsTemplateTypeEnum.java => SmsTemplateTypeEnum.java} (90%) delete mode 100644 yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/tenant/SysTenantCoreService.java delete mode 100644 yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/tenant/impl/SysTenantCoreServiceImpl.java rename yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/{SysSmsSendServiceTest.java => SmsSendServiceTest.java} (95%) create mode 100644 yudao-module-system/yudao-module-system-impl/src/test/resources/application-unit-test.yaml create mode 100644 yudao-module-system/yudao-module-system-impl/src/test/resources/logback-spring.xml create mode 100644 yudao-module-system/yudao-module-system-impl/src/test/resources/sql/clean.sql create mode 100644 yudao-module-system/yudao-module-system-impl/src/test/resources/sql/create_tables.sql diff --git a/yudao-admin-server/src/main/resources/application.yaml b/yudao-admin-server/src/main/resources/application.yaml index 97eb6ac49..81ec74b2c 100644 --- a/yudao-admin-server/src/main/resources/application.yaml +++ b/yudao-admin-server/src/main/resources/application.yaml @@ -75,7 +75,7 @@ yudao: error-code: # 错误码相关配置项 constants-class-list: - cn.iocoder.yudao.adminserver.modules.infra.enums.InfErrorCodeConstants - - cn.iocoder.yudao.module.system.enums.SysErrorCodeConstants + - cn.iocoder.yudao.module.system.enums.ErrorCodeConstants - cn.iocoder.yudao.adminserver.modules.bpm.enums.BpmErrorCodeConstants tenant: # 多租户相关配置项 tables: # 配置需要开启多租户的表;如果实体已经继承 TenantBaseDO 类,则无需重复配置 diff --git a/yudao-admin-server/src/test/resources/sql/clean.sql b/yudao-admin-server/src/test/resources/sql/clean.sql index b565553f2..c0149d424 100644 --- a/yudao-admin-server/src/test/resources/sql/clean.sql +++ b/yudao-admin-server/src/test/resources/sql/clean.sql @@ -6,26 +6,6 @@ DELETE FROM "inf_job_log"; DELETE FROM "inf_api_access_log"; DELETE FROM "inf_api_error_log"; --- sys 开头的 DB -DELETE FROM "sys_dept"; -DELETE FROM "sys_dict_data"; -DELETE FROM "sys_role"; -DELETE FROM "sys_role_menu"; -DELETE FROM "sys_menu"; -DELETE FROM "sys_user_role"; -DELETE FROM "sys_dict_type"; -DELETE FROM "sys_user_session"; -DELETE FROM "sys_post"; -DELETE FROM "sys_login_log"; -DELETE FROM "sys_operate_log"; -DELETE FROM "sys_user"; -DELETE FROM "sys_sms_channel"; -DELETE FROM "sys_sms_template"; -DELETE FROM "sys_sms_log"; -DELETE FROM "sys_error_code"; -DELETE FROM "sys_social_user"; -DELETE FROM "sys_tenant"; - -- pay 开头的 DB DELETE FROM pay_merchant; DELETE FROM pay_app; diff --git a/yudao-admin-server/src/test/resources/sql/create_tables.sql b/yudao-admin-server/src/test/resources/sql/create_tables.sql index 9b2f0d69f..b8b92e3b1 100644 --- a/yudao-admin-server/src/test/resources/sql/create_tables.sql +++ b/yudao-admin-server/src/test/resources/sql/create_tables.sql @@ -67,413 +67,6 @@ CREATE TABLE IF NOT EXISTS "inf_job_log" ( PRIMARY KEY ("id") )COMMENT='定时任务日志表'; --- sys 开头的 DB - -CREATE TABLE IF NOT EXISTS "sys_dept" ( - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, - "name" varchar(30) NOT NULL DEFAULT '', - "parent_id" bigint NOT NULL DEFAULT '0', - "sort" int NOT NULL DEFAULT '0', - "leader_user_id" bigint DEFAULT NULL, - "phone" varchar(11) DEFAULT NULL, - "email" varchar(50) DEFAULT NULL, - "status" tinyint NOT NULL, - "creator" varchar(64) DEFAULT '', - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updater" varchar(64) DEFAULT '', - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "deleted" bit NOT NULL DEFAULT FALSE, - "tenant_id" bigint not null default '0', - PRIMARY KEY ("id") -) COMMENT '部门表'; - -CREATE TABLE IF NOT EXISTS "sys_dict_data" ( - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, - "sort" int NOT NULL DEFAULT '0', - "label" varchar(100) NOT NULL DEFAULT '', - "value" varchar(100) NOT NULL DEFAULT '', - "dict_type" varchar(100) NOT NULL DEFAULT '', - "status" tinyint NOT NULL DEFAULT '0', - "remark" varchar(500) DEFAULT NULL, - "creator" varchar(64) DEFAULT '', - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updater" varchar(64) DEFAULT '', - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "deleted" bit NOT NULL DEFAULT FALSE, - PRIMARY KEY ("id") -) COMMENT '字典数据表'; - -CREATE TABLE IF NOT EXISTS "sys_role" ( - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, - "name" varchar(30) NOT NULL, - "code" varchar(100) NOT NULL, - "sort" int NOT NULL, - "data_scope" tinyint NOT NULL DEFAULT '1', - "data_scope_dept_ids" varchar(500) NOT NULL DEFAULT '', - "status" tinyint NOT NULL, - "type" tinyint NOT NULL, - "remark" varchar(500) DEFAULT NULL, - "creator" varchar(64) DEFAULT '', - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updater" varchar(64) DEFAULT '', - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "deleted" bit NOT NULL DEFAULT FALSE, - PRIMARY KEY ("id") -) COMMENT '角色信息表'; - -CREATE TABLE IF NOT EXISTS "sys_role_menu" ( - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, - "role_id" bigint NOT NULL, - "menu_id" bigint NOT NULL, - "creator" varchar(64) DEFAULT '', - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updater" varchar(64) DEFAULT '', - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "deleted" bit NOT NULL DEFAULT FALSE, - PRIMARY KEY ("id") -) COMMENT '角色和菜单关联表'; - -CREATE TABLE IF NOT EXISTS "sys_menu" ( - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, - "name" varchar(50) NOT NULL, - "permission" varchar(100) NOT NULL DEFAULT '', - "menu_type" tinyint NOT NULL, - "sort" int NOT NULL DEFAULT '0', - "parent_id" bigint NOT NULL DEFAULT '0', - "path" varchar(200) DEFAULT '', - "icon" varchar(100) DEFAULT '#', - "component" varchar(255) DEFAULT NULL, - "status" tinyint NOT NULL DEFAULT '0', - "creator" varchar(64) DEFAULT '', - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updater" varchar(64) DEFAULT '', - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "deleted" bit NOT NULL DEFAULT FALSE, - PRIMARY KEY ("id") -) COMMENT '菜单权限表'; - -CREATE TABLE IF NOT EXISTS "sys_user_role" ( - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, - "user_id" bigint NOT NULL, - "role_id" bigint NOT NULL, - "creator" varchar(64) DEFAULT '', - "create_time" timestamp DEFAULT NULL, - "updater" varchar(64) DEFAULT '', - "update_time" timestamp DEFAULT NULL, - "deleted" bit DEFAULT FALSE, - PRIMARY KEY ("id") -) COMMENT '用户和角色关联表'; - -CREATE TABLE IF NOT EXISTS "sys_dict_type" ( - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, - "name" varchar(100) NOT NULL DEFAULT '', - "type" varchar(100) NOT NULL DEFAULT '', - "status" tinyint NOT NULL DEFAULT '0', - "remark" varchar(500) DEFAULT NULL, - "creator" varchar(64) DEFAULT '', - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updater" varchar(64) DEFAULT '', - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "deleted" bit NOT NULL DEFAULT FALSE, - PRIMARY KEY ("id") -) COMMENT '字典类型表'; - -CREATE TABLE IF NOT EXISTS `sys_user_session` ( - `id` varchar(32) NOT NULL, - `user_id` bigint DEFAULT NULL, - "user_type" tinyint NOT NULL, - `username` varchar(50) NOT NULL DEFAULT '', - `user_ip` varchar(50) DEFAULT NULL, - `user_agent` varchar(512) DEFAULT NULL, - `session_timeout` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "creator" varchar(64) DEFAULT '', - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updater` varchar(64) DEFAULT '' , - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "deleted" bit NOT NULL DEFAULT FALSE, - "tenant_id" bigint not null default '0', - PRIMARY KEY (`id`) -) COMMENT '用户在线 Session'; - -CREATE TABLE IF NOT EXISTS "sys_post" ( - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, - "code" varchar(64) NOT NULL, - "name" varchar(50) NOT NULL, - "sort" integer NOT NULL, - "status" tinyint NOT NULL, - "remark" varchar(500) DEFAULT NULL, - "creator" varchar(64) DEFAULT '', - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updater" varchar(64) DEFAULT '', - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "deleted" bit NOT NULL DEFAULT FALSE, - "tenant_id" bigint not null default '0', - PRIMARY KEY ("id") -) COMMENT '岗位信息表'; - -CREATE TABLE IF NOT EXISTS "sys_notice" ( - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, - "title" varchar(50) NOT NULL COMMENT '公告标题', - "content" text NOT NULL COMMENT '公告内容', - "notice_type" tinyint NOT NULL COMMENT '公告类型(1通知 2公告)', - "status" tinyint NOT NULL DEFAULT '0' COMMENT '公告状态(0正常 1关闭)', - "creator" varchar(64) DEFAULT '' COMMENT '创建者', - "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - "updater" varchar(64) DEFAULT '' COMMENT '更新者', - "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - "deleted" bit NOT NULL DEFAULT 0 COMMENT '是否删除', - "tenant_id" bigint not null default '0', - PRIMARY KEY("id") -) COMMENT '通知公告表'; - -CREATE TABLE IF NOT EXISTS `sys_login_log` ( - `id` bigint(20) NOT NULL GENERATED BY DEFAULT AS IDENTITY, - `log_type` bigint(4) NOT NULL, - "user_id" bigint not null default '0', - "user_type" tinyint NOT NULL, - `trace_id` varchar(64) NOT NULL DEFAULT '', - `username` varchar(50) NOT NULL DEFAULT '', - `result` tinyint(4) NOT NULL, - `user_ip` varchar(50) NOT NULL, - `user_agent` varchar(512) NOT NULL, - `creator` varchar(64) DEFAULT '', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updater` varchar(64) DEFAULT '', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `deleted` bit(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) -) COMMENT ='系统访问记录'; - -CREATE TABLE IF NOT EXISTS `sys_operate_log` ( - `id` bigint(20) NOT NULL GENERATED BY DEFAULT AS IDENTITY, - `trace_id` varchar(64) NOT NULL DEFAULT '', - `user_id` bigint(20) NOT NULL, - `module` varchar(50) NOT NULL, - `name` varchar(50) NOT NULL, - `operate_type` bigint(4) NOT NULL DEFAULT '0', - `content` varchar(2000) NOT NULL DEFAULT '', - `exts` varchar(512) NOT NULL DEFAULT '', - `request_method` varchar(16) DEFAULT '', - `request_url` varchar(255) DEFAULT '', - `user_ip` varchar(50) DEFAULT NULL, - `user_agent` varchar(200) DEFAULT NULL, - `java_method` varchar(512) NOT NULL DEFAULT '', - `java_method_args` varchar(8000) DEFAULT '', - `start_time` datetime NOT NULL, - `duration` int(11) NOT NULL, - `result_code` int(11) NOT NULL DEFAULT '0', - `result_msg` varchar(512) DEFAULT '', - `result_data` varchar(4000) DEFAULT '', - `creator` varchar(64) DEFAULT '', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updater` varchar(64) DEFAULT '', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `deleted` bit(1) NOT NULL DEFAULT '0', - "tenant_id" bigint not null default '0', - PRIMARY KEY (`id`) -) COMMENT ='操作日志记录'; - -CREATE TABLE IF NOT EXISTS "sys_user" ( - "id" bigint not null GENERATED BY DEFAULT AS IDENTITY, - "username" varchar(30) not null, - "password" varchar(100) not null default '', - "nickname" varchar(30) not null, - "remark" varchar(500) default null, - "dept_id" bigint default null, - "post_ids" varchar(255) default null, - "email" varchar(50) default '', - "mobile" varchar(11) default '', - "sex" tinyint default '0', - "avatar" varchar(100) default '', - "status" tinyint not null default '0', - "login_ip" varchar(50) default '', - "login_date" timestamp default null, - "creator" varchar(64) default '', - "create_time" timestamp not null default current_timestamp, - "updater" varchar(64) default '', - "update_time" timestamp not null default current_timestamp, - "deleted" bit not null default false, - "tenant_id" bigint not null default '0', - primary key ("id") -) comment '用户信息表'; - -CREATE TABLE IF NOT EXISTS "inf_api_access_log" ( - "id" bigint not null GENERATED BY DEFAULT AS IDENTITY, - "trace_id" varchar(64) not null default '', - "user_id" bigint not null default '0', - "user_type" tinyint not null default '0', - "application_name" varchar(50) not null, - "request_method" varchar(16) not null default '', - "request_url" varchar(255) not null default '', - "request_params" varchar(8000) not null default '', - "user_ip" varchar(50) not null, - "user_agent" varchar(512) not null, - "begin_time" timestamp not null, - "end_time" timestamp not null, - "duration" integer not null, - "result_code" integer not null default '0', - "result_msg" varchar(512) default '', - "creator" varchar(64) default '', - "create_time" timestamp not null default current_timestamp, - "updater" varchar(64) default '', - "update_time" timestamp not null default current_timestamp, - "deleted" bit not null default false, - "tenant_id" bigint not null default '0', - primary key ("id") -) COMMENT 'API 访问日志表'; - -CREATE TABLE IF NOT EXISTS "inf_api_error_log" ( - "id" bigint not null GENERATED BY DEFAULT AS IDENTITY, - "trace_id" varchar(64) not null, - "user_id" bigint not null default '0', - "user_type" tinyint not null default '0', - "application_name" varchar(50) not null, - "request_method" varchar(16) not null, - "request_url" varchar(255) not null, - "request_params" varchar(8000) not null, - "user_ip" varchar(50) not null, - "user_agent" varchar(512) not null, - "exception_time" timestamp not null, - "exception_name" varchar(128) not null default '', - "exception_message" clob not null, - "exception_root_cause_message" clob not null, - "exception_stack_trace" clob not null, - "exception_class_name" varchar(512) not null, - "exception_file_name" varchar(512) not null, - "exception_method_name" varchar(512) not null, - "exception_line_number" integer not null, - "process_status" tinyint not null, - "process_time" timestamp default null, - "process_user_id" bigint default '0', - "creator" varchar(64) default '', - "create_time" timestamp not null default current_timestamp, - "updater" varchar(64) default '', - "update_time" timestamp not null default current_timestamp, - "deleted" bit not null default false, - "tenant_id" bigint not null default '0', - primary key ("id") -) COMMENT '系统异常日志'; - -CREATE TABLE IF NOT EXISTS "sys_sms_channel" ( - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, - "signature" varchar(10) NOT NULL, - "code" varchar(63) NOT NULL, - "status" tinyint NOT NULL, - "remark" varchar(255) DEFAULT NULL, - "api_key" varchar(63) NOT NULL, - "api_secret" varchar(63) DEFAULT NULL, - "callback_url" varchar(255) DEFAULT NULL, - "creator" varchar(64) DEFAULT '', - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updater" varchar(64) DEFAULT '', - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "deleted" bit NOT NULL DEFAULT FALSE, - PRIMARY KEY ("id") -) COMMENT '短信渠道'; - -CREATE TABLE IF NOT EXISTS "sys_sms_template" ( - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, - "type" tinyint NOT NULL, - "status" tinyint NOT NULL, - "code" varchar(63) NOT NULL, - "name" varchar(63) NOT NULL, - "content" varchar(255) NOT NULL, - "params" varchar(255) NOT NULL, - "remark" varchar(255) DEFAULT NULL, - "api_template_id" varchar(63) NOT NULL, - "channel_id" bigint NOT NULL, - "channel_code" varchar(63) NOT NULL, - "creator" varchar(64) DEFAULT '', - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updater" varchar(64) DEFAULT '', - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "deleted" bit NOT NULL DEFAULT FALSE, - PRIMARY KEY ("id") -) COMMENT '短信模板'; - -CREATE TABLE IF NOT EXISTS "sys_sms_log" ( - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, - "channel_id" bigint NOT NULL, - "channel_code" varchar(63) NOT NULL, - "template_id" bigint NOT NULL, - "template_code" varchar(63) NOT NULL, - "template_type" tinyint NOT NULL, - "template_content" varchar(255) NOT NULL, - "template_params" varchar(255) NOT NULL, - "api_template_id" varchar(63) NOT NULL, - "mobile" varchar(11) NOT NULL, - "user_id" bigint DEFAULT '0', - "user_type" tinyint DEFAULT '0', - "send_status" tinyint NOT NULL DEFAULT '0', - "send_time" timestamp DEFAULT NULL, - "send_code" int DEFAULT NULL, - "send_msg" varchar(255) DEFAULT NULL, - "api_send_code" varchar(63) DEFAULT NULL, - "api_send_msg" varchar(255) DEFAULT NULL, - "api_request_id" varchar(255) DEFAULT NULL, - "api_serial_no" varchar(255) DEFAULT NULL, - "receive_status" tinyint NOT NULL DEFAULT '0', - "receive_time" timestamp DEFAULT NULL, - "api_receive_code" varchar(63) DEFAULT NULL, - "api_receive_msg" varchar(255) DEFAULT NULL, - "creator" varchar(64) DEFAULT '', - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updater" varchar(64) DEFAULT '', - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "deleted" bit NOT NULL DEFAULT FALSE, - PRIMARY KEY ("id") -) COMMENT '短信日志'; - -CREATE TABLE IF NOT EXISTS "sys_error_code" ( - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, - "type" tinyint NOT NULL DEFAULT '0', - "application_name" varchar(50) NOT NULL, - "code" int NOT NULL DEFAULT '0', - "message" varchar(512) NOT NULL DEFAULT '', - "memo" varchar(512) DEFAULT '', - "creator" varchar(64) DEFAULT '', - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updater" varchar(64) DEFAULT '', - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "deleted" bit NOT NULL DEFAULT FALSE, - PRIMARY KEY ("id") -) COMMENT '错误码表'; - -CREATE TABLE IF NOT EXISTS "sys_social_user" ( - "id" number NOT NULL GENERATED BY DEFAULT AS IDENTITY, - "user_id" bigint NOT NULL, - "user_type" tinyint NOT NULL DEFAULT '0', - "type" tinyint NOT NULL, - "openid" varchar(32) NOT NULL, - "token" varchar(256) DEFAULT NULL, - "union_id" varchar(32) NOT NULL, - "raw_token_info" varchar(1024) NOT NULL, - "nickname" varchar(32) NOT NULL, - "avatar" varchar(255) DEFAULT NULL, - "raw_user_info" varchar(1024) NOT NULL, - "creator" varchar(64) DEFAULT '', - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updater" varchar(64) DEFAULT '', - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "deleted" bit NOT NULL DEFAULT FALSE, - PRIMARY KEY ("id") -) COMMENT '社交用户'; - -CREATE TABLE IF NOT EXISTS "sys_tenant" ( - "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, - "name" varchar(63) NOT NULL, - "contact_name" varchar(255) NOT NULL, - "contact_mobile" varchar(255), - "status" tinyint NOT NULL, - "creator" varchar(64) DEFAULT '', - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updater" varchar(64) DEFAULT '', - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "deleted" bit NOT NULL DEFAULT FALSE, - PRIMARY KEY ("id") -) COMMENT '租户'; - - CREATE TABLE IF NOT EXISTS "pay_merchant" ( "id" number NOT NULL GENERATED BY DEFAULT AS IDENTITY, diff --git a/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthCheckCodeReqVO.java b/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthCheckCodeReqVO.java index 63b113e0a..dd050147e 100644 --- a/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthCheckCodeReqVO.java +++ b/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthCheckCodeReqVO.java @@ -34,7 +34,7 @@ public class AppAuthCheckCodeReqVO { @Pattern(regexp = "^[0-9]+$", message = "手机验证码必须都是数字") private String code; - @ApiModelProperty(value = "发送场景", example = "1", notes = "对应 MbrSmsSceneEnum 枚举") + @ApiModelProperty(value = "发送场景", example = "1", notes = "对应 SmsSceneEnum 枚举") @NotNull(message = "发送场景不能为空") @InEnum(SmsSceneEnum.class) private Integer scene; diff --git a/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSendSmsReqVO.java b/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSendSmsReqVO.java index 91656b1d4..b8c4824d1 100644 --- a/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSendSmsReqVO.java +++ b/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSendSmsReqVO.java @@ -19,7 +19,7 @@ public class AppAuthSendSmsReqVO { @Mobile private String mobile; - @ApiModelProperty(value = "发送场景", example = "1", notes = "对应 MbrSmsSceneEnum 枚举") + @ApiModelProperty(value = "发送场景", example = "1", notes = "对应 SmsSceneEnum 枚举") @NotNull(message = "发送场景不能为空") @InEnum(SmsSceneEnum.class) private Integer scene; diff --git a/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java b/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java index 89a24de60..5fd8db9b9 100644 --- a/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java +++ b/yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java @@ -281,9 +281,8 @@ public class MemberAuthServiceImpl implements MemberAuthService { MemberUserDO userDO = checkOldPassword(userId, reqVO.getOldPassword()); // 更新用户密码 - MemberUserDO mbrUserDO = MemberUserDO.builder().id(userDO.getId()) - .password(passwordEncoder.encode(reqVO.getPassword())).build(); - userMapper.updateById(mbrUserDO); + userMapper.updateById(MemberUserDO.builder().id(userDO.getId()) + .password(passwordEncoder.encode(reqVO.getPassword())).build()); } @Override @@ -296,10 +295,8 @@ public class MemberAuthServiceImpl implements MemberAuthService { getClientIP())); // 更新密码 - MemberUserDO mbrUserDO = MemberUserDO.builder().build(); - mbrUserDO.setId(userDO.getId()); - mbrUserDO.setPassword(passwordEncoder.encode(reqVO.getPassword())); - userMapper.updateById(mbrUserDO); + userMapper.updateById(MemberUserDO.builder().id(userDO.getId()) + .password(passwordEncoder.encode(reqVO.getPassword())).build()); } @Override diff --git a/yudao-module-member/yudao-module-member-impl/src/test/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceTest.java b/yudao-module-member/yudao-module-member-impl/src/test/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceTest.java index 7e9b4648f..3b17af712 100644 --- a/yudao-module-member/yudao-module-member-impl/src/test/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceTest.java +++ b/yudao-module-member/yudao-module-member-impl/src/test/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceTest.java @@ -53,7 +53,7 @@ public class MemberAuthServiceTest extends BaseDbAndRedisUnitTest { @MockBean private PasswordEncoder passwordEncoder; @Resource - private MemberUserMapper mbrUserMapper; + private MemberUserMapper memberUserMapper; @Resource private MemberAuthServiceImpl authService; @@ -61,7 +61,7 @@ public class MemberAuthServiceTest extends BaseDbAndRedisUnitTest { public void testUpdatePassword_success(){ // 准备参数 MemberUserDO userDO = randomUserDO(); - mbrUserMapper.insert(userDO); + memberUserMapper.insert(userDO); // 新密码 String newPassword = randomString(); @@ -79,14 +79,14 @@ public class MemberAuthServiceTest extends BaseDbAndRedisUnitTest { // 更新用户密码 authService.updatePassword(userDO.getId(), reqVO); - assertEquals(mbrUserMapper.selectById(userDO.getId()).getPassword(),newPassword); + assertEquals(memberUserMapper.selectById(userDO.getId()).getPassword(),newPassword); } @Test public void testResetPassword_success(){ // 准备参数 MemberUserDO userDO = randomUserDO(); - mbrUserMapper.insert(userDO); + memberUserMapper.insert(userDO); // 随机密码 String password = randomNumbers(11); @@ -103,7 +103,7 @@ public class MemberAuthServiceTest extends BaseDbAndRedisUnitTest { reqVO.setCode(code); authService.resetPassword(reqVO); - assertEquals(mbrUserMapper.selectById(userDO.getId()).getPassword(),password); + assertEquals(memberUserMapper.selectById(userDO.getId()).getPassword(),password); } diff --git a/yudao-module-member/yudao-module-member-impl/src/test/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImplTest.java b/yudao-module-member/yudao-module-member-impl/src/test/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImplTest.java index 59a771047..f470e95ae 100644 --- a/yudao-module-member/yudao-module-member-impl/src/test/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImplTest.java +++ b/yudao-module-member/yudao-module-member-impl/src/test/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImplTest.java @@ -37,7 +37,7 @@ import static org.mockito.Mockito.*; public class MemberUserServiceImplTest extends BaseDbAndRedisUnitTest { @Resource - private MemberUserServiceImpl mbrUserService; + private MemberUserServiceImpl memberUserService; @Resource private StringRedisTemplate stringRedisTemplate; @@ -67,9 +67,9 @@ public class MemberUserServiceImplTest extends BaseDbAndRedisUnitTest { String newNickName = randomString(); // 调用接口修改昵称 - mbrUserService.updateUserNickname(userDO.getId(),newNickName); + memberUserService.updateUserNickname(userDO.getId(),newNickName); // 查询新修改后的昵称 - String nickname = mbrUserService.getUser(userDO.getId()).getNickname(); + String nickname = memberUserService.getUser(userDO.getId()).getNickname(); // 断言 assertEquals(newNickName,nickname); } @@ -88,7 +88,7 @@ public class MemberUserServiceImplTest extends BaseDbAndRedisUnitTest { String avatar = randomString(); when(fileCoreService.createFile(anyString(), eq(avatarFileBytes))).thenReturn(avatar); // 调用 - String str = mbrUserService.updateUserAvatar(userId, avatarFile); + String str = memberUserService.updateUserAvatar(userId, avatarFile); // 断言 assertEquals(avatar, str); } @@ -119,9 +119,9 @@ public class MemberUserServiceImplTest extends BaseDbAndRedisUnitTest { reqVO.setCode(newCode); reqVO.setOldMobile(oldMobile); reqVO.setOldCode(oldCode); - mbrUserService.updateUserMobile(userDO.getId(),reqVO); + memberUserService.updateUserMobile(userDO.getId(),reqVO); - assertEquals(mbrUserService.getUser(userDO.getId()).getMobile(),newMobile); + assertEquals(memberUserService.getUser(userDO.getId()).getMobile(),newMobile); } // ========== 随机对象 ========== diff --git a/yudao-module-member/yudao-module-member-impl/src/test/resources/application-unit-test.yaml b/yudao-module-member/yudao-module-member-impl/src/test/resources/application-unit-test.yaml index 237068e6e..212a9312b 100644 --- a/yudao-module-member/yudao-module-member-impl/src/test/resources/application-unit-test.yaml +++ b/yudao-module-member/yudao-module-member-impl/src/test/resources/application-unit-test.yaml @@ -45,5 +45,7 @@ mybatis: yudao: info: base-package: cn.iocoder.yudao.module.member.dal.mysql + member-package: cn.iocoder.yudao.module.member # TODO 芋艿:要清理掉 + system-package: cn.iocoder.yudao.module.system # TODO 芋艿:要清理掉 core-service: base-package: cn.iocoder.yudao.module.member.dal.mysql # TODO 芋艿:要清理掉 diff --git a/yudao-module-member/yudao-module-member-impl/src/test/resources/sql/clean.sql b/yudao-module-member/yudao-module-member-impl/src/test/resources/sql/clean.sql index 9775e2454..92f559dc1 100644 --- a/yudao-module-member/yudao-module-member-impl/src/test/resources/sql/clean.sql +++ b/yudao-module-member/yudao-module-member-impl/src/test/resources/sql/clean.sql @@ -1,2 +1 @@ --- mbr 开头的 DB DELETE FROM "member_user"; diff --git a/yudao-module-member/yudao-module-member-impl/src/test/resources/sql/create_tables.sql b/yudao-module-member/yudao-module-member-impl/src/test/resources/sql/create_tables.sql index 98d3d2bc1..85925f30b 100644 --- a/yudao-module-member/yudao-module-member-impl/src/test/resources/sql/create_tables.sql +++ b/yudao-module-member/yudao-module-member-impl/src/test/resources/sql/create_tables.sql @@ -1,4 +1,3 @@ --- mbr 开头的 DB CREATE TABLE IF NOT EXISTS "member_user" ( "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY COMMENT '编号', "nickname" varchar(30) NOT NULL DEFAULT '' COMMENT '用户昵称', diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java index 2acc39fcc..8c45215a4 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java @@ -50,7 +50,7 @@ public class AuthController { @Resource private PermissionService permissionService; @Resource - private SocialUserService socialCoreService; + private SocialUserService socialUserService; @PostMapping("/login") @ApiOperation("使用账号密码登录") @@ -102,7 +102,7 @@ public class AuthController { }) public CommonResult socialAuthRedirect(@RequestParam("type") Integer type, @RequestParam("redirectUri") String redirectUri) { - return CommonResult.success(socialCoreService.getAuthorizeUrl(type, redirectUri)); + return CommonResult.success(socialUserService.getAuthorizeUrl(type, redirectUri)); } @PostMapping("/social-login") @@ -133,7 +133,7 @@ public class AuthController { @DeleteMapping("/social-unbind") @ApiOperation("取消社交绑定") public CommonResult socialUnbind(@RequestBody AuthSocialUnbindReqVO reqVO) { - socialCoreService.unbindSocialUser(getLoginUserId(), UserTypeEnum.ADMIN.getValue(), reqVO.getType(), reqVO.getUnionId()); + socialUserService.unbindSocialUser(getLoginUserId(), UserTypeEnum.ADMIN.getValue(), reqVO.getType(), reqVO.getUnionId()); return CommonResult.success(true); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/UserSessionController.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/UserSessionController.java index 0b0f5096e..00150fd8b 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/UserSessionController.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/UserSessionController.java @@ -3,9 +3,9 @@ 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.module.system.dal.dataobject.dept.SysDeptDO; +import cn.iocoder.yudao.module.system.dal.dataobject.auth.UserSessionDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; import cn.iocoder.yudao.module.system.service.auth.UserSessionService; -import cn.iocoder.yudao.module.system.dal.dataobject.auth.SysUserSessionDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; @@ -45,12 +45,12 @@ public class UserSessionController { @PreAuthorize("@ss.hasPermission('system:user-session:page')") public CommonResult> getUserSessionPage(@Validated UserSessionPageReqVO reqVO) { // 获得 Session 分页 - PageResult pageResult = userSessionService.getUserSessionPage(reqVO); + PageResult pageResult = userSessionService.getUserSessionPage(reqVO); // 获得拼接需要的数据 Map userMap = userService.getUserMap( - convertList(pageResult.getList(), SysUserSessionDO::getUserId)); - Map deptMap = deptService.getDeptMap( + convertList(pageResult.getList(), UserSessionDO::getUserId)); + Map deptMap = deptService.getDeptMap( convertList(userMap.values(), AdminUserDO::getDeptId)); // 拼接结果返回 List sessionList = new ArrayList<>(pageResult.getList().size()); diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/auth/AuthSocialBindReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/auth/AuthSocialBindReqVO.java index 5debf6b20..2a83329d8 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/auth/AuthSocialBindReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/auth/AuthSocialBindReqVO.java @@ -19,7 +19,7 @@ import javax.validation.constraints.NotNull; @Builder public class AuthSocialBindReqVO { - @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") + @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 UserSocialTypeEnum 枚举值") @InEnum(SocialTypeEnum.class) @NotNull(message = "社交平台的类型不能为空") private Integer type; diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/auth/AuthSocialLogin2ReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/auth/AuthSocialLogin2ReqVO.java index 90ce2cf88..725a52d8c 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/auth/AuthSocialLogin2ReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/auth/AuthSocialLogin2ReqVO.java @@ -21,7 +21,7 @@ import javax.validation.constraints.Pattern; @Builder public class AuthSocialLogin2ReqVO { - @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") + @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 UserSocialTypeEnum 枚举值") @InEnum(SocialTypeEnum.class) @NotNull(message = "社交平台的类型不能为空") private Integer type; diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/auth/AuthSocialLoginReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/auth/AuthSocialLoginReqVO.java index bc1247d67..4f51bcb98 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/auth/AuthSocialLoginReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/auth/AuthSocialLoginReqVO.java @@ -19,7 +19,7 @@ import javax.validation.constraints.NotNull; @Builder public class AuthSocialLoginReqVO { - @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") + @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 UserSocialTypeEnum 枚举值") @InEnum(SocialTypeEnum.class) @NotNull(message = "社交平台的类型不能为空") private Integer type; diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/auth/AuthSocialUnbindReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/auth/AuthSocialUnbindReqVO.java index eb43a2d27..774602681 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/auth/AuthSocialUnbindReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/auth/AuthSocialUnbindReqVO.java @@ -19,7 +19,7 @@ import javax.validation.constraints.NotNull; @Builder public class AuthSocialUnbindReqVO { - @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") + @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 UserSocialTypeEnum 枚举值") @InEnum(SocialTypeEnum.class) @NotNull(message = "社交平台的类型不能为空") private Integer type; diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java index 1a4da72be..0a292e243 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java @@ -4,7 +4,7 @@ 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.module.system.dal.dataobject.dept.SysDeptDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; import cn.iocoder.yudao.module.system.service.dept.DeptService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -58,8 +58,8 @@ public class DeptController { @ApiOperation("获取部门列表") @PreAuthorize("@ss.hasPermission('system:dept:query')") public CommonResult> listDepts(DeptListReqVO reqVO) { - List list = deptService.getSimpleDepts(reqVO); - list.sort(Comparator.comparing(SysDeptDO::getSort)); + List list = deptService.getSimpleDepts(reqVO); + list.sort(Comparator.comparing(DeptDO::getSort)); return success(DeptConvert.INSTANCE.convertList(list)); } @@ -69,9 +69,9 @@ public class DeptController { // 获得部门列表,只要开启状态的 DeptListReqVO reqVO = new DeptListReqVO(); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - List list = deptService.getSimpleDepts(reqVO); + List list = deptService.getSimpleDepts(reqVO); // 排序后,返回给前端 - list.sort(Comparator.comparing(SysDeptDO::getSort)); + list.sort(Comparator.comparing(DeptDO::getSort)); return success(DeptConvert.INSTANCE.convertList02(list)); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/PostController.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/PostController.java index e5b179e32..5275dc0c4 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/PostController.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/PostController.java @@ -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.module.system.dal.dataobject.dept.SysPostDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; import cn.iocoder.yudao.module.system.service.dept.PostService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -72,9 +72,9 @@ public class PostController { @ApiOperation(value = "获取岗位精简信息列表", notes = "只包含被开启的岗位,主要用于前端的下拉选项") public CommonResult> getSimplePosts() { // 获得岗位列表,只要开启状态的 - List list = postService.getPosts(null, Collections.singleton(CommonStatusEnum.ENABLE.getStatus())); + List list = postService.getPosts(null, Collections.singleton(CommonStatusEnum.ENABLE.getStatus())); // 排序后,返回给前端 - list.sort(Comparator.comparing(SysPostDO::getSort)); + list.sort(Comparator.comparing(PostDO::getSort)); return success(PostConvert.INSTANCE.convertList02(list)); } @@ -90,7 +90,7 @@ public class PostController { @PreAuthorize("@ss.hasPermission('system:post:export')") @OperateLog(type = EXPORT) public void export(HttpServletResponse response, @Validated PostExportReqVO reqVO) throws IOException { - List posts = postService.getPosts(reqVO); + List posts = postService.getPosts(reqVO); List data = PostConvert.INSTANCE.convertList03(posts); // 输出 ExcelUtils.write(response, "岗位数据.xls", "岗位列表", PostExcelVO.class, data); diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptBaseVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptBaseVO.java index 0661a54f9..2609f9067 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptBaseVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptBaseVO.java @@ -40,7 +40,7 @@ public class DeptBaseVO { @Size(max = 50, message = "邮箱长度不能超过50个字符") private String email; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 SysCommonStatusEnum 枚举") + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举") @NotNull(message = "状态不能为空") // @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") private Integer status; diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptListReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptListReqVO.java index 171788b59..c4ff55243 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptListReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptListReqVO.java @@ -11,7 +11,7 @@ public class DeptListReqVO { @ApiModelProperty(value = "部门名称", example = "芋道", notes = "模糊匹配") private String name; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") private Integer status; } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptRespVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptRespVO.java index db60a3107..072df230a 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptRespVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptRespVO.java @@ -15,7 +15,7 @@ public class DeptRespVO extends DeptBaseVO { @ApiModelProperty(value = "部门编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 SysCommonStatusEnum 枚举类") + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") private Integer status; @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式") diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostBaseVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostBaseVO.java index 700039646..98c1bf212 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostBaseVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostBaseVO.java @@ -28,7 +28,7 @@ public class PostBaseVO { @NotNull(message = "显示顺序不能为空") private Integer sort; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 SysCommonStatusEnum 枚举类") + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") private Integer status; @ApiModelProperty(value = "备注", example = "快乐的备注") diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostExportReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostExportReqVO.java index 182449d95..735bfcce1 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostExportReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostExportReqVO.java @@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -@ApiModel(value = "管理后台 - 岗位导出 Request VO", description = "参数和 SysPostExcelVO 是一致的") +@ApiModel(value = "管理后台 - 岗位导出 Request VO", description = "参数和 PostExcelVO 是一致的") @Data public class PostExportReqVO { @@ -14,7 +14,7 @@ public class PostExportReqVO { @ApiModelProperty(value = "岗位名称", example = "芋道", notes = "模糊匹配") private String name; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") private Integer status; } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostListReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostListReqVO.java index a1369f20f..58ba469e1 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostListReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostListReqVO.java @@ -13,7 +13,7 @@ public class PostListReqVO extends PostBaseVO { @ApiModelProperty(value = "岗位名称", example = "芋道", notes = "模糊匹配") private String name; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") private Integer status; } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostPageReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostPageReqVO.java index 94c6b9eaa..be9ebeab4 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostPageReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostPageReqVO.java @@ -17,7 +17,7 @@ public class PostPageReqVO extends PageParam { @ApiModelProperty(value = "岗位名称", example = "芋道", notes = "模糊匹配") private String name; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") private Integer status; } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/DictDataController.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/DictDataController.java index 08fca2c47..124e5fd05 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/DictDataController.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/DictDataController.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.dict; -import cn.iocoder.yudao.module.system.dal.dataobject.dict.SysDictDataDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; 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; @@ -62,7 +62,7 @@ public class DictDataController { @ApiOperation(value = "获得全部字典数据列表", notes = "一般用于管理后台缓存字典数据在本地") // 无需添加权限认证,因为前端全局都需要 public CommonResult> getSimpleDictDatas() { - List list = dictDataService.getDictDatas(); + List list = dictDataService.getDictDatas(); return success(DictDataConvert.INSTANCE.convertList(list)); } @@ -86,7 +86,7 @@ public class DictDataController { @PreAuthorize("@ss.hasPermission('system:dict:export')") @OperateLog(type = EXPORT) public void export(HttpServletResponse response, @Valid DictDataExportReqVO reqVO) throws IOException { - List list = dictDataService.getDictDatas(reqVO); + List list = dictDataService.getDictDatas(reqVO); List data = DictDataConvert.INSTANCE.convertList02(list); // 输出 ExcelUtils.write(response, "字典数据.xls", "数据列表", DictDataExcelVO.class, data); diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataBaseVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataBaseVO.java index 0292f8437..2cefd83cb 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataBaseVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataBaseVO.java @@ -33,9 +33,9 @@ public class DictDataBaseVO { @Size(max = 100, message = "字典类型长度不能超过100个字符") private String dictType; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 SysCommonStatusEnum 枚举") + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举") @NotNull(message = "状态不能为空") -// @InEnum(value = SysCommonStatusEnum.class, message = "修改状态必须是 {value}") +// @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") private Integer status; @ApiModelProperty(value = "备注", example = "我是一个角色") diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataExportReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataExportReqVO.java index 142d45017..90290cbdb 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataExportReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataExportReqVO.java @@ -18,7 +18,7 @@ public class DictDataExportReqVO { @Size(max = 100, message = "字典类型类型长度不能超过100个字符") private String dictType; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") private Integer status; } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataPageReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataPageReqVO.java index a095aac08..9df4605df 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataPageReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataPageReqVO.java @@ -21,7 +21,7 @@ public class DictDataPageReqVO extends PageParam { @Size(max = 100, message = "字典类型类型长度不能超过100个字符") private String dictType; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") private Integer status; } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeExportReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeExportReqVO.java index b2f3331b8..1043a1e72 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeExportReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeExportReqVO.java @@ -19,7 +19,7 @@ public class DictTypeExportReqVO { @ApiModelProperty(value = "字典类型", example = "sys_common_sex", notes = "模糊匹配") private String type; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") private Integer status; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypePageReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypePageReqVO.java index 1c231b0d2..84635621c 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypePageReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypePageReqVO.java @@ -24,7 +24,7 @@ public class DictTypePageReqVO extends PageParam { @Size(max = 100, message = "字典类型类型长度不能超过100个字符") private String type; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") private Integer status; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodePageReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodePageReqVO.java index 70eeda41a..ff3d09833 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodePageReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodePageReqVO.java @@ -18,7 +18,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @ToString(callSuper = true) public class ErrorCodePageReqVO extends PageParam { - @ApiModelProperty(value = "错误码类型", example = "1", notes = "参见 SysErrorCodeTypeEnum 枚举类") + @ApiModelProperty(value = "错误码类型", example = "1", notes = "参见 ErrorCodeTypeEnum 枚举类") private Integer type; @ApiModelProperty(value = "应用名", example = "dashboard") diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeRespVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeRespVO.java index c79b6bf8c..8b5cd3e72 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeRespVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeRespVO.java @@ -17,7 +17,7 @@ public class ErrorCodeRespVO extends ErrorCodeBaseVO { @ApiModelProperty(value = "错误码编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "错误码类型", required = true, example = "1", notes = "参见 SysErrorCodeTypeEnum 枚举类") + @ApiModelProperty(value = "错误码类型", required = true, example = "1", notes = "参见 ErrorCodeTypeEnum 枚举类") private Integer type; @ApiModelProperty(value = "创建时间", required = true) diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/LoginLogController.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/LoginLogController.java index 9890247c8..7cb3ac4b7 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/LoginLogController.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/LoginLogController.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.logger; -import cn.iocoder.yudao.module.system.dal.dataobject.logger.SysLoginLogDO; +import cn.iocoder.yudao.module.system.dal.dataobject.logger.LoginLogDO; 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; @@ -40,7 +40,7 @@ public class LoginLogController { @ApiOperation("获得登录日志分页列表") @PreAuthorize("@ss.hasPermission('system:login-log:query')") public CommonResult> getLoginLogPage(@Valid LoginLogPageReqVO reqVO) { - PageResult page = loginLogService.getLoginLogPage(reqVO); + PageResult page = loginLogService.getLoginLogPage(reqVO); return CommonResult.success(LoginLogConvert.INSTANCE.convertPage(page)); } @@ -49,7 +49,7 @@ public class LoginLogController { @PreAuthorize("@ss.hasPermission('system:login-log:export')") @OperateLog(type = EXPORT) public void exportLoginLog(HttpServletResponse response, @Valid LoginLogExportReqVO reqVO) throws IOException { - List list = loginLogService.getLoginLogList(reqVO); + List list = loginLogService.getLoginLogList(reqVO); // 拼接数据 List data = LoginLogConvert.INSTANCE.convertList(list); // 输出 diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogBaseVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogBaseVO.java index e99657084..e8101f6e9 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogBaseVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogBaseVO.java @@ -15,7 +15,7 @@ import javax.validation.constraints.Size; @Data public class LoginLogBaseVO { - @ApiModelProperty(value = "日志类型", required = true, example = "1", notes = "参见 SysLoginLogTypeEnum 枚举类") + @ApiModelProperty(value = "日志类型", required = true, example = "1", notes = "参见 LoginLogTypeEnum 枚举类") @NotNull(message = "日志类型不能为空") private Integer logType; @@ -28,7 +28,7 @@ public class LoginLogBaseVO { @Size(max = 30, message = "用户账号长度不能超过30个字符") private String username; - @ApiModelProperty(value = "登录结果", required = true, example = "1", notes = "参见 SysLoginResultEnum 枚举类") + @ApiModelProperty(value = "登录结果", required = true, example = "1", notes = "参见 LoginResultEnum 枚举类") @NotNull(message = "登录结果不能为空") private Integer result; diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogBaseVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogBaseVO.java index e66a20e3f..33b367039 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogBaseVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogBaseVO.java @@ -31,7 +31,7 @@ public class OperateLogBaseVO { @NotEmpty(message = "操作名") private String name; - @ApiModelProperty(value = "操作分类", required = true, example = "1", notes = "参见 SysOperateLogTypeEnum 枚举类") + @ApiModelProperty(value = "操作分类", required = true, example = "1", notes = "参见 OperateLogTypeEnum 枚举类") @NotNull(message = "操作分类不能为空") private Integer type; diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogExportReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogExportReqVO.java index 52dc5d99b..90adb822e 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogExportReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogExportReqVO.java @@ -19,7 +19,7 @@ public class OperateLogExportReqVO { @ApiModelProperty(value = "用户昵称", example = "芋道", notes = "模拟匹配") private String userNickname; - @ApiModelProperty(value = "操作分类", example = "1", notes = "参见 SysOperateLogTypeEnum 枚举类") + @ApiModelProperty(value = "操作分类", example = "1", notes = "参见 OperateLogTypeEnum 枚举类") private Integer type; @ApiModelProperty(value = "操作状态", example = "true") diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogPageReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogPageReqVO.java index f94d979f4..0741abd88 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogPageReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogPageReqVO.java @@ -20,7 +20,7 @@ public class OperateLogPageReqVO extends PageParam { @ApiModelProperty(value = "用户昵称", example = "芋道", notes = "模拟匹配") private String userNickname; - @ApiModelProperty(value = "操作分类", example = "1", notes = "参见 SysOperateLogTypeEnum 枚举类") + @ApiModelProperty(value = "操作分类", example = "1", notes = "参见 OperateLogTypeEnum 枚举类") private Integer type; @ApiModelProperty(value = "操作状态", example = "true") diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticeBaseVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticeBaseVO.java index 48d74dd2b..a8ecb7758 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticeBaseVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticeBaseVO.java @@ -26,7 +26,7 @@ public class NoticeBaseVO { @ApiModelProperty(value = "公告内容", required = true, example = "半生编码") private String content; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 SysCommonStatusEnum 枚举类") + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") private Integer status; } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticePageReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticePageReqVO.java index 570d53005..ba1287c47 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticePageReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticePageReqVO.java @@ -14,7 +14,7 @@ public class NoticePageReqVO extends PageParam { @ApiModelProperty(value = "通知公告名称", example = "芋道", notes = "模糊匹配") private String title; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") private Integer status; } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuBaseVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuBaseVO.java index 8769f3a1b..bbed03caa 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuBaseVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuBaseVO.java @@ -23,7 +23,7 @@ public class MenuBaseVO { @Size(max = 100) private String permission; - @ApiModelProperty(value = "类型", required = true, example = "1", notes = "参见 SysMenuTypeEnum 枚举类") + @ApiModelProperty(value = "类型", required = true, example = "1", notes = "参见 MenuTypeEnum 枚举类") @NotNull(message = "菜单类型不能为空") private Integer type; @@ -46,7 +46,7 @@ public class MenuBaseVO { @Size(max = 200, message = "组件路径不能超过255个字符") private String component; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 SysCommonStatusEnum 枚举") + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举") @NotNull(message = "状态不能为空") private Integer status; diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuListReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuListReqVO.java index 53b0b46a9..2600fb92b 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuListReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuListReqVO.java @@ -11,7 +11,7 @@ public class MenuListReqVO { @ApiModelProperty(value = "菜单名称", example = "芋道", notes = "模糊匹配") private String name; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") private Integer status; } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuRespVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuRespVO.java index 9fe9e12f5..34d70f4f5 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuRespVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuRespVO.java @@ -19,7 +19,7 @@ public class MenuRespVO extends MenuBaseVO { @ApiModelProperty(value = "菜单编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 SysCommonStatusEnum 枚举类") + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") private Integer status; @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式") diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/permission/PermissionAssignRoleDataScopeReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/permission/PermissionAssignRoleDataScopeReqVO.java index 0683ba9b8..6adb8c854 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/permission/PermissionAssignRoleDataScopeReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/permission/PermissionAssignRoleDataScopeReqVO.java @@ -16,7 +16,7 @@ public class PermissionAssignRoleDataScopeReqVO { @NotNull(message = "角色编号不能为空") private Long roleId; - @ApiModelProperty(value = "数据范围", required = true, example = "1", notes = "参见 SysDataScopeEnum 枚举类") + @ApiModelProperty(value = "数据范围", required = true, example = "1", notes = "参见 DataScopeEnum 枚举类") @NotNull(message = "数据范围不能为空") // TODO 这里要多一个枚举校验 private Integer dataScope; diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleBaseVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleBaseVO.java index 3f027f8dc..66b4d2053 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleBaseVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleBaseVO.java @@ -28,7 +28,7 @@ public class RoleBaseVO { @NotNull(message = "显示顺序不能为空") private Integer sort; - @ApiModelProperty(value = "角色类型", required = true, example = "1", notes = "见 SysRoleTypeEnum 枚举") + @ApiModelProperty(value = "角色类型", required = true, example = "1", notes = "见 RoleTypeEnum 枚举") private Integer type; @ApiModelProperty(value = "备注", example = "我是一个角色") diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleExportReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleExportReqVO.java index 339a22ba8..02e47ac6f 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleExportReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleExportReqVO.java @@ -19,7 +19,7 @@ public class RoleExportReqVO { @ApiModelProperty(value = "角色标识", example = "yudao", notes = "模糊匹配") private String code; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") private Integer status; @ApiModelProperty(value = "开始时间", example = "2020-10-24") diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RolePageReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RolePageReqVO.java index d2fed80e5..2f4cc1858 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RolePageReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RolePageReqVO.java @@ -22,7 +22,7 @@ public class RolePageReqVO extends PageParam { @ApiModelProperty(value = "角色标识", example = "yudao", notes = "模糊匹配") private String code; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") private Integer status; @ApiModelProperty(value = "开始时间", example = "2020-10-24") diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleRespVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleRespVO.java index e7c0e2c3c..31acbedcd 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleRespVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleRespVO.java @@ -26,10 +26,10 @@ public class RoleRespVO extends RoleBaseVO { @ApiModelProperty(value = "数据范围(指定部门数组)", example = "1") private Set dataScopeDeptIds; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 SysCommonStatusEnum 枚举类") + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") private Integer status; - @ApiModelProperty(value = "角色类型", required = true, example = "1", notes = "参见 SysRoleTypeEnum 枚举类") + @ApiModelProperty(value = "角色类型", required = true, example = "1", notes = "参见 RoleTypeEnum 枚举类") private Integer type; @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式") diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleUpdateStatusReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleUpdateStatusReqVO.java index 75a658c7a..708586b82 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleUpdateStatusReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleUpdateStatusReqVO.java @@ -1,7 +1,5 @@ package cn.iocoder.yudao.module.system.controller.admin.permission.vo.role; -import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; -import cn.iocoder.yudao.framework.common.validation.InEnum; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -16,7 +14,7 @@ public class RoleUpdateStatusReqVO { @NotNull(message = "角色编号不能为空") private Long id; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 SysCommonStatusEnum 枚举") + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举") @NotNull(message = "状态不能为空") // @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") private Integer status; diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsCallbackController.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsCallbackController.java index 8125f0728..a8b4ee8d1 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsCallbackController.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsCallbackController.java @@ -25,7 +25,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; public class SmsCallbackController { @Resource - private SmsSendService smsCoreService; + private SmsSendService smsSendService; @PostMapping("/sms/yunpian") @ApiOperation(value = "云片短信的回调", notes = "参见 https://www.yunpian.com/official/document/sms/zh_cn/domestic_push_report 文档") @@ -33,7 +33,7 @@ public class SmsCallbackController { @OperateLog(enable = false) public String receiveYunpianSmsStatus(@RequestParam("sms_status") String smsStatus) throws Throwable { String text = URLUtil.decode(smsStatus); // decode 解码参数,因为它被 encode - smsCoreService.receiveSmsStatus(SmsChannelEnum.YUN_PIAN.getCode(), text); + smsSendService.receiveSmsStatus(SmsChannelEnum.YUN_PIAN.getCode(), text); return "SUCCESS"; // 约定返回 SUCCESS 为成功 } @@ -42,7 +42,7 @@ public class SmsCallbackController { @OperateLog(enable = false) public CommonResult receiveAliyunSmsStatus(HttpServletRequest request) throws Throwable { String text = ServletUtil.getBody(request); - smsCoreService.receiveSmsStatus(SmsChannelEnum.ALIYUN.getCode(), text); + smsSendService.receiveSmsStatus(SmsChannelEnum.ALIYUN.getCode(), text); return success(true); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsChannelController.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsChannelController.java index 4774fcf59..638140d21 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsChannelController.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsChannelController.java @@ -2,8 +2,8 @@ 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.dal.dataobject.sms.SmsChannelDO; import cn.iocoder.yudao.module.system.service.sms.SmsChannelService; -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; @@ -56,7 +56,7 @@ public class SmsChannelController { @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) @PreAuthorize("@ss.hasPermission('system:sms-channel:query')") public CommonResult getSmsChannel(@RequestParam("id") Long id) { - SysSmsChannelDO smsChannel = smsChannelService.getSmsChannel(id); + SmsChannelDO smsChannel = smsChannelService.getSmsChannel(id); return success(SmsChannelConvert.INSTANCE.convert(smsChannel)); } @@ -64,16 +64,16 @@ public class SmsChannelController { @ApiOperation("获得短信渠道分页") @PreAuthorize("@ss.hasPermission('system:sms-channel:query')") public CommonResult> getSmsChannelPage(@Valid SmsChannelPageReqVO pageVO) { - PageResult pageResult = smsChannelService.getSmsChannelPage(pageVO); + PageResult pageResult = smsChannelService.getSmsChannelPage(pageVO); return success(SmsChannelConvert.INSTANCE.convertPage(pageResult)); } @GetMapping("/list-all-simple") @ApiOperation(value = "获得短信渠道精简列表", notes = "包含被禁用的短信渠道") public CommonResult> getSimpleSmsChannels() { - List list = smsChannelService.getSmsChannelList(); + List list = smsChannelService.getSmsChannelList(); // 排序后,返回给前端 - list.sort(Comparator.comparing(SysSmsChannelDO::getId)); + list.sort(Comparator.comparing(SmsChannelDO::getId)); return success(SmsChannelConvert.INSTANCE.convertList03(list)); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsLogController.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsLogController.java index ef93cfc3d..5fbf10e74 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsLogController.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsLogController.java @@ -3,10 +3,10 @@ package cn.iocoder.yudao.module.system.controller.admin.sms; import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogExcelVO; 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.module.system.controller.admin.sms.vo.log.SysSmsLogRespVO; +import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogRespVO; import cn.iocoder.yudao.module.system.convert.sms.SmsLogConvert; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsLogDO; import cn.iocoder.yudao.module.system.service.sms.SmsLogService; -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; @@ -40,8 +40,8 @@ public class SmsLogController { @GetMapping("/page") @ApiOperation("获得短信日志分页") @PreAuthorize("@ss.hasPermission('system:sms-log:query')") - public CommonResult> getSmsLogPage(@Valid SmsLogPageReqVO pageVO) { - PageResult pageResult = smsLogService.getSmsLogPage(pageVO); + public CommonResult> getSmsLogPage(@Valid SmsLogPageReqVO pageVO) { + PageResult pageResult = smsLogService.getSmsLogPage(pageVO); return success(SmsLogConvert.INSTANCE.convertPage(pageResult)); } @@ -51,7 +51,7 @@ public class SmsLogController { @OperateLog(type = EXPORT) public void exportSmsLogExcel(@Valid SmsLogExportReqVO exportReqVO, HttpServletResponse response) throws IOException { - List list = smsLogService.getSmsLogList(exportReqVO); + List list = smsLogService.getSmsLogList(exportReqVO); // 导出 Excel List datas = SmsLogConvert.INSTANCE.convertList02(list); ExcelUtils.write(response, "短信日志.xls", "数据", SmsLogExcelVO.class, datas); diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsTemplateController.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsTemplateController.java index d56514314..3eef58652 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsTemplateController.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsTemplateController.java @@ -2,8 +2,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.dal.dataobject.sms.SmsTemplateDO; import cn.iocoder.yudao.module.system.service.sms.SmsTemplateService; -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsTemplateDO; import cn.iocoder.yudao.module.system.service.sms.SmsSendService; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; @@ -32,7 +32,7 @@ public class SmsTemplateController { @Resource private SmsTemplateService smsTemplateService; @Resource - private SmsSendService smsCoreService; + private SmsSendService smsSendService; @PostMapping("/create") @ApiOperation("创建短信模板") @@ -63,7 +63,7 @@ public class SmsTemplateController { @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) @PreAuthorize("@ss.hasPermission('system:sms-template:query')") public CommonResult getSmsTemplate(@RequestParam("id") Long id) { - SysSmsTemplateDO smsTemplate = smsTemplateService.getSmsTemplate(id); + SmsTemplateDO smsTemplate = smsTemplateService.getSmsTemplate(id); return success(SmsTemplateConvert.INSTANCE.convert(smsTemplate)); } @@ -71,7 +71,7 @@ public class SmsTemplateController { @ApiOperation("获得短信模板分页") @PreAuthorize("@ss.hasPermission('system:sms-template:query')") public CommonResult> getSmsTemplatePage(@Valid SmsTemplatePageReqVO pageVO) { - PageResult pageResult = smsTemplateService.getSmsTemplatePage(pageVO); + PageResult pageResult = smsTemplateService.getSmsTemplatePage(pageVO); return success(SmsTemplateConvert.INSTANCE.convertPage(pageResult)); } @@ -81,7 +81,7 @@ public class SmsTemplateController { @OperateLog(type = EXPORT) public void exportSmsTemplateExcel(@Valid SmsTemplateExportReqVO exportReqVO, HttpServletResponse response) throws IOException { - List list = smsTemplateService.getSmsTemplateList(exportReqVO); + List list = smsTemplateService.getSmsTemplateList(exportReqVO); // 导出 Excel List datas = SmsTemplateConvert.INSTANCE.convertList02(list); ExcelUtils.write(response, "短信模板.xls", "数据", SmsTemplateExcelVO.class, datas); @@ -91,7 +91,7 @@ public class SmsTemplateController { @ApiOperation("发送短信") @PreAuthorize("@ss.hasPermission('system:sms-template:send-sms')") public CommonResult sendSms(@Valid @RequestBody SmsTemplateSendReqVO sendReqVO) { - return success(smsCoreService.sendSingleSmsToAdmin(sendReqVO.getMobile(), null, + return success(smsSendService.sendSingleSmsToAdmin(sendReqVO.getMobile(), null, sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams())); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogExportReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogExportReqVO.java index 7a57aa2ed..6754b43b2 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogExportReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogExportReqVO.java @@ -9,7 +9,7 @@ import java.util.Date; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel(value = "管理后台 - 短信日志 Excel 导出 Request VO", description = "参数和 SysSmsLogPageReqVO 是一致的") +@ApiModel(value = "管理后台 - 短信日志 Excel 导出 Request VO", description = "参数和 SmsLogPageReqVO 是一致的") @Data public class SmsLogExportReqVO { diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogPageReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogPageReqVO.java index 358427e82..767201f81 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogPageReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogPageReqVO.java @@ -27,7 +27,7 @@ public class SmsLogPageReqVO extends PageParam { @ApiModelProperty(value = "手机号", example = "15601691300") private String mobile; - @ApiModelProperty(value = "发送状态", example = "1", notes = "参见 SysSmsSendStatusEnum 枚举类") + @ApiModelProperty(value = "发送状态", example = "1", notes = "参见 SmsSendStatusEnum 枚举类") private Integer sendStatus; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @@ -38,7 +38,7 @@ public class SmsLogPageReqVO extends PageParam { @ApiModelProperty(value = "结束发送时间") private Date endSendTime; - @ApiModelProperty(value = "接收状态", example = "0", notes = "参见 SysSmsReceiveStatusEnum 枚举类") + @ApiModelProperty(value = "接收状态", example = "0", notes = "参见 SmsReceiveStatusEnum 枚举类") private Integer receiveStatus; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SysSmsLogRespVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogRespVO.java similarity index 99% rename from yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SysSmsLogRespVO.java rename to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogRespVO.java index 7377fc1e5..e179f4a5e 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SysSmsLogRespVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogRespVO.java @@ -9,7 +9,7 @@ import java.util.Map; @ApiModel("管理后台 - 短信日志 Response VO") @Data -public class SysSmsLogRespVO { +public class SmsLogRespVO { @ApiModelProperty(value = "编号", required = true, example = "1024") private Long id; diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateBaseVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateBaseVO.java index 9b16fa851..ca9220f8a 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateBaseVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateBaseVO.java @@ -12,7 +12,7 @@ import javax.validation.constraints.NotNull; @Data public class SmsTemplateBaseVO { - @ApiModelProperty(value = "短信类型", required = true, example = "1", notes = "参见 SysSmsTemplateTypeEnum 枚举类") + @ApiModelProperty(value = "短信类型", required = true, example = "1", notes = "参见 SmsTemplateTypeEnum 枚举类") @NotNull(message = "短信类型不能为空") private Integer type; diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateExportReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateExportReqVO.java index 099be029f..e775e4c70 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateExportReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateExportReqVO.java @@ -9,7 +9,7 @@ import java.util.Date; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel(value = "管理后台 - 短信模板 Excel 导出 Request VO", description = "参数和 SysSmsTemplatePageReqVO 是一致的") +@ApiModel(value = "管理后台 - 短信模板 Excel 导出 Request VO", description = "参数和 SmsTemplatePageReqVO 是一致的") @Data public class SmsTemplateExportReqVO { diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/TenantController.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/TenantController.java index bd2fcb430..50d893f6b 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/TenantController.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/TenantController.java @@ -2,8 +2,8 @@ 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.dal.dataobject.tenant.TenantDO; import cn.iocoder.yudao.module.system.service.tenant.TenantService; -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; @@ -36,7 +36,7 @@ public class TenantController { @ApiOperation(value = "使用租户名,获得租户编号", notes = "登录界面,根据用户的租户名,获得租户编号") @ApiImplicitParam(name = "name", value = "租户名", required = true, example = "芋道源码", dataTypeClass = Long.class) public CommonResult getTenantIdByName(@RequestParam("name") String name) { - SysTenantDO tenantDO = tenantService.getTenantByName(name); + TenantDO tenantDO = tenantService.getTenantByName(name); return success(tenantDO != null ? tenantDO.getId() : null); } @@ -69,7 +69,7 @@ public class TenantController { @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) @PreAuthorize("@ss.hasPermission('system:tenant:query')") public CommonResult getTenant(@RequestParam("id") Long id) { - SysTenantDO tenant = tenantService.getTenant(id); + TenantDO tenant = tenantService.getTenant(id); return success(TenantConvert.INSTANCE.convert(tenant)); } @@ -78,7 +78,7 @@ public class TenantController { @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) @PreAuthorize("@ss.hasPermission('system:tenant:query')") public CommonResult> getTenantList(@RequestParam("ids") Collection ids) { - List list = tenantService.getTenantList(ids); + List list = tenantService.getTenantList(ids); return success(TenantConvert.INSTANCE.convertList(list)); } @@ -86,7 +86,7 @@ public class TenantController { @ApiOperation("获得租户分页") @PreAuthorize("@ss.hasPermission('system:tenant:query')") public CommonResult> getTenantPage(@Valid TenantPageReqVO pageVO) { - PageResult pageResult = tenantService.getTenantPage(pageVO); + PageResult pageResult = tenantService.getTenantPage(pageVO); return success(TenantConvert.INSTANCE.convertPage(pageResult)); } @@ -96,7 +96,7 @@ public class TenantController { @OperateLog(type = EXPORT) public void exportTenantExcel(@Valid TenantExportReqVO exportReqVO, HttpServletResponse response) throws IOException { - List list = tenantService.getTenantList(exportReqVO); + List list = tenantService.getTenantList(exportReqVO); // 导出 Excel List datas = TenantConvert.INSTANCE.convertList02(list); ExcelUtils.write(response, "租户.xls", "数据", TenantExcelVO.class, datas); diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/TenantExportReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/TenantExportReqVO.java index afe5e6700..839239406 100755 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/TenantExportReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/TenantExportReqVO.java @@ -9,7 +9,7 @@ import java.util.Date; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel(value = "管理后台 - 租户 Excel 导出 Request VO", description = "参数和 SysTenantPageReqVO 是一致的") +@ApiModel(value = "管理后台 - 租户 Excel 导出 Request VO", description = "参数和 TenantPageReqVO 是一致的") @Data public class TenantExportReqVO { diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java index 7afe691a2..fbba57730 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java @@ -3,11 +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.module.system.dal.dataobject.dept.SysDeptDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.service.dept.DeptService; import cn.iocoder.yudao.module.system.service.user.AdminUserService; -import cn.iocoder.yudao.module.system.enums.common.SysSexEnum; +import cn.iocoder.yudao.module.system.enums.common.SexEnum; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; @@ -98,7 +98,7 @@ public class UserController { // 获得拼接需要的数据 Collection deptIds = convertList(pageResult.getList(), AdminUserDO::getDeptId); - Map deptMap = deptService.getDeptMap(deptIds); + Map deptMap = deptService.getDeptMap(deptIds); // 拼接结果返回 List userList = new ArrayList<>(pageResult.getList().size()); pageResult.getList().forEach(user -> { @@ -137,9 +137,9 @@ public class UserController { // 获得拼接需要的数据 Collection deptIds = convertList(users, AdminUserDO::getDeptId); - Map deptMap = deptService.getDeptMap(deptIds); + Map deptMap = deptService.getDeptMap(deptIds); Map deptLeaderUserMap = userService.getUserMap( - convertSet(deptMap.values(), SysDeptDO::getLeaderUserId)); + convertSet(deptMap.values(), DeptDO::getLeaderUserId)); // 拼接数据 List excelUsers = new ArrayList<>(users.size()); users.forEach(user -> { @@ -164,9 +164,9 @@ public class UserController { // 手动创建导出 demo List list = Arrays.asList( UserImportExcelVO.builder().username("yudao").deptId(1L).email("yudao@iocoder.cn").mobile("15601691300") - .nickname("芋道").status(CommonStatusEnum.ENABLE.getStatus()).sex(SysSexEnum.MALE.getSex()).build(), + .nickname("芋道").status(CommonStatusEnum.ENABLE.getStatus()).sex(SexEnum.MALE.getSex()).build(), UserImportExcelVO.builder().username("yuanma").deptId(2L).email("yuanma@iocoder.cn").mobile("15601701300") - .nickname("源码").status(CommonStatusEnum.DISABLE.getStatus()).sex(SysSexEnum.FEMALE.getSex()).build() + .nickname("源码").status(CommonStatusEnum.DISABLE.getStatus()).sex(SexEnum.FEMALE.getSex()).build() ); // 输出 diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserProfileController.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserProfileController.java index 11d419fea..b46254713 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserProfileController.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserProfileController.java @@ -5,16 +5,16 @@ 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.convert.user.UserConvert; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; +import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.service.dept.DeptService; 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.AdminUserService; -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.dept.PostDO; import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; -import cn.iocoder.yudao.module.system.dal.dataobject.social.SysSocialUserDO; 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; @@ -67,16 +67,16 @@ public class UserProfileController { resp.setRoles(UserConvert.INSTANCE.convertList(userRoles)); // 获得部门信息 if (user.getDeptId() != null) { - SysDeptDO dept = deptService.getDept(user.getDeptId()); + DeptDO dept = deptService.getDept(user.getDeptId()); resp.setDept(UserConvert.INSTANCE.convert02(dept)); } // 获得岗位信息 if (CollUtil.isNotEmpty(user.getPostIds())) { - List posts = postService.getPosts(user.getPostIds()); + List posts = postService.getPosts(user.getPostIds()); resp.setPosts(UserConvert.INSTANCE.convertList02(posts)); } // 获得社交用户信息 - List socialUsers = socialService.getSocialUserList(user.getId(), UserTypeEnum.ADMIN.getValue()); + List socialUsers = socialService.getSocialUserList(user.getId(), UserTypeEnum.ADMIN.getValue()); resp.setSocialUsers(UserConvert.INSTANCE.convertList03(socialUsers)); return success(resp); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/profile/UserProfileRespVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/profile/UserProfileRespVO.java index 788c91feb..c0b77f0f2 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/profile/UserProfileRespVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/profile/UserProfileRespVO.java @@ -22,7 +22,7 @@ public class UserProfileRespVO extends UserBaseVO { @ApiModelProperty(value = "用户编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 SysCommonStatusEnum 枚举类") + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") private Integer status; @ApiModelProperty(value = "最后登录 IP", required = true, example = "192.168.1.1") @@ -93,7 +93,7 @@ public class UserProfileRespVO extends UserBaseVO { @Data public static class SocialUser { - @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysSocialTypeEnum 枚举类") + @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SocialTypeEnum 枚举类") private Integer type; @ApiModelProperty(value = "社交的全局编号", required = true, example = "IPRmJ0wvBptiPIlGEZiPewGwiEiE") diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/profile/UserProfileUpdateReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/profile/UserProfileUpdateReqVO.java index 4f0f8f953..3716f4727 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/profile/UserProfileUpdateReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/profile/UserProfileUpdateReqVO.java @@ -25,7 +25,7 @@ public class UserProfileUpdateReqVO { @Length(min = 11, max = 11, message = "手机号长度必须 11 位") private String mobile; - @ApiModelProperty(value = "用户性别", example = "1", notes = "参见 SysSexEnum 枚举类") + @ApiModelProperty(value = "用户性别", example = "1", notes = "参见 SexEnum 枚举类") private Integer sex; } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserBaseVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserBaseVO.java index a4be1fd8d..985783f0b 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserBaseVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserBaseVO.java @@ -43,10 +43,10 @@ public class UserBaseVO { @Length(min = 11, max = 11, message = "手机号长度必须 11 位") private String mobile; - @ApiModelProperty(value = "用户性别", example = "1", notes = "参见 SysSexEnum 枚举类") + @ApiModelProperty(value = "用户性别", example = "1", notes = "参见 SexEnum 枚举类") private Integer sex; - @ApiModelProperty(value = "用户头像", example = "http://www.iocoder.cn/xxx.png") + @ApiModelProperty(value = "用户头像", example = "https://www.iocoder.cn/xxx.png") private String avatar; } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserExportReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserExportReqVO.java index 1c1044a5c..a25ba0b0f 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserExportReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserExportReqVO.java @@ -11,7 +11,7 @@ import java.util.Date; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel(value = "管理后台 - 用户导出 Request VO", description = "参数和 SysUserPageReqVO 是一致的") +@ApiModel(value = "管理后台 - 用户导出 Request VO", description = "参数和 UserPageReqVO 是一致的") @Data @NoArgsConstructor @AllArgsConstructor @@ -23,7 +23,7 @@ public class UserExportReqVO { @ApiModelProperty(value = "手机号码", example = "yudao", notes = "模糊匹配") private String mobile; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") private Integer status; @ApiModelProperty(value = "开始时间", example = "2020-10-24") diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageReqVO.java index 1c6073d16..00f20eb4d 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageReqVO.java @@ -26,7 +26,7 @@ public class UserPageReqVO extends PageParam { @ApiModelProperty(value = "手机号码", example = "yudao", notes = "模糊匹配") private String mobile; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") private Integer status; @ApiModelProperty(value = "开始时间", example = "2020-10-24") diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserRespVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserRespVO.java index fb50609b0..b4525a555 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserRespVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserRespVO.java @@ -16,7 +16,7 @@ public class UserRespVO extends UserBaseVO { @ApiModelProperty(value = "用户编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 SysCommonStatusEnum 枚举类") + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") private Integer status; @ApiModelProperty(value = "最后登录 IP", required = true, example = "192.168.1.1") diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserUpdateStatusReqVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserUpdateStatusReqVO.java index f72897527..2c7a83f22 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserUpdateStatusReqVO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserUpdateStatusReqVO.java @@ -14,9 +14,9 @@ public class UserUpdateStatusReqVO { @NotNull(message = "角色编号不能为空") private Long id; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 SysCommonStatusEnum 枚举") + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举") @NotNull(message = "状态不能为空") -// @InEnum(value = SysCommonStatusEnum.class, message = "修改状态必须是 {value}") +// @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") private Integer status; } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/auth/UserSessionConvert.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/auth/UserSessionConvert.java index b287d8adc..d30dfdcbb 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/auth/UserSessionConvert.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/auth/UserSessionConvert.java @@ -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.module.system.dal.dataobject.auth.SysUserSessionDO; +import cn.iocoder.yudao.module.system.dal.dataobject.auth.UserSessionDO; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; @@ -10,6 +10,6 @@ public interface UserSessionConvert { UserSessionConvert INSTANCE = Mappers.getMapper(UserSessionConvert.class); - UserSessionPageItemRespVO convert(SysUserSessionDO session); + UserSessionPageItemRespVO convert(UserSessionDO session); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/dept/DeptConvert.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/dept/DeptConvert.java index cd66acd9f..8d921131c 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/dept/DeptConvert.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/dept/DeptConvert.java @@ -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.module.system.dal.dataobject.dept.SysDeptDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; @@ -15,14 +15,14 @@ public interface DeptConvert { DeptConvert INSTANCE = Mappers.getMapper(DeptConvert.class); - List convertList(List list); + List convertList(List list); - List convertList02(List list); + List convertList02(List list); - DeptRespVO convert(SysDeptDO bean); + DeptRespVO convert(DeptDO bean); - SysDeptDO convert(DeptCreateReqVO bean); + DeptDO convert(DeptCreateReqVO bean); - SysDeptDO convert(DeptUpdateReqVO bean); + DeptDO convert(DeptUpdateReqVO bean); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/dept/PostConvert.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/dept/PostConvert.java index d3680dae5..86a548edb 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/dept/PostConvert.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/dept/PostConvert.java @@ -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.module.system.dal.dataobject.dept.SysPostDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; @@ -13,16 +13,16 @@ public interface PostConvert { PostConvert INSTANCE = Mappers.getMapper(PostConvert.class); - List convertList02(List list); + List convertList02(List list); - PageResult convertPage(PageResult page); + PageResult convertPage(PageResult page); - PostRespVO convert(SysPostDO id); + PostRespVO convert(PostDO id); - SysPostDO convert(PostCreateReqVO bean); + PostDO convert(PostCreateReqVO bean); - SysPostDO convert(PostUpdateReqVO reqVO); + PostDO convert(PostUpdateReqVO reqVO); - List convertList03(List list); + List convertList03(List list); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/dict/DictDataConvert.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/dict/DictDataConvert.java index 94f67657f..215f252e7 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/dict/DictDataConvert.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/dict/DictDataConvert.java @@ -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.module.system.dal.dataobject.dict.SysDictDataDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO; import org.mapstruct.Mapper; @@ -15,20 +15,20 @@ public interface DictDataConvert { DictDataConvert INSTANCE = Mappers.getMapper(DictDataConvert.class); - List convertList(List list); + List convertList(List list); - DictDataRespVO convert(SysDictDataDO bean); + DictDataRespVO convert(DictDataDO bean); - PageResult convertPage(PageResult page); + PageResult convertPage(PageResult page); - SysDictDataDO convert(DictDataUpdateReqVO bean); + DictDataDO convert(DictDataUpdateReqVO bean); - SysDictDataDO convert(DictDataCreateReqVO bean); + DictDataDO convert(DictDataCreateReqVO bean); - List convertList02(List bean); + List convertList02(List bean); - DictDataRespDTO convert02(SysDictDataDO bean); + DictDataRespDTO convert02(DictDataDO bean); - List convertList03(Collection list); + List convertList03(Collection list); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/dict/SysDictDataCoreConvert.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/dict/SysDictDataCoreConvert.java deleted file mode 100644 index c61d654cf..000000000 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/dict/SysDictDataCoreConvert.java +++ /dev/null @@ -1,20 +0,0 @@ -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 convertList03(Collection list); - -} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/logger/LoginLogConvert.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/logger/LoginLogConvert.java index 3208276cc..ea50d4b09 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/logger/LoginLogConvert.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/logger/LoginLogConvert.java @@ -1,9 +1,10 @@ package cn.iocoder.yudao.module.system.convert.logger; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.system.api.logger.dto.LoginLogCreateReqDTO; 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.module.system.dal.dataobject.logger.SysLoginLogDO; -import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.system.dal.dataobject.logger.LoginLogDO; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; @@ -14,8 +15,10 @@ public interface LoginLogConvert { LoginLogConvert INSTANCE = Mappers.getMapper(LoginLogConvert.class); - PageResult convertPage(PageResult page); + PageResult convertPage(PageResult page); - List convertList(List list); + List convertList(List list); + + LoginLogDO convert(LoginLogCreateReqDTO bean); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/logger/SysLoginLogCoreConvert.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/logger/SysLoginLogCoreConvert.java deleted file mode 100644 index 70b5dfff0..000000000 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/logger/SysLoginLogCoreConvert.java +++ /dev/null @@ -1,15 +0,0 @@ -package cn.iocoder.yudao.module.system.convert.logger; - -import cn.iocoder.yudao.module.system.dal.dataobject.logger.SysLoginLogDO; -import cn.iocoder.yudao.module.system.api.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); - -} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/sms/SmsChannelConvert.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/sms/SmsChannelConvert.java index 6979ed002..0776c58f6 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/sms/SmsChannelConvert.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/sms/SmsChannelConvert.java @@ -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.module.system.dal.dataobject.sms.SysSmsChannelDO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties; import org.mapstruct.Mapper; @@ -22,18 +22,18 @@ public interface SmsChannelConvert { SmsChannelConvert INSTANCE = Mappers.getMapper(SmsChannelConvert.class); - SysSmsChannelDO convert(SmsChannelCreateReqVO bean); + SmsChannelDO convert(SmsChannelCreateReqVO bean); - SysSmsChannelDO convert(SmsChannelUpdateReqVO bean); + SmsChannelDO convert(SmsChannelUpdateReqVO bean); - SmsChannelRespVO convert(SysSmsChannelDO bean); + SmsChannelRespVO convert(SmsChannelDO bean); - List convertList(List list); + List convertList(List list); - PageResult convertPage(PageResult page); + PageResult convertPage(PageResult page); - List convertList02(List list); + List convertList02(List list); - List convertList03(List list); + List convertList03(List list); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/sms/SmsLogConvert.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/sms/SmsLogConvert.java index 425ac3197..40efe60a1 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/sms/SmsLogConvert.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/sms/SmsLogConvert.java @@ -1,8 +1,8 @@ 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.module.system.dal.dataobject.sms.SysSmsLogDO; +import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogRespVO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsLogDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; @@ -19,12 +19,12 @@ public interface SmsLogConvert { SmsLogConvert INSTANCE = Mappers.getMapper(SmsLogConvert.class); - SysSmsLogRespVO convert(SysSmsLogDO bean); + SmsLogRespVO convert(SmsLogDO bean); - List convertList(List list); + List convertList(List list); - PageResult convertPage(PageResult page); + PageResult convertPage(PageResult page); - List convertList02(List list); + List convertList02(List list); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/sms/SmsTemplateConvert.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/sms/SmsTemplateConvert.java index 8cca0f01f..b0fb02b8f 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/sms/SmsTemplateConvert.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/sms/SmsTemplateConvert.java @@ -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.module.system.dal.dataobject.sms.SysSmsTemplateDO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; @@ -16,16 +16,16 @@ public interface SmsTemplateConvert { SmsTemplateConvert INSTANCE = Mappers.getMapper(SmsTemplateConvert.class); - SysSmsTemplateDO convert(SmsTemplateCreateReqVO bean); + SmsTemplateDO convert(SmsTemplateCreateReqVO bean); - SysSmsTemplateDO convert(SmsTemplateUpdateReqVO bean); + SmsTemplateDO convert(SmsTemplateUpdateReqVO bean); - SmsTemplateRespVO convert(SysSmsTemplateDO bean); + SmsTemplateRespVO convert(SmsTemplateDO bean); - List convertList(List list); + List convertList(List list); - PageResult convertPage(PageResult page); + PageResult convertPage(PageResult page); - List convertList02(List list); + List convertList02(List list); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/tenant/TenantConvert.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/tenant/TenantConvert.java index 53de4517a..afc05a92f 100755 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/tenant/TenantConvert.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/tenant/TenantConvert.java @@ -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.module.system.dal.dataobject.tenant.SysTenantDO; +import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; @@ -21,16 +21,16 @@ public interface TenantConvert { TenantConvert INSTANCE = Mappers.getMapper(TenantConvert.class); - SysTenantDO convert(TenantCreateReqVO bean); + TenantDO convert(TenantCreateReqVO bean); - SysTenantDO convert(TenantUpdateReqVO bean); + TenantDO convert(TenantUpdateReqVO bean); - TenantRespVO convert(SysTenantDO bean); + TenantRespVO convert(TenantDO bean); - List convertList(List list); + List convertList(List list); - PageResult convertPage(PageResult page); + PageResult convertPage(PageResult page); - List convertList02(List list); + List convertList02(List list); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/user/UserConvert.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/user/UserConvert.java index 9e4aaddbf..cf2b1692b 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/user/UserConvert.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/user/UserConvert.java @@ -4,10 +4,10 @@ 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.module.system.dal.dataobject.dept.SysDeptDO; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysPostDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; -import cn.iocoder.yudao.module.system.dal.dataobject.social.SysSocialUserDO; +import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; @@ -21,7 +21,7 @@ public interface UserConvert { UserPageItemRespVO convert(AdminUserDO bean); - UserPageItemRespVO.Dept convert(SysDeptDO bean); + UserPageItemRespVO.Dept convert(DeptDO bean); AdminUserDO convert(UserCreateReqVO bean); @@ -35,15 +35,15 @@ public interface UserConvert { List convertList(List list); - UserProfileRespVO.Dept convert02(SysDeptDO bean); + UserProfileRespVO.Dept convert02(DeptDO bean); AdminUserDO convert(UserProfileUpdateReqVO bean); AdminUserDO convert(UserProfileUpdatePasswordReqVO bean); - List convertList02(List list); + List convertList02(List list); - List convertList03(List list); + List convertList03(List list); List convertList04(List list); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/auth/SysUserSessionDO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/auth/UserSessionDO.java similarity index 82% rename from yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/auth/SysUserSessionDO.java rename to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/auth/UserSessionDO.java index 9de10295b..01885004e 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/auth/SysUserSessionDO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/auth/UserSessionDO.java @@ -17,15 +17,15 @@ import java.util.Date; * * 我们已经将 {@link LoginUser} 缓存在 Redis 当中。 * 这里额外存储在线用户到 MySQL 中,目的是为了方便管理界面可以灵活查询。 - * 同时,通过定时轮询 SysUserSessionDO 表,可以主动删除 Redis 的缓存,因为 Redis 的过期删除是延迟的。 + * 同时,通过定时轮询 UserSessionDO 表,可以主动删除 Redis 的缓存,因为 Redis 的过期删除是延迟的。 * * @author 芋道源码 */ -@TableName(value = "sys_user_session", autoResultMap = true) +@TableName(value = "system_user_session", autoResultMap = true) @Data @Builder @EqualsAndHashCode(callSuper = true) -public class SysUserSessionDO extends TenantBaseDO { +public class UserSessionDO extends TenantBaseDO { /** * 会话编号, 即 sessionId @@ -35,7 +35,7 @@ public class SysUserSessionDO extends TenantBaseDO { /** * 用户编号 * - * 关联 SysUserDO.id 或者 MbrUserDO.id + * 关联 AdminUserDO.id 或者 MemberUserDO.id */ private Long userId; /** diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/SysDeptDO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/DeptDO.java similarity index 94% rename from yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/SysDeptDO.java rename to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/DeptDO.java index 9840a2c30..557a1f36f 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/SysDeptDO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/DeptDO.java @@ -14,10 +14,10 @@ import lombok.EqualsAndHashCode; * @author ruoyi * @author 芋道源码 */ -@TableName("sys_dept") +@TableName("system_dept") @Data @EqualsAndHashCode(callSuper = true) -public class SysDeptDO extends TenantBaseDO { +public class DeptDO extends TenantBaseDO { /** * 部门ID diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/SysPostDO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/PostDO.java similarity index 92% rename from yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/SysPostDO.java rename to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/PostDO.java index 233ba361b..ba9074d03 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/SysPostDO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/PostDO.java @@ -12,10 +12,10 @@ import lombok.EqualsAndHashCode; * * @author ruoyi */ -@TableName("sys_post") +@TableName("system_post") @Data @EqualsAndHashCode(callSuper = true) -public class SysPostDO extends TenantBaseDO { +public class PostDO extends TenantBaseDO { /** * 岗位序号 diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dict/SysDictDataDO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dict/DictDataDO.java similarity index 88% rename from yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dict/SysDictDataDO.java rename to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dict/DictDataDO.java index fe12ce472..1b5cee4e4 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dict/SysDictDataDO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dict/DictDataDO.java @@ -12,10 +12,10 @@ import lombok.EqualsAndHashCode; * * @author ruoyi */ -@TableName("sys_dict_data") +@TableName("system_dict_data") @Data @EqualsAndHashCode(callSuper = true) -public class SysDictDataDO extends BaseDO { +public class DictDataDO extends BaseDO { /** * 字典数据编号 @@ -37,7 +37,7 @@ public class SysDictDataDO extends BaseDO { /** * 字典类型 * - * 冗余 {@link SysDictDataDO#getDictType()} + * 冗余 {@link DictDataDO#getDictType()} */ private String dictType; /** diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/logger/SysLoginLogDO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/logger/LoginLogDO.java similarity index 95% rename from yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/logger/SysLoginLogDO.java rename to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/logger/LoginLogDO.java index 3037d094b..66a81443b 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/logger/SysLoginLogDO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/logger/LoginLogDO.java @@ -16,11 +16,11 @@ import lombok.ToString; * * @author 芋道源码 */ -@TableName("sys_login_log") +@TableName("system_login_log") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) -public class SysLoginLogDO extends BaseDO { +public class LoginLogDO extends BaseDO { /** * 日志主键 diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/permission/MenuDO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/permission/MenuDO.java index 1920a68e2..2915efa4c 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/permission/MenuDO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/permission/MenuDO.java @@ -34,7 +34,7 @@ public class MenuDO extends BaseDO { * 一般格式为:${系统}:${模块}:${操作} * 例如说:system:admin:add,即 system 服务的添加管理员。 * - * 当我们把该 SysMenuDO 赋予给角色后,意味着该角色有该资源: + * 当我们把该 MenuDO 赋予给角色后,意味着该角色有该资源: * - 对于后端,配合 @PreAuthorize 注解,配置 API 接口需要该权限,从而对 API 接口进行权限控制。 * - 对于前端,配合前端标签,配置按钮是否展示,避免用户没有该权限时,结果可以看到该操作。 */ diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/SysSmsChannelDO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/SmsChannelDO.java similarity index 91% rename from yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/SysSmsChannelDO.java rename to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/SmsChannelDO.java index 57fe9789e..5e6b8c419 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/SysSmsChannelDO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/SmsChannelDO.java @@ -14,11 +14,11 @@ import lombok.ToString; * @author zzf * @since 2021-01-25 */ -@TableName(value = "sys_sms_channel", autoResultMap = true) +@TableName(value = "system_sms_channel", autoResultMap = true) @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) -public class SysSmsChannelDO extends BaseDO { +public class SmsChannelDO extends BaseDO { /** * 渠道编号 diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/SysSmsLogDO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/SmsLogDO.java similarity index 81% rename from yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/SysSmsLogDO.java rename to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/SmsLogDO.java index a6daa0c74..441f6ad17 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/SysSmsLogDO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/SmsLogDO.java @@ -1,7 +1,7 @@ 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.module.system.enums.sms.SmsReceiveStatusEnum; +import cn.iocoder.yudao.module.system.enums.sms.SmsSendStatusEnum; 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; @@ -19,14 +19,14 @@ import java.util.Map; * @author zzf * @since 2021-01-25 */ -@TableName(value = "sys_sms_log", autoResultMap = true) +@TableName(value = "system_sms_log", autoResultMap = true) @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @Builder @AllArgsConstructor @NoArgsConstructor -public class SysSmsLogDO extends BaseDO { +public class SmsLogDO extends BaseDO { /** * 自增编号 @@ -38,13 +38,13 @@ public class SysSmsLogDO extends BaseDO { /** * 短信渠道编号 * - * 关联 {@link SysSmsChannelDO#getId()} + * 关联 {@link SmsChannelDO#getId()} */ private Long channelId; /** * 短信渠道编码 * - * 冗余 {@link SysSmsChannelDO#getCode()} + * 冗余 {@link SmsChannelDO#getCode()} */ private String channelCode; @@ -53,34 +53,34 @@ public class SysSmsLogDO extends BaseDO { /** * 模板编号 * - * 关联 {@link SysSmsTemplateDO#getId()} + * 关联 {@link SmsTemplateDO#getId()} */ private Long templateId; /** * 模板编码 * - * 冗余 {@link SysSmsTemplateDO#getCode()} + * 冗余 {@link SmsTemplateDO#getCode()} */ private String templateCode; /** * 短信类型 * - * 冗余 {@link SysSmsTemplateDO#getType()} + * 冗余 {@link SmsTemplateDO#getType()} */ private Integer templateType; /** - * 基于 {@link SysSmsTemplateDO#getContent()} 格式化后的内容 + * 基于 {@link SmsTemplateDO#getContent()} 格式化后的内容 */ private String templateContent; /** - * 基于 {@link SysSmsTemplateDO#getParams()} 输入后的参数 + * 基于 {@link SmsTemplateDO#getParams()} 输入后的参数 */ @TableField(typeHandler = JacksonTypeHandler.class) private Map templateParams; /** * 短信 API 的模板编号 * - * 冗余 {@link SysSmsTemplateDO#getApiTemplateId()} + * 冗余 {@link SmsTemplateDO#getApiTemplateId()} */ private String apiTemplateId; @@ -106,7 +106,7 @@ public class SysSmsLogDO extends BaseDO { /** * 发送状态 * - * 枚举 {@link SysSmsSendStatusEnum} + * 枚举 {@link SmsSendStatusEnum} */ private Integer sendStatus; /** @@ -154,7 +154,7 @@ public class SysSmsLogDO extends BaseDO { /** * 接收状态 * - * 枚举 {@link SysSmsReceiveStatusEnum} + * 枚举 {@link SmsReceiveStatusEnum} */ private Integer receiveStatus; /** diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/SysSmsTemplateDO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/SmsTemplateDO.java similarity index 83% rename from yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/SysSmsTemplateDO.java rename to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/SmsTemplateDO.java index 72fcafcd9..54c209868 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/SysSmsTemplateDO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/sms/SmsTemplateDO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.system.dal.dataobject.sms; -import cn.iocoder.yudao.module.system.enums.sms.SysSmsTemplateTypeEnum; +import cn.iocoder.yudao.module.system.enums.sms.SmsTemplateTypeEnum; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; import com.baomidou.mybatisplus.annotation.TableField; @@ -18,11 +18,11 @@ import java.util.List; * @author zzf * @since 2021-01-25 */ -@TableName(value = "sys_sms_template", autoResultMap = true) +@TableName(value = "system_sms_template", autoResultMap = true) @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) -public class SysSmsTemplateDO extends BaseDO { +public class SmsTemplateDO extends BaseDO { /** * 自增编号 @@ -34,7 +34,7 @@ public class SysSmsTemplateDO extends BaseDO { /** * 短信类型 * - * 枚举 {@link SysSmsTemplateTypeEnum} + * 枚举 {@link SmsTemplateTypeEnum} */ private Integer type; /** @@ -76,13 +76,13 @@ public class SysSmsTemplateDO extends BaseDO { /** * 短信渠道编号 * - * 关联 {@link SysSmsChannelDO#getId()} + * 关联 {@link SmsChannelDO#getId()} */ private Long channelId; /** * 短信渠道编码 * - * 冗余 {@link SysSmsChannelDO#getCode()} + * 冗余 {@link SmsChannelDO#getCode()} */ private String channelCode; diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/social/SysSocialUserDO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/social/SocialUserDO.java similarity index 89% rename from yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/social/SysSocialUserDO.java rename to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/social/SocialUserDO.java index bca1964fe..9572f1e93 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/social/SysSocialUserDO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/social/SocialUserDO.java @@ -9,17 +9,17 @@ import lombok.*; /** * 社交用户 - * 通过 {@link SysSocialUserDO#getUserId()} 关联到对应的 {@link AdminUserDO} + * 通过 {@link SocialUserDO#getUserId()} 关联到对应的 {@link AdminUserDO} * * @author weir */ -@TableName(value = "sys_social_user", autoResultMap = true) +@TableName(value = "system_social_user", autoResultMap = true) @Data @EqualsAndHashCode(callSuper = true) @Builder @NoArgsConstructor @AllArgsConstructor -public class SysSocialUserDO extends BaseDO { +public class SocialUserDO extends BaseDO { /** * 自增主键 diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/tenant/SysTenantDO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/tenant/TenantDO.java similarity index 89% rename from yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/tenant/SysTenantDO.java rename to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/tenant/TenantDO.java index ebff2004c..99a658e09 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/tenant/SysTenantDO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/tenant/TenantDO.java @@ -10,14 +10,14 @@ import lombok.*; * * @author 芋道源码 */ -@TableName(value = "sys_tenant", autoResultMap = true) +@TableName(value = "system_tenant", autoResultMap = true) @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @Builder @AllArgsConstructor @NoArgsConstructor -public class SysTenantDO extends BaseDO { +public class TenantDO extends BaseDO { /** * 租户编号,自增 diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/user/AdminUserDO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/user/AdminUserDO.java index 85e2dfb90..870ad30fc 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/user/AdminUserDO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/user/AdminUserDO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.system.dal.dataobject.user; -import cn.iocoder.yudao.module.system.enums.common.SysSexEnum; +import cn.iocoder.yudao.module.system.enums.common.SexEnum; 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; @@ -18,7 +18,7 @@ import java.util.Set; * * @author 芋道源码 */ -@TableName(value = "sys_user", autoResultMap = true) +@TableName(value = "system_user", autoResultMap = true) @Data @EqualsAndHashCode(callSuper = true) @Builder @@ -69,7 +69,7 @@ public class AdminUserDO extends TenantBaseDO { /** * 用户性别 * - * 枚举类 {@link SysSexEnum} + * 枚举类 {@link SexEnum} */ private Integer sex; /** diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/auth/SysUserSessionCoreMapper.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/auth/SysUserSessionCoreMapper.java deleted file mode 100644 index a589d1e9e..000000000 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/auth/SysUserSessionCoreMapper.java +++ /dev/null @@ -1,10 +0,0 @@ -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 { - -} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/auth/SysUserSessionMapper.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/auth/UserSessionMapper.java similarity index 54% rename from yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/auth/SysUserSessionMapper.java rename to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/auth/UserSessionMapper.java index 23e0ba1e5..1b7f31be3 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/auth/SysUserSessionMapper.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/auth/UserSessionMapper.java @@ -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.module.system.dal.dataobject.auth.SysUserSessionDO; +import cn.iocoder.yudao.module.system.dal.dataobject.auth.UserSessionDO; 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; @@ -12,16 +12,16 @@ import java.util.Date; import java.util.List; @Mapper -public interface SysUserSessionMapper extends BaseMapperX { +public interface UserSessionMapper extends BaseMapperX { - default PageResult selectPage(UserSessionPageReqVO reqVO, Collection userIds) { - return selectPage(reqVO, new QueryWrapperX() + default PageResult selectPage(UserSessionPageReqVO reqVO, Collection userIds) { + return selectPage(reqVO, new QueryWrapperX() .inIfPresent("user_id", userIds) .likeIfPresent("user_ip", reqVO.getUserIp())); } - default List selectListBySessionTimoutLt() { - return selectList(new QueryWrapperX().lt("session_timeout",new Date())); + default List selectListBySessionTimoutLt() { + return selectList(new QueryWrapperX().lt("session_timeout",new Date())); } } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/SysDeptMapper.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/DeptMapper.java similarity index 51% rename from yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/SysDeptMapper.java rename to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/DeptMapper.java index e2d0678e7..3f76709c8 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/SysDeptMapper.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/DeptMapper.java @@ -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.module.system.dal.dataobject.dept.SysDeptDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; import com.baomidou.mybatisplus.annotation.InterceptorIgnore; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.apache.ibatis.annotations.Mapper; @@ -13,26 +13,26 @@ import java.util.Date; import java.util.List; @Mapper -public interface SysDeptMapper extends BaseMapperX { +public interface DeptMapper extends BaseMapperX { - default List selectList(DeptListReqVO reqVO) { - return selectList(new LambdaQueryWrapperX().likeIfPresent(SysDeptDO::getName, reqVO.getName()) - .eqIfPresent(SysDeptDO::getStatus, reqVO.getStatus())); + default List selectList(DeptListReqVO reqVO) { + return selectList(new LambdaQueryWrapperX().likeIfPresent(DeptDO::getName, reqVO.getName()) + .eqIfPresent(DeptDO::getStatus, reqVO.getStatus())); } - default SysDeptDO selectByParentIdAndName(Long parentId, String name) { - return selectOne(new LambdaQueryWrapper().eq(SysDeptDO::getParentId, parentId) - .eq(SysDeptDO::getName, name)); + default DeptDO selectByParentIdAndName(Long parentId, String name) { + return selectOne(new LambdaQueryWrapper().eq(DeptDO::getParentId, parentId) + .eq(DeptDO::getName, name)); } default Integer selectCountByParentId(Long parentId) { - return selectCount(SysDeptDO::getParentId, parentId); + return selectCount(DeptDO::getParentId, parentId); } @InterceptorIgnore(tenantLine = "on") // 该方法忽略多租户。原因:该方法被异步 task 调用,此时获取不到租户编号 default boolean selectExistsByUpdateTimeAfter(Date maxUpdateTime) { - return selectOne(new LambdaQueryWrapper().select(SysDeptDO::getId) - .gt(SysDeptDO::getUpdateTime, maxUpdateTime).last(SqlConstants.LIMIT1)) != null; + return selectOne(new LambdaQueryWrapper().select(DeptDO::getId) + .gt(DeptDO::getUpdateTime, maxUpdateTime).last(SqlConstants.LIMIT1)) != null; } } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/SysPostMapper.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/PostMapper.java similarity index 55% rename from yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/SysPostMapper.java rename to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/PostMapper.java index 1a5665863..ecbd75949 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/SysPostMapper.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/PostMapper.java @@ -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.module.system.dal.dataobject.dept.SysPostDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import org.apache.ibatis.annotations.Mapper; @@ -13,33 +13,33 @@ import java.util.Collection; import java.util.List; @Mapper -public interface SysPostMapper extends BaseMapperX { +public interface PostMapper extends BaseMapperX { - default List selectList(Collection ids, Collection statuses) { - return selectList(new QueryWrapperX().inIfPresent("id", ids) + default List selectList(Collection ids, Collection statuses) { + return selectList(new QueryWrapperX().inIfPresent("id", ids) .inIfPresent("status", statuses)); } - default PageResult selectPage(PostPageReqVO reqVO) { - return selectPage(reqVO, new QueryWrapperX() + default PageResult selectPage(PostPageReqVO reqVO) { + return selectPage(reqVO, new QueryWrapperX() .likeIfPresent("code", reqVO.getCode()) .likeIfPresent("name", reqVO.getName()) .eqIfPresent("status", reqVO.getStatus())); } - default List selectList(PostExportReqVO reqVO) { - return selectList(new QueryWrapperX() + default List selectList(PostExportReqVO reqVO) { + return selectList(new QueryWrapperX() .likeIfPresent("code", reqVO.getCode()) .likeIfPresent("name", reqVO.getName()) .eqIfPresent("status", reqVO.getStatus())); } - default SysPostDO selectByName(String name) { - return selectOne(new QueryWrapper().eq("name", name)); + default PostDO selectByName(String name) { + return selectOne(new QueryWrapper().eq("name", name)); } - default SysPostDO selectByCode(String code) { - return selectOne(new QueryWrapper().eq("code", code)); + default PostDO selectByCode(String code) { + return selectOne(new QueryWrapper().eq("code", code)); } } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/SysDeptCoreMapper.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/SysDeptCoreMapper.java deleted file mode 100644 index 489733bbf..000000000 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/SysDeptCoreMapper.java +++ /dev/null @@ -1,9 +0,0 @@ -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 { -} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/SysPostCoreMapper.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/SysPostCoreMapper.java deleted file mode 100644 index 5ce2d2152..000000000 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/SysPostCoreMapper.java +++ /dev/null @@ -1,9 +0,0 @@ -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 { -} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/DictDataMapper.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/DictDataMapper.java new file mode 100644 index 000000000..07462fc44 --- /dev/null +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/DictDataMapper.java @@ -0,0 +1,54 @@ +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.module.system.dal.dataobject.dict.DictDataDO; +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 org.apache.ibatis.annotations.Mapper; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Date; +import java.util.List; + +@Mapper +public interface DictDataMapper extends BaseMapperX { + + default DictDataDO selectByDictTypeAndValue(String dictType, String value) { + return selectOne(new LambdaQueryWrapper().eq(DictDataDO::getDictType, dictType) + .eq(DictDataDO::getValue, value)); + } + + default List selectByDictTypeAndValues(String dictType, Collection values) { + return selectList(new LambdaQueryWrapper().eq(DictDataDO::getDictType, dictType) + .in(DictDataDO::getValue, values)); + } + + default int selectCountByDictType(String dictType) { + return selectCount(DictDataDO::getDictType, dictType); + } + + default PageResult selectPage(DictDataPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(DictDataDO::getLabel, reqVO.getLabel()) + .likeIfPresent(DictDataDO::getDictType, reqVO.getDictType()) + .eqIfPresent(DictDataDO::getStatus, reqVO.getStatus()) + .orderByAsc(Arrays.asList(DictDataDO::getDictType, DictDataDO::getSort))); + } + + default List selectList(DictDataExportReqVO reqVO) { + return selectList(new LambdaQueryWrapperX().likeIfPresent(DictDataDO::getLabel, reqVO.getLabel()) + .likeIfPresent(DictDataDO::getDictType, reqVO.getDictType()) + .eqIfPresent(DictDataDO::getStatus, reqVO.getStatus())); + } + + default boolean selectExistsByUpdateTimeAfter(Date maxUpdateTime) { + return selectOne(new LambdaQueryWrapper().select(DictDataDO::getId) + .gt(DictDataDO::getUpdateTime, maxUpdateTime).last(SqlConstants.LIMIT1)) != null; + } + +} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/SysDictTypeMapper.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/DictTypeMapper.java similarity index 96% rename from yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/SysDictTypeMapper.java rename to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/DictTypeMapper.java index de3d700af..11b9d5f3e 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/SysDictTypeMapper.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/DictTypeMapper.java @@ -11,7 +11,7 @@ import org.apache.ibatis.annotations.Mapper; import java.util.List; @Mapper -public interface SysDictTypeMapper extends BaseMapperX { +public interface DictTypeMapper extends BaseMapperX { default PageResult selectPage(DictTypePageReqVO reqVO) { return selectPage(reqVO, new QueryWrapperX() diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/SysDictDataMapper.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/SysDictDataMapper.java deleted file mode 100644 index 602a77342..000000000 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/SysDictDataMapper.java +++ /dev/null @@ -1,55 +0,0 @@ -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.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; -import java.util.Collection; -import java.util.Date; -import java.util.List; - -@Mapper -public interface SysDictDataMapper extends BaseMapperX { - - default SysDictDataDO selectByDictTypeAndValue(String dictType, String value) { - return selectOne(new LambdaQueryWrapper().eq(SysDictDataDO::getDictType, dictType) - .eq(SysDictDataDO::getValue, value)); - } - - default List selectByDictTypeAndValues(String dictType, Collection values) { - return selectList(new LambdaQueryWrapper().eq(SysDictDataDO::getDictType, dictType) - .in(SysDictDataDO::getValue, values)); - } - - default int selectCountByDictType(String dictType) { - return selectCount(SysDictDataDO::getDictType, dictType); - } - - default PageResult selectPage(DictDataPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .likeIfPresent(SysDictDataDO::getLabel, reqVO.getLabel()) - .likeIfPresent(SysDictDataDO::getDictType, reqVO.getDictType()) - .eqIfPresent(SysDictDataDO::getStatus, reqVO.getStatus()) - .orderByAsc(Arrays.asList(SysDictDataDO::getDictType, SysDictDataDO::getSort))); - } - - default List selectList(DictDataExportReqVO reqVO) { - return selectList(new LambdaQueryWrapperX().likeIfPresent(SysDictDataDO::getLabel, reqVO.getLabel()) - .likeIfPresent(SysDictDataDO::getDictType, reqVO.getDictType()) - .eqIfPresent(SysDictDataDO::getStatus, reqVO.getStatus())); - } - - default boolean selectExistsByUpdateTimeAfter(Date maxUpdateTime) { - return selectOne(new LambdaQueryWrapper().select(SysDictDataDO::getId) - .gt(SysDictDataDO::getUpdateTime, maxUpdateTime).last(SqlConstants.LIMIT1)) != null; - } - -} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/errorcode/SysErrorCodeMapper.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/errorcode/ErrorCodeMapper.java similarity index 97% rename from yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/errorcode/SysErrorCodeMapper.java rename to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/errorcode/ErrorCodeMapper.java index 4924c6e87..ab514bd22 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/errorcode/SysErrorCodeMapper.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/errorcode/ErrorCodeMapper.java @@ -14,7 +14,7 @@ import java.util.Date; import java.util.List; @Mapper -public interface SysErrorCodeMapper extends BaseMapperX { +public interface ErrorCodeMapper extends BaseMapperX { default PageResult selectPage(ErrorCodePageReqVO reqVO) { return selectPage(reqVO, new QueryWrapperX() diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/logger/LoginLogMapper.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/logger/LoginLogMapper.java index 8473caccf..a2731a5f6 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/logger/LoginLogMapper.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/logger/LoginLogMapper.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.system.dal.mysql.logger; -import cn.iocoder.yudao.module.system.dal.dataobject.logger.SysLoginLogDO; +import cn.iocoder.yudao.module.system.dal.dataobject.logger.LoginLogDO; 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; @@ -12,10 +12,10 @@ import org.apache.ibatis.annotations.Mapper; import java.util.List; @Mapper -public interface LoginLogMapper extends BaseMapperX { +public interface LoginLogMapper extends BaseMapperX { - default PageResult selectPage(LoginLogPageReqVO reqVO) { - QueryWrapperX query = new QueryWrapperX() + default PageResult selectPage(LoginLogPageReqVO reqVO) { + QueryWrapperX query = new QueryWrapperX() .likeIfPresent("user_ip", reqVO.getUserIp()) .likeIfPresent("username", reqVO.getUsername()) .betweenIfPresent("create_time", reqVO.getBeginTime(), reqVO.getEndTime()); @@ -28,8 +28,8 @@ public interface LoginLogMapper extends BaseMapperX { return selectPage(reqVO, query); } - default List selectList(LoginLogExportReqVO reqVO) { - QueryWrapperX query = new QueryWrapperX() + default List selectList(LoginLogExportReqVO reqVO) { + QueryWrapperX query = new QueryWrapperX() .likeIfPresent("user_ip", reqVO.getUserIp()) .likeIfPresent("username", reqVO.getUsername()) .betweenIfPresent("create_time", reqVO.getBeginTime(), reqVO.getEndTime()); diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/logger/SysLoginLogCoreMapper.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/logger/SysLoginLogCoreMapper.java deleted file mode 100644 index 6ef40e834..000000000 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/logger/SysLoginLogCoreMapper.java +++ /dev/null @@ -1,10 +0,0 @@ -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 { - -} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/notice/SysNoticeMapper.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/notice/NoticeMapper.java similarity index 91% rename from yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/notice/SysNoticeMapper.java rename to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/notice/NoticeMapper.java index 6c6a30518..9f077918b 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/notice/SysNoticeMapper.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/notice/NoticeMapper.java @@ -8,7 +8,7 @@ import cn.iocoder.yudao.module.system.dal.dataobject.notice.NoticeDO; import org.apache.ibatis.annotations.Mapper; @Mapper -public interface SysNoticeMapper extends BaseMapperX { +public interface NoticeMapper extends BaseMapperX { default PageResult selectPage(NoticePageReqVO reqVO) { return selectPage(reqVO, new QueryWrapperX() diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/permission/RoleMenuMapper.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/permission/RoleMenuMapper.java index f77294f35..02008bce8 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/permission/RoleMenuMapper.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/permission/RoleMenuMapper.java @@ -42,7 +42,7 @@ public interface RoleMenuMapper extends BaseMapperX { delete(new QueryWrapper().eq("role_id", roleId)); } - @Select("SELECT id FROM sys_role_menu WHERE update_time > #{maxUpdateTime} LIMIT 1") + @Select("SELECT id FROM system_role_menu WHERE update_time > #{maxUpdateTime} LIMIT 1") Long selectExistsByUpdateTimeAfter(Date maxUpdateTime); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/sms/SmsChannelMapper.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/sms/SmsChannelMapper.java index 9f2f02356..7b0c9f6f9 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/sms/SmsChannelMapper.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/sms/SmsChannelMapper.java @@ -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.module.system.dal.dataobject.sms.SysSmsChannelDO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; 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; @@ -11,17 +11,17 @@ import org.apache.ibatis.annotations.Select; import java.util.Date; @Mapper -public interface SmsChannelMapper extends BaseMapperX { +public interface SmsChannelMapper extends BaseMapperX { - default PageResult selectPage(SmsChannelPageReqVO reqVO) { - return selectPage(reqVO, new QueryWrapperX() + default PageResult selectPage(SmsChannelPageReqVO reqVO) { + return selectPage(reqVO, new QueryWrapperX() .likeIfPresent("signature", reqVO.getSignature()) .eqIfPresent("status", reqVO.getStatus()) .betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) .orderByDesc("id")); } - @Select("SELECT id FROM sys_sms_channel WHERE update_time > #{maxUpdateTime} LIMIT 1") + @Select("SELECT id FROM system_sms_channel WHERE update_time > #{maxUpdateTime} LIMIT 1") Long selectExistsByUpdateTimeAfter(Date maxUpdateTime); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/sms/SmsLogMapper.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/sms/SmsLogMapper.java index f941a0f85..01ea77a46 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/sms/SmsLogMapper.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/sms/SmsLogMapper.java @@ -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.module.system.dal.dataobject.sms.SysSmsLogDO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsLogDO; 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; @@ -11,10 +11,10 @@ import org.apache.ibatis.annotations.Mapper; import java.util.List; @Mapper -public interface SmsLogMapper extends BaseMapperX { +public interface SmsLogMapper extends BaseMapperX { - default PageResult selectPage(SmsLogPageReqVO reqVO) { - return selectPage(reqVO, new QueryWrapperX() + default PageResult selectPage(SmsLogPageReqVO reqVO) { + return selectPage(reqVO, new QueryWrapperX() .eqIfPresent("channel_id", reqVO.getChannelId()) .eqIfPresent("template_id", reqVO.getTemplateId()) .likeIfPresent("mobile", reqVO.getMobile()) @@ -25,8 +25,8 @@ public interface SmsLogMapper extends BaseMapperX { .orderByDesc("id")); } - default List selectList(SmsLogExportReqVO reqVO) { - return selectList(new QueryWrapperX() + default List selectList(SmsLogExportReqVO reqVO) { + return selectList(new QueryWrapperX() .eqIfPresent("channel_id", reqVO.getChannelId()) .eqIfPresent("template_id", reqVO.getTemplateId()) .likeIfPresent("mobile", reqVO.getMobile()) diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/sms/SmsTemplateMapper.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/sms/SmsTemplateMapper.java index d98e6fc5f..daf9882f0 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/sms/SmsTemplateMapper.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/sms/SmsTemplateMapper.java @@ -4,7 +4,7 @@ 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.module.system.dal.dataobject.sms.SysSmsTemplateDO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Select; @@ -13,41 +13,41 @@ import java.util.Date; import java.util.List; @Mapper -public interface SmsTemplateMapper extends BaseMapperX { +public interface SmsTemplateMapper extends BaseMapperX { - @Select("SELECT id FROM sys_sms_template WHERE update_time > #{maxUpdateTime} LIMIT 1") + @Select("SELECT id FROM system_sms_template WHERE update_time > #{maxUpdateTime} LIMIT 1") Long selectExistsByUpdateTimeAfter(Date maxUpdateTime); - default SysSmsTemplateDO selectByCode(String code) { - return selectOne(SysSmsTemplateDO::getCode, code); + default SmsTemplateDO selectByCode(String code) { + return selectOne(SmsTemplateDO::getCode, code); } - default PageResult selectPage(SmsTemplatePageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(SysSmsTemplateDO::getType, reqVO.getType()) - .eqIfPresent(SysSmsTemplateDO::getStatus, reqVO.getStatus()) - .likeIfPresent(SysSmsTemplateDO::getCode, reqVO.getCode()) - .likeIfPresent(SysSmsTemplateDO::getContent, reqVO.getContent()) - .likeIfPresent(SysSmsTemplateDO::getApiTemplateId, reqVO.getApiTemplateId()) - .eqIfPresent(SysSmsTemplateDO::getChannelId, reqVO.getChannelId()) - .betweenIfPresent(SysSmsTemplateDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) - .orderByDesc(SysSmsTemplateDO::getId)); + default PageResult selectPage(SmsTemplatePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(SmsTemplateDO::getType, reqVO.getType()) + .eqIfPresent(SmsTemplateDO::getStatus, reqVO.getStatus()) + .likeIfPresent(SmsTemplateDO::getCode, reqVO.getCode()) + .likeIfPresent(SmsTemplateDO::getContent, reqVO.getContent()) + .likeIfPresent(SmsTemplateDO::getApiTemplateId, reqVO.getApiTemplateId()) + .eqIfPresent(SmsTemplateDO::getChannelId, reqVO.getChannelId()) + .betweenIfPresent(SmsTemplateDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) + .orderByDesc(SmsTemplateDO::getId)); } - default List selectList(SmsTemplateExportReqVO reqVO) { - return selectList(new LambdaQueryWrapperX() - .eqIfPresent(SysSmsTemplateDO::getType, reqVO.getType()) - .eqIfPresent(SysSmsTemplateDO::getStatus, reqVO.getStatus()) - .likeIfPresent(SysSmsTemplateDO::getCode, reqVO.getCode()) - .likeIfPresent(SysSmsTemplateDO::getContent, reqVO.getContent()) - .likeIfPresent(SysSmsTemplateDO::getApiTemplateId, reqVO.getApiTemplateId()) - .eqIfPresent(SysSmsTemplateDO::getChannelId, reqVO.getChannelId()) - .betweenIfPresent(SysSmsTemplateDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) - .orderByDesc(SysSmsTemplateDO::getId)); + default List selectList(SmsTemplateExportReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(SmsTemplateDO::getType, reqVO.getType()) + .eqIfPresent(SmsTemplateDO::getStatus, reqVO.getStatus()) + .likeIfPresent(SmsTemplateDO::getCode, reqVO.getCode()) + .likeIfPresent(SmsTemplateDO::getContent, reqVO.getContent()) + .likeIfPresent(SmsTemplateDO::getApiTemplateId, reqVO.getApiTemplateId()) + .eqIfPresent(SmsTemplateDO::getChannelId, reqVO.getChannelId()) + .betweenIfPresent(SmsTemplateDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) + .orderByDesc(SmsTemplateDO::getId)); } default Integer selectCountByChannelId(Long channelId) { - return selectCount(SysSmsTemplateDO::getChannelId, channelId); + return selectCount(SmsTemplateDO::getChannelId, channelId); } } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/social/SocialUserMapper.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/social/SocialUserMapper.java new file mode 100644 index 000000000..3322ab840 --- /dev/null +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/social/SocialUserMapper.java @@ -0,0 +1,28 @@ +package cn.iocoder.yudao.module.system.dal.mysql.social; + +import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO; +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 SocialUserMapper extends BaseMapperX { + + default List selectListByTypeAndUnionId(Integer userType, Collection types, String unionId) { + return selectList(new QueryWrapper().eq("user_type", userType) + .in("type", types).eq("union_id", unionId)); + } + + default List selectListByTypeAndUserId(Integer userType, Collection types, Long userId) { + return selectList(new QueryWrapper().eq("user_type", userType) + .in("type", types).eq("user_id", userId)); + } + + default List selectListByUserId(Integer userType, Long userId) { + return selectList(new QueryWrapper().eq("user_type", userType).eq("user_id", userId)); + } + +} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/social/SysSocialUserMapper.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/social/SysSocialUserMapper.java deleted file mode 100644 index dc92ddb30..000000000 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/social/SysSocialUserMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -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 { - - default List selectListByTypeAndUnionId(Integer userType, Collection types, String unionId) { - return selectList(new QueryWrapper().eq("user_type", userType) - .in("type", types).eq("union_id", unionId)); - } - - default List selectListByTypeAndUserId(Integer userType, Collection types, Long userId) { - return selectList(new QueryWrapper().eq("user_type", userType) - .in("type", types).eq("user_id", userId)); - } - - default List selectListByUserId(Integer userType, Long userId) { - return selectList(new QueryWrapper().eq("user_type", userType).eq("user_id", userId)); - } - -} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/tenant/SysTenantCoreMapper.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/tenant/SysTenantCoreMapper.java deleted file mode 100644 index de7656f40..000000000 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/tenant/SysTenantCoreMapper.java +++ /dev/null @@ -1,9 +0,0 @@ -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 { -} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/tenant/SysTenantMapper.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/tenant/SysTenantMapper.java deleted file mode 100755 index f913d625d..000000000 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/tenant/SysTenantMapper.java +++ /dev/null @@ -1,44 +0,0 @@ -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.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; -import org.apache.ibatis.annotations.Mapper; - -import java.util.List; - -/** - * 租户 Mapper - * - * @author 芋道源码 - */ -@Mapper -public interface SysTenantMapper extends BaseMapperX { - - default PageResult selectPage(TenantPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .likeIfPresent(SysTenantDO::getName, reqVO.getName()) - .likeIfPresent(SysTenantDO::getContactName, reqVO.getContactName()) - .likeIfPresent(SysTenantDO::getContactMobile, reqVO.getContactMobile()) - .eqIfPresent(SysTenantDO::getStatus, reqVO.getStatus()) - .betweenIfPresent(SysTenantDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) - .orderByDesc(SysTenantDO::getId)); - } - - default List selectList(TenantExportReqVO reqVO) { - return selectList(new LambdaQueryWrapperX() - .likeIfPresent(SysTenantDO::getName, reqVO.getName()) - .likeIfPresent(SysTenantDO::getContactName, reqVO.getContactName()) - .likeIfPresent(SysTenantDO::getContactMobile, reqVO.getContactMobile()) - .eqIfPresent(SysTenantDO::getStatus, reqVO.getStatus()) - .betweenIfPresent(SysTenantDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) - .orderByDesc(SysTenantDO::getId)); - } - - default SysTenantDO selectByName(String name) { - return selectOne(SysTenantDO::getName, name); - } -} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/tenant/TenantMapper.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/tenant/TenantMapper.java new file mode 100755 index 000000000..9fe0dbec8 --- /dev/null +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/tenant/TenantMapper.java @@ -0,0 +1,44 @@ +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.module.system.dal.dataobject.tenant.TenantDO; +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 org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 租户 Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface TenantMapper extends BaseMapperX { + + default PageResult selectPage(TenantPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(TenantDO::getName, reqVO.getName()) + .likeIfPresent(TenantDO::getContactName, reqVO.getContactName()) + .likeIfPresent(TenantDO::getContactMobile, reqVO.getContactMobile()) + .eqIfPresent(TenantDO::getStatus, reqVO.getStatus()) + .betweenIfPresent(TenantDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) + .orderByDesc(TenantDO::getId)); + } + + default List selectList(TenantExportReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .likeIfPresent(TenantDO::getName, reqVO.getName()) + .likeIfPresent(TenantDO::getContactName, reqVO.getContactName()) + .likeIfPresent(TenantDO::getContactMobile, reqVO.getContactMobile()) + .eqIfPresent(TenantDO::getStatus, reqVO.getStatus()) + .betweenIfPresent(TenantDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) + .orderByDesc(TenantDO::getId)); + } + + default TenantDO selectByName(String name) { + return selectOne(TenantDO::getName, name); + } +} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/SysRedisKeyConstants.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/RedisKeyConstants.java similarity index 96% rename from yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/SysRedisKeyConstants.java rename to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/RedisKeyConstants.java index 78b1ca24f..d2d28219b 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/SysRedisKeyConstants.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/RedisKeyConstants.java @@ -13,7 +13,7 @@ import static cn.iocoder.yudao.framework.redis.core.RedisKeyDefine.KeyTypeEnum.S * * @author 芋道源码 */ -public interface SysRedisKeyConstants { +public interface RedisKeyConstants { RedisKeyDefine CAPTCHA_CODE = new RedisKeyDefine("验证码的缓存", "captcha_code:%s", // 参数为 uuid @@ -30,5 +30,5 @@ public interface SysRedisKeyConstants { RedisKeyDefine SOCIAL_AUTH_STATE = new RedisKeyDefine("社交登陆的 state", "social_auth_state:%s", // 参数为 state STRING, String.class, Duration.ofHours(24)); // 值为 state - + } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/SysRedisKeyCoreConstants.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/SysRedisKeyCoreConstants.java deleted file mode 100644 index 735adcc91..000000000 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/SysRedisKeyCoreConstants.java +++ /dev/null @@ -1,18 +0,0 @@ -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 { - -} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/auth/LoginUserRedisDAO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/auth/LoginUserRedisDAO.java index ead1d0287..8132a882e 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/auth/LoginUserRedisDAO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/auth/LoginUserRedisDAO.java @@ -8,7 +8,7 @@ import org.springframework.stereotype.Repository; import javax.annotation.Resource; -import static cn.iocoder.yudao.module.system.dal.redis.SysRedisKeyConstants.LOGIN_USER; +import static cn.iocoder.yudao.module.system.dal.redis.RedisKeyConstants.LOGIN_USER; /** * {@link LoginUser} 的 RedisDAO diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/common/CaptchaRedisDAO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/common/CaptchaRedisDAO.java index 1c83a7c5c..bfcb7878b 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/common/CaptchaRedisDAO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/common/CaptchaRedisDAO.java @@ -6,7 +6,7 @@ import org.springframework.stereotype.Repository; import javax.annotation.Resource; import java.time.Duration; -import static cn.iocoder.yudao.module.system.dal.redis.SysRedisKeyConstants.CAPTCHA_CODE; +import static cn.iocoder.yudao.module.system.dal.redis.RedisKeyConstants.CAPTCHA_CODE; /** * 验证码的 Redis DAO diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/social/SocialAuthUserRedisDAO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/social/SocialAuthUserRedisDAO.java index 12cdc9486..ac71f1b5d 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/social/SocialAuthUserRedisDAO.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/redis/social/SocialAuthUserRedisDAO.java @@ -8,7 +8,7 @@ import org.springframework.stereotype.Repository; import javax.annotation.Resource; -import static cn.iocoder.yudao.module.system.dal.redis.SysRedisKeyConstants.SOCIAL_AUTH_USER; +import static cn.iocoder.yudao.module.system.dal.redis.RedisKeyConstants.SOCIAL_AUTH_USER; /** diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/common/SysSexEnum.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/common/SexEnum.java similarity index 93% rename from yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/common/SysSexEnum.java rename to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/common/SexEnum.java index 7fd76247a..f6120c418 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/common/SysSexEnum.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/common/SexEnum.java @@ -10,7 +10,7 @@ import lombok.Getter; */ @Getter @AllArgsConstructor -public enum SysSexEnum { +public enum SexEnum { /** 男 */ MALE(1), diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SysSmsReceiveStatusEnum.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SmsReceiveStatusEnum.java similarity index 90% rename from yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SysSmsReceiveStatusEnum.java rename to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SmsReceiveStatusEnum.java index 2b75a45e7..581ee6f9a 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SysSmsReceiveStatusEnum.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SmsReceiveStatusEnum.java @@ -11,7 +11,7 @@ import lombok.Getter; */ @Getter @AllArgsConstructor -public enum SysSmsReceiveStatusEnum { +public enum SmsReceiveStatusEnum { INIT(0), // 初始化 SUCCESS(10), // 接收成功 diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SysSmsSendStatusEnum.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SmsSendStatusEnum.java similarity index 91% rename from yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SysSmsSendStatusEnum.java rename to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SmsSendStatusEnum.java index ea57fa8cc..307c9f6b7 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SysSmsSendStatusEnum.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SmsSendStatusEnum.java @@ -11,7 +11,7 @@ import lombok.Getter; */ @Getter @AllArgsConstructor -public enum SysSmsSendStatusEnum { +public enum SmsSendStatusEnum { INIT(0), // 初始化 SUCCESS(10), // 发送成功 diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SysSmsTemplateTypeEnum.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SmsTemplateTypeEnum.java similarity index 90% rename from yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SysSmsTemplateTypeEnum.java rename to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SmsTemplateTypeEnum.java index 5f853e2d7..d24b07a9e 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SysSmsTemplateTypeEnum.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/enums/sms/SmsTemplateTypeEnum.java @@ -10,7 +10,7 @@ import lombok.Getter; */ @Getter @AllArgsConstructor -public enum SysSmsTemplateTypeEnum { +public enum SmsTemplateTypeEnum { VERIFICATION_CODE(1), // 验证码 NOTICE(2), // 通知 diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/framework/datapermission/config/DataPermissionConfiguration.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/framework/datapermission/config/DataPermissionConfiguration.java index c65c866b5..0be6684c8 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/framework/datapermission/config/DataPermissionConfiguration.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/framework/datapermission/config/DataPermissionConfiguration.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.system.framework.datapermission.config; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.framework.datapermission.core.dept.rule.DeptDataPermissionRuleCustomizer; import org.springframework.context.annotation.Bean; @@ -18,7 +18,7 @@ public class DataPermissionConfiguration { public DeptDataPermissionRuleCustomizer sysDeptDataPermissionRuleCustomizer() { return rule -> { rule.addDeptColumn(AdminUserDO.class); - rule.addDeptColumn(SysDeptDO.class, "id"); + rule.addDeptColumn(DeptDO.class, "id"); }; } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/mq/consumer/sms/SmsSendConsumer.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/mq/consumer/sms/SmsSendConsumer.java index 6fe1db5a5..495c06a9b 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/mq/consumer/sms/SmsSendConsumer.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/mq/consumer/sms/SmsSendConsumer.java @@ -19,12 +19,12 @@ import javax.annotation.Resource; public class SmsSendConsumer extends AbstractStreamMessageListener { @Resource - private SmsSendService smsCoreService; + private SmsSendService smsSendService; @Override public void onMessage(SmsSendMessage message) { log.info("[onMessage][消息内容({})]", message); - smsCoreService.doSendSms(message); + smsSendService.doSendSms(message); } } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java index fe4e502f0..d2fe1ba1a 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java @@ -12,7 +12,7 @@ import cn.iocoder.yudao.module.system.controller.admin.auth.vo.auth.AuthSocialBi import cn.iocoder.yudao.module.system.controller.admin.auth.vo.auth.AuthSocialLogin2ReqVO; import cn.iocoder.yudao.module.system.controller.admin.auth.vo.auth.AuthSocialLoginReqVO; import cn.iocoder.yudao.module.system.convert.auth.AuthConvert; -import cn.iocoder.yudao.module.system.dal.dataobject.social.SysSocialUserDO; +import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.enums.logger.LoginLogTypeEnum; import cn.iocoder.yudao.module.system.enums.logger.LoginResultEnum; @@ -74,7 +74,7 @@ public class AdminAuthServiceImpl implements AdminAuthService { @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { - // 获取 username 对应的 SysUserDO + // 获取 username 对应的 AdminUserDO AdminUserDO user = userService.getUserByUsername(username); if (user == null) { throw new UsernameNotFoundException(username); @@ -85,7 +85,7 @@ public class AdminAuthServiceImpl implements AdminAuthService { @Override public LoginUser mockLogin(Long userId) { - // 获取用户编号对应的 SysUserDO + // 获取用户编号对应的 AdminUserDO AdminUserDO user = userService.getUser(userId); if (user == null) { throw new UsernameNotFoundException(String.valueOf(userId)); @@ -196,9 +196,9 @@ public class AdminAuthServiceImpl implements AdminAuthService { AuthUser authUser = socialService.getAuthUser(reqVO.getType(), reqVO.getCode(), reqVO.getState()); Assert.notNull(authUser, "授权用户不为空"); - // 如果未绑定 SysSocialUserDO 用户,则无法自动登录,进行报错 + // 如果未绑定 SocialUserDO 用户,则无法自动登录,进行报错 String unionId = socialService.getAuthUserUnionId(authUser); - List socialUsers = socialService.getAllSocialUserList(reqVO.getType(), unionId, getUserType().getValue()); + List socialUsers = socialService.getAllSocialUserList(reqVO.getType(), unionId, getUserType().getValue()); if (CollUtil.isEmpty(socialUsers)) { throw exception(AUTH_THIRD_LOGIN_NOT_BIND); } @@ -295,7 +295,7 @@ public class AdminAuthServiceImpl implements AdminAuthService { return loginUser; } - // 重新加载 SysUserDO 信息 + // 重新加载 AdminUserDO 信息 AdminUserDO user = userService.getUser(loginUser.getId()); if (user == null || CommonStatusEnum.DISABLE.getStatus().equals(user.getStatus())) { throw exception(AUTH_TOKEN_EXPIRED); // 校验 token 时,用户被禁用的情况下,也认为 token 过期,方便前端跳转到登录界面 diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/auth/UserSessionService.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/auth/UserSessionService.java index ef9e92caa..779f33a47 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/auth/UserSessionService.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/auth/UserSessionService.java @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.system.service.auth; import cn.iocoder.yudao.framework.security.core.LoginUser; import cn.iocoder.yudao.module.system.controller.admin.auth.vo.session.UserSessionPageReqVO; -import cn.iocoder.yudao.module.system.dal.dataobject.auth.SysUserSessionDO; +import cn.iocoder.yudao.module.system.dal.dataobject.auth.UserSessionDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; /** @@ -18,7 +18,7 @@ public interface UserSessionService { * @param reqVO 分页条件 * @return 份额与列表 */ - PageResult getUserSessionPage(UserSessionPageReqVO reqVO); + PageResult getUserSessionPage(UserSessionPageReqVO reqVO); /** * 移除超时的在线用户 diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/auth/UserSessionServiceImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/auth/UserSessionServiceImpl.java index beced6bd1..a1118958a 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/auth/UserSessionServiceImpl.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/auth/UserSessionServiceImpl.java @@ -6,13 +6,13 @@ import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.security.config.SecurityProperties; import cn.iocoder.yudao.framework.security.core.LoginUser; import cn.iocoder.yudao.module.system.controller.admin.auth.vo.session.UserSessionPageReqVO; +import cn.iocoder.yudao.module.system.dal.dataobject.auth.UserSessionDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; -import cn.iocoder.yudao.module.system.dal.mysql.auth.SysUserSessionMapper; +import cn.iocoder.yudao.module.system.dal.mysql.auth.UserSessionMapper; import cn.iocoder.yudao.module.system.enums.logger.LoginLogTypeEnum; import cn.iocoder.yudao.module.system.enums.logger.LoginResultEnum; import cn.iocoder.yudao.module.system.service.logger.LoginLogService; import cn.iocoder.yudao.module.system.service.user.AdminUserService; -import cn.iocoder.yudao.module.system.dal.dataobject.auth.SysUserSessionDO; import cn.iocoder.yudao.module.system.dal.redis.auth.LoginUserRedisDAO; import cn.iocoder.yudao.module.system.api.logger.dto.LoginLogCreateReqDTO; import cn.iocoder.yudao.framework.common.pojo.PageResult; @@ -39,7 +39,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.addTime; public class UserSessionServiceImpl implements UserSessionService { @Resource - private SysUserSessionMapper userSessionMapper; + private UserSessionMapper userSessionMapper; @Resource private AdminUserService userService; @@ -47,13 +47,13 @@ public class UserSessionServiceImpl implements UserSessionService { private LoginLogService loginLogService; @Resource - private LoginUserRedisDAO loginUserCoreRedisDAO; + private LoginUserRedisDAO loginUserRedisDAO; @Resource private SecurityProperties securityProperties; @Override - public PageResult getUserSessionPage(UserSessionPageReqVO reqVO) { + public PageResult getUserSessionPage(UserSessionPageReqVO reqVO) { // 处理基于用户昵称的查询 Collection userIds = null; if (StrUtil.isNotEmpty(reqVO.getUsername())) { @@ -69,11 +69,11 @@ public class UserSessionServiceImpl implements UserSessionService { @Override public long clearSessionTimeout() { // 获取db里已经超时的用户列表 - List sessionTimeoutDOS = userSessionMapper.selectListBySessionTimoutLt(); - Map timeoutSessionDOMap = sessionTimeoutDOS + List sessionTimeoutDOS = userSessionMapper.selectListBySessionTimoutLt(); + Map timeoutSessionDOMap = sessionTimeoutDOS .stream() - .filter(sessionDO -> loginUserCoreRedisDAO.get(sessionDO.getId()) == null) - .collect(Collectors.toMap(SysUserSessionDO::getId, o -> o)); + .filter(sessionDO -> loginUserRedisDAO.get(sessionDO.getId()) == null) + .collect(Collectors.toMap(UserSessionDO::getId, o -> o)); // 确认已经超时,按批次移出在线用户列表 if (CollUtil.isNotEmpty(timeoutSessionDOMap)) { Lists.partition(new ArrayList<>(timeoutSessionDOMap.keySet()), 100) @@ -84,8 +84,8 @@ public class UserSessionServiceImpl implements UserSessionService { return timeoutSessionDOMap.size(); } - private void createTimeoutLogoutLog(Collection timeoutSessionDOS) { - for (SysUserSessionDO timeoutSessionDO : timeoutSessionDOS) { + private void createTimeoutLogoutLog(Collection timeoutSessionDOS) { + for (UserSessionDO timeoutSessionDO : timeoutSessionDOS) { LoginLogCreateReqDTO reqDTO = new LoginLogCreateReqDTO(); reqDTO.setLogType(LoginLogTypeEnum.LOGOUT_TIMEOUT.getType()); reqDTO.setTraceId(TracerUtils.getTraceId()); @@ -105,9 +105,9 @@ public class UserSessionServiceImpl implements UserSessionService { String sessionId = generateSessionId(); // 写入 Redis 缓存 loginUser.setUpdateTime(new Date()); - loginUserCoreRedisDAO.set(sessionId, loginUser); + loginUserRedisDAO.set(sessionId, loginUser); // 写入 DB 中 - SysUserSessionDO userSession = SysUserSessionDO.builder().id(sessionId) + UserSessionDO userSession = UserSessionDO.builder().id(sessionId) .userId(loginUser.getId()).userType(loginUser.getUserType()) .userIp(userIp).userAgent(userAgent).username(loginUser.getUsername()) .sessionTimeout(addTime(Duration.ofMillis(getSessionTimeoutMillis()))) @@ -121,9 +121,9 @@ public class UserSessionServiceImpl implements UserSessionService { public void refreshUserSession(String sessionId, LoginUser loginUser) { // 写入 Redis 缓存 loginUser.setUpdateTime(new Date()); - loginUserCoreRedisDAO.set(sessionId, loginUser); + loginUserRedisDAO.set(sessionId, loginUser); // 更新 DB 中 - SysUserSessionDO updateObj = SysUserSessionDO.builder().id(sessionId).build(); + UserSessionDO updateObj = UserSessionDO.builder().id(sessionId).build(); updateObj.setUsername(loginUser.getUsername()); updateObj.setUpdateTime(new Date()); updateObj.setSessionTimeout(addTime(Duration.ofMillis(getSessionTimeoutMillis()))); @@ -133,14 +133,14 @@ public class UserSessionServiceImpl implements UserSessionService { @Override public void deleteUserSession(String sessionId) { // 删除 Redis 缓存 - loginUserCoreRedisDAO.delete(sessionId); + loginUserRedisDAO.delete(sessionId); // 删除 DB 记录 userSessionMapper.deleteById(sessionId); } @Override public LoginUser getLoginUser(String sessionId) { - return loginUserCoreRedisDAO.get(sessionId); + return loginUserRedisDAO.get(sessionId); } @Override diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java index c9aa07c56..3716c906f 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java @@ -5,7 +5,7 @@ import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptUpdateReqVO; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; import java.util.Collection; import java.util.Collections; @@ -53,7 +53,7 @@ public interface DeptService { * @param reqVO 筛选条件请求 VO * @return 部门列表 */ - List getSimpleDepts(DeptListReqVO reqVO); + List getSimpleDepts(DeptListReqVO reqVO); /** * 获得所有子部门,从缓存中 @@ -62,7 +62,7 @@ public interface DeptService { * @param recursive 是否递归获取所有 * @return 子部门列表 */ - List getDeptsByParentIdFromCache(Long parentId, boolean recursive); + List getDeptsByParentIdFromCache(Long parentId, boolean recursive); /** * 获得部门信息数组 @@ -70,7 +70,7 @@ public interface DeptService { * @param ids 部门编号数组 * @return 部门信息数组 */ - List getDepts(Collection ids); + List getDepts(Collection ids); /** * 获得部门信息 @@ -78,7 +78,7 @@ public interface DeptService { * @param id 部门编号 * @return 部门信息 */ - SysDeptDO getDept(Long id); + DeptDO getDept(Long id); /** * 校验部门们是否有效。如下情况,视为无效: @@ -95,7 +95,7 @@ public interface DeptService { * @param ids 部门编号数组 * @return 部门列表 */ - List getSimpleDepts(Collection ids); + List getSimpleDepts(Collection ids); /** * 获得指定编号的部门 Map @@ -103,11 +103,11 @@ public interface DeptService { * @param ids 部门编号数组 * @return 部门 Map */ - default Map getDeptMap(Collection ids) { + default Map getDeptMap(Collection ids) { if (CollUtil.isEmpty(ids)) { return Collections.emptyMap(); } - List list = getSimpleDepts(ids); - return CollectionUtils.convertMap(list, SysDeptDO::getId); + List list = getSimpleDepts(ids); + return CollectionUtils.convertMap(list, DeptDO::getId); } } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java index a21ccfb7b..955ce890a 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java @@ -9,8 +9,8 @@ import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptCreateRe import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptUpdateReqVO; import cn.iocoder.yudao.module.system.convert.dept.DeptConvert; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; -import cn.iocoder.yudao.module.system.dal.mysql.dept.SysDeptMapper; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; +import cn.iocoder.yudao.module.system.dal.mysql.dept.DeptMapper; import cn.iocoder.yudao.module.system.enums.dept.DeptIdEnum; import cn.iocoder.yudao.module.system.mq.producer.dept.DeptProducer; import com.google.common.collect.ImmutableMap; @@ -46,27 +46,27 @@ public class DeptServiceImpl implements DeptService { /** * 部门缓存 - * key:部门编号 {@link SysDeptDO#getId()} + * key:部门编号 {@link DeptDO#getId()} * * 这里声明 volatile 修饰的原因是,每次刷新时,直接修改指向 */ @SuppressWarnings("FieldCanBeLocal") - private volatile Map deptCache; + private volatile Map deptCache; /** * 父部门缓存 - * key:部门编号 {@link SysDeptDO#getParentId()} + * key:部门编号 {@link DeptDO#getParentId()} * value: 直接子部门列表 * * 这里声明 volatile 修饰的原因是,每次刷新时,直接修改指向 */ - private volatile Multimap parentDeptCache; + private volatile Multimap parentDeptCache; /** * 缓存部门的最大更新时间,用于后续的增量轮询,判断是否有更新 */ private volatile Date maxUpdateTime; @Resource - private SysDeptMapper deptMapper; + private DeptMapper deptMapper; @Resource private DeptProducer deptProducer; @@ -75,14 +75,14 @@ public class DeptServiceImpl implements DeptService { @PostConstruct public synchronized void initLocalCache() { // 获取部门列表,如果有更新 - List deptList = this.loadDeptIfUpdate(maxUpdateTime); + List deptList = this.loadDeptIfUpdate(maxUpdateTime); if (CollUtil.isEmpty(deptList)) { return; } // 构建缓存 - ImmutableMap.Builder builder = ImmutableMap.builder(); - ImmutableMultimap.Builder parentBuilder = ImmutableMultimap.builder(); + ImmutableMap.Builder builder = ImmutableMap.builder(); + ImmutableMultimap.Builder parentBuilder = ImmutableMultimap.builder(); deptList.forEach(sysRoleDO -> { builder.put(sysRoleDO.getId(), sysRoleDO); parentBuilder.put(sysRoleDO.getParentId(), sysRoleDO); @@ -107,7 +107,7 @@ public class DeptServiceImpl implements DeptService { * @param maxUpdateTime 当前部门的最大更新时间 * @return 部门列表 */ - private List loadDeptIfUpdate(Date maxUpdateTime) { + private List loadDeptIfUpdate(Date maxUpdateTime) { // 第一步,判断是否要更新。 if (maxUpdateTime == null) { // 如果更新时间为空,说明 DB 一定有新数据 log.info("[loadMenuIfUpdate][首次加载全量部门]"); @@ -126,7 +126,7 @@ public class DeptServiceImpl implements DeptService { // 校验正确性 checkCreateOrUpdate(null, reqVO.getParentId(), reqVO.getName()); // 插入部门 - SysDeptDO dept = DeptConvert.INSTANCE.convert(reqVO); + DeptDO dept = DeptConvert.INSTANCE.convert(reqVO); deptMapper.insert(dept); // 发送刷新消息 deptProducer.sendDeptRefreshMessage(); @@ -138,7 +138,7 @@ public class DeptServiceImpl implements DeptService { // 校验正确性 checkCreateOrUpdate(reqVO.getId(), reqVO.getParentId(), reqVO.getName()); // 更新部门 - SysDeptDO updateObj = DeptConvert.INSTANCE.convert(reqVO); + DeptDO updateObj = DeptConvert.INSTANCE.convert(reqVO); deptMapper.updateById(updateObj); // 发送刷新消息 deptProducer.sendDeptRefreshMessage(); @@ -159,16 +159,16 @@ public class DeptServiceImpl implements DeptService { } @Override - public List getSimpleDepts(DeptListReqVO reqVO) { + public List getSimpleDepts(DeptListReqVO reqVO) { return deptMapper.selectList(reqVO); } @Override - public List getDeptsByParentIdFromCache(Long parentId, boolean recursive) { + public List getDeptsByParentIdFromCache(Long parentId, boolean recursive) { if (parentId == null) { return Collections.emptyList(); } - List result = new ArrayList<>(); // TODO 芋艿:待优化,新增缓存,避免每次遍历的计算 + List result = new ArrayList<>(); // TODO 芋艿:待优化,新增缓存,避免每次遍历的计算 // 递归,简单粗暴 this.getDeptsByParentIdFromCache(result, parentId, recursive ? Integer.MAX_VALUE : 1, // 如果递归获取,则无限;否则,只递归 1 次 @@ -184,14 +184,14 @@ public class DeptServiceImpl implements DeptService { * @param recursiveCount 递归次数 * @param parentDeptMap 父部门 Map,使用缓存,避免变化 */ - private void getDeptsByParentIdFromCache(List result, Long parentId, int recursiveCount, - Multimap parentDeptMap) { + private void getDeptsByParentIdFromCache(List result, Long parentId, int recursiveCount, + Multimap parentDeptMap) { // 递归次数为 0,结束! if (recursiveCount == 0) { return; } // 获得子部门 - Collection depts = parentDeptMap.get(parentId); + Collection depts = parentDeptMap.get(parentId); if (CollUtil.isEmpty(depts)) { return; } @@ -219,7 +219,7 @@ public class DeptServiceImpl implements DeptService { throw ServiceExceptionUtil.exception(DEPT_PARENT_ERROR); } // 父岗位不存在 - SysDeptDO dept = deptMapper.selectById(parentId); + DeptDO dept = deptMapper.selectById(parentId); if (dept == null) { throw ServiceExceptionUtil.exception(DEPT_PARENT_NOT_EXITS); } @@ -228,7 +228,7 @@ public class DeptServiceImpl implements DeptService { throw ServiceExceptionUtil.exception(DEPT_NOT_ENABLE); } // 父部门不能是原来的子部门 - List children = this.getDeptsByParentIdFromCache(id, true); + List children = this.getDeptsByParentIdFromCache(id, true); if (children.stream().anyMatch(dept1 -> dept1.getId().equals(parentId))) { throw ServiceExceptionUtil.exception(DEPT_PARENT_IS_CHILD); } @@ -238,14 +238,14 @@ public class DeptServiceImpl implements DeptService { if (id == null) { return; } - SysDeptDO dept = deptMapper.selectById(id); + DeptDO dept = deptMapper.selectById(id); if (dept == null) { throw ServiceExceptionUtil.exception(DEPT_NOT_FOUND); } } private void checkDeptNameUnique(Long id, Long parentId, String name) { - SysDeptDO menu = deptMapper.selectByParentIdAndName(parentId, name); + DeptDO menu = deptMapper.selectByParentIdAndName(parentId, name); if (menu == null) { return; } @@ -259,12 +259,12 @@ public class DeptServiceImpl implements DeptService { } @Override - public List getDepts(Collection ids) { + public List getDepts(Collection ids) { return deptMapper.selectBatchIds(ids); } @Override - public SysDeptDO getDept(Long id) { + public DeptDO getDept(Long id) { return deptMapper.selectById(id); } @@ -274,11 +274,11 @@ public class DeptServiceImpl implements DeptService { return; } // 获得科室信息 - List depts = deptMapper.selectBatchIds(ids); - Map deptMap = CollectionUtils.convertMap(depts, SysDeptDO::getId); + List depts = deptMapper.selectBatchIds(ids); + Map deptMap = CollectionUtils.convertMap(depts, DeptDO::getId); // 校验 ids.forEach(id -> { - SysDeptDO dept = deptMap.get(id); + DeptDO dept = deptMap.get(id); if (dept == null) { throw exception(DEPT_NOT_FOUND); } @@ -289,7 +289,7 @@ public class DeptServiceImpl implements DeptService { } @Override - public List getSimpleDepts(Collection ids) { + public List getSimpleDepts(Collection ids) { return deptMapper.selectBatchIds(ids); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dept/PostService.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dept/PostService.java index 30b8fcc9a..fc74c944a 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dept/PostService.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dept/PostService.java @@ -6,7 +6,7 @@ import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostCreateRe 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.module.system.controller.admin.dept.vo.post.PostUpdateReqVO; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysPostDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; import org.springframework.lang.Nullable; import java.util.Collection; @@ -49,7 +49,7 @@ public interface PostService { * @param ids 岗位编号数组。如果为空,不进行筛选 * @return 部门列表 */ - default List getPosts(@Nullable Collection ids) { + default List getPosts(@Nullable Collection ids) { return getPosts(ids, asSet(CommonStatusEnum.ENABLE.getStatus(), CommonStatusEnum.DISABLE.getStatus())); } @@ -60,7 +60,7 @@ public interface PostService { * @param statuses 状态数组。如果为空,不进行筛选 * @return 部门列表 */ - List getPosts(@Nullable Collection ids, @Nullable Collection statuses); + List getPosts(@Nullable Collection ids, @Nullable Collection statuses); /** * 获得岗位分页列表 @@ -68,7 +68,7 @@ public interface PostService { * @param reqVO 分页条件 * @return 部门分页列表 */ - PageResult getPostPage(PostPageReqVO reqVO); + PageResult getPostPage(PostPageReqVO reqVO); /** * 获得岗位列表 @@ -76,7 +76,7 @@ public interface PostService { * @param reqVO 查询条件 * @return 部门列表 */ - List getPosts(PostExportReqVO reqVO); + List getPosts(PostExportReqVO reqVO); /** * 获得岗位信息 @@ -84,7 +84,7 @@ public interface PostService { * @param id 岗位编号 * @return 岗位信息 */ - SysPostDO getPost(Long id); + PostDO getPost(Long id); /** * 校验岗位们是否有效。如下情况,视为无效: diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dept/PostServiceImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dept/PostServiceImpl.java index f6bb471f6..81e003152 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dept/PostServiceImpl.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dept/PostServiceImpl.java @@ -9,8 +9,8 @@ import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostExportRe import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostPageReqVO; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostUpdateReqVO; import cn.iocoder.yudao.module.system.convert.dept.PostConvert; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysPostDO; -import cn.iocoder.yudao.module.system.dal.mysql.dept.SysPostMapper; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; +import cn.iocoder.yudao.module.system.dal.mysql.dept.PostMapper; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; @@ -33,14 +33,14 @@ import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; public class PostServiceImpl implements PostService { @Resource - private SysPostMapper postMapper; + private PostMapper postMapper; @Override public Long createPost(PostCreateReqVO reqVO) { // 校验正确性 this.checkCreateOrUpdate(null, reqVO.getName(), reqVO.getCode()); // 插入岗位 - SysPostDO post = PostConvert.INSTANCE.convert(reqVO); + PostDO post = PostConvert.INSTANCE.convert(reqVO); postMapper.insert(post); return post.getId(); } @@ -50,7 +50,7 @@ public class PostServiceImpl implements PostService { // 校验正确性 this.checkCreateOrUpdate(reqVO.getId(), reqVO.getName(), reqVO.getCode()); // 更新岗位 - SysPostDO updateObj = PostConvert.INSTANCE.convert(reqVO); + PostDO updateObj = PostConvert.INSTANCE.convert(reqVO); postMapper.updateById(updateObj); } @@ -63,22 +63,22 @@ public class PostServiceImpl implements PostService { } @Override - public List getPosts(Collection ids, Collection statuses) { + public List getPosts(Collection ids, Collection statuses) { return postMapper.selectList(ids, statuses); } @Override - public PageResult getPostPage(PostPageReqVO reqVO) { + public PageResult getPostPage(PostPageReqVO reqVO) { return postMapper.selectPage(reqVO); } @Override - public List getPosts(PostExportReqVO reqVO) { + public List getPosts(PostExportReqVO reqVO) { return postMapper.selectList(reqVO); } @Override - public SysPostDO getPost(Long id) { + public PostDO getPost(Long id) { return postMapper.selectById(id); } @@ -92,7 +92,7 @@ public class PostServiceImpl implements PostService { } private void checkPostNameUnique(Long id, String name) { - SysPostDO post = postMapper.selectByName(name); + PostDO post = postMapper.selectByName(name); if (post == null) { return; } @@ -106,7 +106,7 @@ public class PostServiceImpl implements PostService { } private void checkPostCodeUnique(Long id, String code) { - SysPostDO post = postMapper.selectByCode(code); + PostDO post = postMapper.selectByCode(code); if (post == null) { return; } @@ -123,7 +123,7 @@ public class PostServiceImpl implements PostService { if (id == null) { return; } - SysPostDO post = postMapper.selectById(id); + PostDO post = postMapper.selectById(id); if (post == null) { throw ServiceExceptionUtil.exception(POST_NOT_FOUND); } @@ -135,11 +135,11 @@ public class PostServiceImpl implements PostService { return; } // 获得岗位信息 - List posts = postMapper.selectBatchIds(ids); - Map postMap = convertMap(posts, SysPostDO::getId); + List posts = postMapper.selectBatchIds(ids); + Map postMap = convertMap(posts, PostDO::getId); // 校验 ids.forEach(id -> { - SysPostDO post = postMap.get(id); + PostDO post = postMap.get(id); if (post == null) { throw exception(POST_NOT_FOUND); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataService.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataService.java index 8d20c5aab..0742f8293 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataService.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataService.java @@ -1,7 +1,7 @@ package cn.iocoder.yudao.module.system.service.dict; import cn.iocoder.yudao.framework.dict.core.service.DictDataFrameworkService; -import cn.iocoder.yudao.module.system.dal.dataobject.dict.SysDictDataDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataExportReqVO; @@ -50,7 +50,7 @@ public interface DictDataService extends DictDataFrameworkService { * * @return 字典数据全列表 */ - List getDictDatas(); + List getDictDatas(); /** * 获得字典数据分页列表 @@ -58,7 +58,7 @@ public interface DictDataService extends DictDataFrameworkService { * @param reqVO 分页请求 * @return 字典数据分页列表 */ - PageResult getDictDataPage(DictDataPageReqVO reqVO); + PageResult getDictDataPage(DictDataPageReqVO reqVO); /** * 获得字典数据列表 @@ -66,7 +66,7 @@ public interface DictDataService extends DictDataFrameworkService { * @param reqVO 列表请求 * @return 字典数据列表 */ - List getDictDatas(DictDataExportReqVO reqVO); + List getDictDatas(DictDataExportReqVO reqVO); /** * 获得字典数据详情 @@ -74,7 +74,7 @@ public interface DictDataService extends DictDataFrameworkService { * @param id 字典数据编号 * @return 字典数据 */ - SysDictDataDO getDictData(Long id); + DictDataDO getDictData(Long id); /** * 获得指定字典类型的数据数量 diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImpl.java index b483f4167..1ecbdd41c 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImpl.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImpl.java @@ -10,10 +10,9 @@ import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataExpo import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataPageReqVO; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataUpdateReqVO; import cn.iocoder.yudao.module.system.convert.dict.DictDataConvert; -import cn.iocoder.yudao.module.system.convert.dict.SysDictDataCoreConvert; +import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictTypeDO; -import cn.iocoder.yudao.module.system.dal.dataobject.dict.SysDictDataDO; -import cn.iocoder.yudao.module.system.dal.mysql.dict.SysDictDataMapper; +import cn.iocoder.yudao.module.system.dal.mysql.dict.DictDataMapper; import cn.iocoder.yudao.module.system.mq.producer.dict.DictDataProducer; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableMap; @@ -44,9 +43,9 @@ public class DictDataServiceImpl implements DictDataService { /** * 排序 dictType > sort */ - private static final Comparator COMPARATOR_TYPE_AND_SORT = Comparator - .comparing(SysDictDataDO::getDictType) - .thenComparingInt(SysDictDataDO::getSort); + private static final Comparator COMPARATOR_TYPE_AND_SORT = Comparator + .comparing(DictDataDO::getDictType) + .thenComparingInt(DictDataDO::getSort); /** * 定时执行 {@link #schedulePeriodicRefresh()} 的周期 @@ -58,7 +57,7 @@ public class DictDataServiceImpl implements DictDataService { private DictTypeService dictTypeService; @Resource - private SysDictDataMapper dictDataMapper; + private DictDataMapper dictDataMapper; @Resource private DictDataProducer dictDataProducer; @@ -69,14 +68,14 @@ public class DictDataServiceImpl implements DictDataService { * key1:字典类型 dictType * key2:字典标签 label */ - private ImmutableTable labelDictDataCache; + private ImmutableTable labelDictDataCache; /** * 字典数据缓存,第二个 key 使用 value * * key1:字典类型 dictType * key2:字典值 value */ - private ImmutableTable valueDictDataCache; + private ImmutableTable valueDictDataCache; /** * 缓存字典数据的最大更新时间,用于后续的增量轮询,判断是否有更新 */ @@ -86,14 +85,14 @@ public class DictDataServiceImpl implements DictDataService { @PostConstruct public synchronized void initLocalCache() { // 获取字典数据列表,如果有更新 - List dataList = loadDictDataIfUpdate(maxUpdateTime); + List dataList = loadDictDataIfUpdate(maxUpdateTime); if (CollUtil.isEmpty(dataList)) { return; } // 构建缓存 - ImmutableTable.Builder labelDictDataBuilder = ImmutableTable.builder(); - ImmutableTable.Builder valueDictDataBuilder = ImmutableTable.builder(); + ImmutableTable.Builder labelDictDataBuilder = ImmutableTable.builder(); + ImmutableTable.Builder valueDictDataBuilder = ImmutableTable.builder(); dataList.forEach(dictData -> { labelDictDataBuilder.put(dictData.getDictType(), dictData.getLabel(), dictData); valueDictDataBuilder.put(dictData.getDictType(), dictData.getValue(), dictData); @@ -112,7 +111,7 @@ public class DictDataServiceImpl implements DictDataService { * @param maxUpdateTime 当前字典数据的最大更新时间 * @return 字典数据列表 */ - private List loadDictDataIfUpdate(Date maxUpdateTime) { + private List loadDictDataIfUpdate(Date maxUpdateTime) { // 第一步,判断是否要更新。 if (maxUpdateTime == null) { // 如果更新时间为空,说明 DB 一定有新数据 log.info("[loadDictDataIfUpdate][首次加载全量字典数据]"); @@ -132,42 +131,42 @@ public class DictDataServiceImpl implements DictDataService { } @Override - public List getDictDatas() { - List list = dictDataMapper.selectList(); + public List getDictDatas() { + List list = dictDataMapper.selectList(); list.sort(COMPARATOR_TYPE_AND_SORT); return list; } @Override - public PageResult getDictDataPage(DictDataPageReqVO reqVO) { + public PageResult getDictDataPage(DictDataPageReqVO reqVO) { return dictDataMapper.selectPage(reqVO); } @Override - public List getDictDatas(DictDataExportReqVO reqVO) { - List list = dictDataMapper.selectList(reqVO); + public List getDictDatas(DictDataExportReqVO reqVO) { + List list = dictDataMapper.selectList(reqVO); list.sort(COMPARATOR_TYPE_AND_SORT); return list; } @Override - public SysDictDataDO getDictData(Long id) { + public DictDataDO getDictData(Long id) { return dictDataMapper.selectById(id); } @Override public DictDataRespDTO getDictDataFromCache(String type, String value) { - return SysDictDataCoreConvert.INSTANCE.convert02(valueDictDataCache.get(type, value)); + return DictDataConvert.INSTANCE.convert02(valueDictDataCache.get(type, value)); } @Override public DictDataRespDTO parseDictDataFromCache(String type, String label) { - return SysDictDataCoreConvert.INSTANCE.convert02(labelDictDataCache.get(type, label)); + return DictDataConvert.INSTANCE.convert02(labelDictDataCache.get(type, label)); } @Override public List listDictDatasFromCache(String type) { - return SysDictDataCoreConvert.INSTANCE.convertList03(labelDictDataCache.row(type).values()); + return DictDataConvert.INSTANCE.convertList03(labelDictDataCache.row(type).values()); } @Override @@ -176,7 +175,7 @@ public class DictDataServiceImpl implements DictDataService { checkCreateOrUpdate(null, reqVO.getValue(), reqVO.getDictType()); // 插入字典类型 - SysDictDataDO dictData = DictDataConvert.INSTANCE.convert(reqVO); + DictDataDO dictData = DictDataConvert.INSTANCE.convert(reqVO); dictDataMapper.insert(dictData); // 发送刷新消息 @@ -190,7 +189,7 @@ public class DictDataServiceImpl implements DictDataService { checkCreateOrUpdate(reqVO.getId(), reqVO.getValue(), reqVO.getDictType()); // 更新字典类型 - SysDictDataDO updateObj = DictDataConvert.INSTANCE.convert(reqVO); + DictDataDO updateObj = DictDataConvert.INSTANCE.convert(reqVO); dictDataMapper.updateById(updateObj); // 发送刷新消息 @@ -226,7 +225,7 @@ public class DictDataServiceImpl implements DictDataService { @VisibleForTesting public void checkDictDataValueUnique(Long id, String dictType, String value) { - SysDictDataDO dictData = dictDataMapper.selectByDictTypeAndValue(dictType, value); + DictDataDO dictData = dictDataMapper.selectByDictTypeAndValue(dictType, value); if (dictData == null) { return; } @@ -244,7 +243,7 @@ public class DictDataServiceImpl implements DictDataService { if (id == null) { return; } - SysDictDataDO dictData = dictDataMapper.selectById(id); + DictDataDO dictData = dictDataMapper.selectById(id); if (dictData == null) { throw exception(DICT_DATA_NOT_EXISTS); } @@ -266,10 +265,10 @@ public class DictDataServiceImpl implements DictDataService { if (CollUtil.isEmpty(values)) { return; } - ImmutableMap dictDataMap = valueDictDataCache.row(dictType); + ImmutableMap dictDataMap = valueDictDataCache.row(dictType); // 校验 values.forEach(value -> { - SysDictDataDO dictData = dictDataMap.get(value); + DictDataDO dictData = dictDataMap.get(value); if (dictData == null) { throw exception(DICT_DATA_NOT_EXISTS); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceImpl.java index b9bcaf61e..c0677aff1 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceImpl.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceImpl.java @@ -7,7 +7,7 @@ import cn.iocoder.yudao.module.system.controller.admin.dict.vo.type.DictTypePage import cn.iocoder.yudao.module.system.controller.admin.dict.vo.type.DictTypeUpdateReqVO; import cn.iocoder.yudao.module.system.convert.dict.DictTypeConvert; import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictTypeDO; -import cn.iocoder.yudao.module.system.dal.mysql.dict.SysDictTypeMapper; +import cn.iocoder.yudao.module.system.dal.mysql.dict.DictTypeMapper; import com.google.common.annotations.VisibleForTesting; import org.springframework.stereotype.Service; @@ -29,7 +29,7 @@ public class DictTypeServiceImpl implements DictTypeService { private DictDataService dictDataService; @Resource - private SysDictTypeMapper dictTypeMapper; + private DictTypeMapper dictTypeMapper; @Override public PageResult getDictTypePage(DictTypePageReqVO reqVO) { diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceImpl.java index d347d7981..a34f098cd 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceImpl.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceImpl.java @@ -10,7 +10,7 @@ import cn.iocoder.yudao.module.system.framework.errorcode.core.dto.ErrorCodeResp import cn.iocoder.yudao.module.system.convert.errorcode.ErrorCodeConvert; import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodeExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodePageReqVO; -import cn.iocoder.yudao.module.system.dal.mysql.errorcode.SysErrorCodeMapper; +import cn.iocoder.yudao.module.system.dal.mysql.errorcode.ErrorCodeMapper; import cn.iocoder.yudao.module.system.enums.errorcode.ErrorCodeTypeEnum; import com.google.common.annotations.VisibleForTesting; import lombok.extern.slf4j.Slf4j; @@ -39,7 +39,7 @@ import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils. public class ErrorCodeServiceImpl implements ErrorCodeService { @Resource - private SysErrorCodeMapper errorCodeMapper; + private ErrorCodeMapper errorCodeMapper; @Override public Long createErrorCode(ErrorCodeCreateReqVO createReqVO) { diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/logger/LoginLogService.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/logger/LoginLogService.java index 152236adf..38b4fe78e 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/logger/LoginLogService.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/logger/LoginLogService.java @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.system.service.logger; import cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog.LoginLogExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog.LoginLogPageReqVO; -import cn.iocoder.yudao.module.system.dal.dataobject.logger.SysLoginLogDO; +import cn.iocoder.yudao.module.system.dal.dataobject.logger.LoginLogDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.system.api.logger.dto.LoginLogCreateReqDTO; @@ -20,7 +20,7 @@ public interface LoginLogService { * @param reqVO 分页条件 * @return 登录日志分页 */ - PageResult getLoginLogPage(LoginLogPageReqVO reqVO); + PageResult getLoginLogPage(LoginLogPageReqVO reqVO); /** * 获得登录日志列表 @@ -28,7 +28,7 @@ public interface LoginLogService { * @param reqVO 列表条件 * @return 登录日志列表 */ - List getLoginLogList(LoginLogExportReqVO reqVO); + List getLoginLogList(LoginLogExportReqVO reqVO); /** * 创建登录日志 diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/logger/LoginLogServiceImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/logger/LoginLogServiceImpl.java index 0233b7c10..78ad540ba 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/logger/LoginLogServiceImpl.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/logger/LoginLogServiceImpl.java @@ -1,12 +1,12 @@ package cn.iocoder.yudao.module.system.service.logger; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.system.api.logger.dto.LoginLogCreateReqDTO; import cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog.LoginLogExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog.LoginLogPageReqVO; -import cn.iocoder.yudao.module.system.convert.logger.SysLoginLogCoreConvert; -import cn.iocoder.yudao.module.system.dal.dataobject.logger.SysLoginLogDO; +import cn.iocoder.yudao.module.system.convert.logger.LoginLogConvert; +import cn.iocoder.yudao.module.system.dal.dataobject.logger.LoginLogDO; import cn.iocoder.yudao.module.system.dal.mysql.logger.LoginLogMapper; -import cn.iocoder.yudao.module.system.api.logger.dto.LoginLogCreateReqDTO; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -22,18 +22,18 @@ public class LoginLogServiceImpl implements LoginLogService { private LoginLogMapper loginLogMapper; @Override - public PageResult getLoginLogPage(LoginLogPageReqVO reqVO) { + public PageResult getLoginLogPage(LoginLogPageReqVO reqVO) { return loginLogMapper.selectPage(reqVO); } @Override - public List getLoginLogList(LoginLogExportReqVO reqVO) { + public List getLoginLogList(LoginLogExportReqVO reqVO) { return loginLogMapper.selectList(reqVO); } @Override public void createLoginLog(LoginLogCreateReqDTO reqDTO) { - SysLoginLogDO loginLog = SysLoginLogCoreConvert.INSTANCE.convert(reqDTO); + LoginLogDO loginLog = LoginLogConvert.INSTANCE.convert(reqDTO); loginLogMapper.insert(loginLog); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/notice/NoticeServiceImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/notice/NoticeServiceImpl.java index 2ca561ac4..2b796e28c 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/notice/NoticeServiceImpl.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/notice/NoticeServiceImpl.java @@ -6,7 +6,7 @@ import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticeCreateReq import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticePageReqVO; import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticeUpdateReqVO; import cn.iocoder.yudao.module.system.convert.notice.NoticeConvert; -import cn.iocoder.yudao.module.system.dal.mysql.notice.SysNoticeMapper; +import cn.iocoder.yudao.module.system.dal.mysql.notice.NoticeMapper; import cn.iocoder.yudao.module.system.dal.dataobject.notice.NoticeDO; import com.google.common.annotations.VisibleForTesting; import org.springframework.stereotype.Service; @@ -24,7 +24,7 @@ import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.NOTICE_NOT public class NoticeServiceImpl implements NoticeService { @Resource - private SysNoticeMapper noticeMapper; + private NoticeMapper noticeMapper; @Override public Long createNotice(NoticeCreateReqVO reqVO) { diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java index fe2b573c0..40d8c13c5 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java @@ -56,7 +56,7 @@ public class MenuServiceImpl implements MenuService { /** * 权限与菜单缓存 * key:权限 {@link MenuDO#getPermission()} - * value:SysMenuDO 数组,因为一个权限可能对应多个 SysMenuDO 对象 + * value:MenuDO 数组,因为一个权限可能对应多个 MenuDO 对象 * * 这里声明 volatile 修饰的原因是,每次刷新时,直接修改指向 */ diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceImpl.java index 05f15ec9e..cb86bc7ad 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceImpl.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceImpl.java @@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.system.service.permission; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.ArrayUtil; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; import cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO; import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleMenuDO; @@ -383,8 +383,8 @@ public class PermissionServiceImpl implements PermissionService { } // 情况四,DEPT_DEPT_AND_CHILD if (Objects.equals(role.getDataScope(), DataScopeEnum.DEPT_AND_CHILD.getScope())) { - List depts = deptService.getDeptsByParentIdFromCache(loginUser.getDeptId(), true); - CollUtil.addAll(result.getDeptIds(), CollectionUtils.convertList(depts, SysDeptDO::getId)); + List depts = deptService.getDeptsByParentIdFromCache(loginUser.getDeptId(), true); + CollUtil.addAll(result.getDeptIds(), CollectionUtils.convertList(depts, DeptDO::getId)); continue; } // 情况五,SELF diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelService.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelService.java index f5950a23d..50e13a602 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelService.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelService.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.system.service.sms; -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsChannelDO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelPageReqVO; @@ -51,7 +51,7 @@ public interface SmsChannelService { * @param id 编号 * @return 短信渠道 */ - SysSmsChannelDO getSmsChannel(Long id); + SmsChannelDO getSmsChannel(Long id); /** * 获得短信渠道列表 @@ -59,14 +59,14 @@ public interface SmsChannelService { * @param ids 编号 * @return 短信渠道列表 */ - List getSmsChannelList(Collection ids); + List getSmsChannelList(Collection ids); /** * 获得所有短信渠道列表 * * @return 短信渠道列表 */ - List getSmsChannelList(); + List getSmsChannelList(); /** * 获得短信渠道分页 @@ -74,6 +74,6 @@ public interface SmsChannelService { * @param pageReqVO 分页查询 * @return 短信渠道分页 */ - PageResult getSmsChannelPage(SmsChannelPageReqVO pageReqVO); + PageResult getSmsChannelPage(SmsChannelPageReqVO pageReqVO); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelServiceImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelServiceImpl.java index 0a5879880..f1fd44a90 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelServiceImpl.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelServiceImpl.java @@ -5,9 +5,9 @@ import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannel import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelPageReqVO; import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelUpdateReqVO; import cn.iocoder.yudao.module.system.convert.sms.SmsChannelConvert; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; import cn.iocoder.yudao.module.system.dal.mysql.sms.SmsChannelMapper; import cn.iocoder.yudao.module.system.mq.producer.sms.SmsProducer; -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.dataobject.BaseDO; import cn.iocoder.yudao.framework.sms.core.client.SmsClientFactory; @@ -64,7 +64,7 @@ public class SmsChannelServiceImpl implements SmsChannelService { @PostConstruct public void initSmsClients() { // 获取短信渠道,如果有更新 - List smsChannels = this.loadSmsChannelIfUpdate(maxUpdateTime); + List smsChannels = this.loadSmsChannelIfUpdate(maxUpdateTime); if (CollUtil.isEmpty(smsChannels)) { return; } @@ -91,7 +91,7 @@ public class SmsChannelServiceImpl implements SmsChannelService { * @param maxUpdateTime 当前短信渠道的最大更新时间 * @return 短信渠道列表 */ - private List loadSmsChannelIfUpdate(Date maxUpdateTime) { + private List loadSmsChannelIfUpdate(Date maxUpdateTime) { // 第一步,判断是否要更新。 if (maxUpdateTime == null) { // 如果更新时间为空,说明 DB 一定有新数据 log.info("[loadSmsChannelIfUpdate][首次加载全量短信渠道]"); @@ -108,7 +108,7 @@ public class SmsChannelServiceImpl implements SmsChannelService { @Override public Long createSmsChannel(SmsChannelCreateReqVO createReqVO) { // 插入 - SysSmsChannelDO smsChannel = SmsChannelConvert.INSTANCE.convert(createReqVO); + SmsChannelDO smsChannel = SmsChannelConvert.INSTANCE.convert(createReqVO); smsChannelMapper.insert(smsChannel); // 发送刷新消息 smsProducer.sendSmsChannelRefreshMessage(); @@ -121,7 +121,7 @@ public class SmsChannelServiceImpl implements SmsChannelService { // 校验存在 this.validateSmsChannelExists(updateReqVO.getId()); // 更新 - SysSmsChannelDO updateObj = SmsChannelConvert.INSTANCE.convert(updateReqVO); + SmsChannelDO updateObj = SmsChannelConvert.INSTANCE.convert(updateReqVO); smsChannelMapper.updateById(updateObj); // 发送刷新消息 smsProducer.sendSmsChannelRefreshMessage(); @@ -148,22 +148,22 @@ public class SmsChannelServiceImpl implements SmsChannelService { } @Override - public SysSmsChannelDO getSmsChannel(Long id) { + public SmsChannelDO getSmsChannel(Long id) { return smsChannelMapper.selectById(id); } @Override - public List getSmsChannelList(Collection ids) { + public List getSmsChannelList(Collection ids) { return smsChannelMapper.selectBatchIds(ids); } @Override - public List getSmsChannelList() { + public List getSmsChannelList() { return smsChannelMapper.selectList(); } @Override - public PageResult getSmsChannelPage(SmsChannelPageReqVO pageReqVO) { + public PageResult getSmsChannelPage(SmsChannelPageReqVO pageReqVO) { return smsChannelMapper.selectPage(pageReqVO); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsLogService.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsLogService.java index 42c3457b6..2932949ee 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsLogService.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsLogService.java @@ -2,9 +2,9 @@ package cn.iocoder.yudao.module.system.service.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.module.system.dal.dataobject.sms.SysSmsLogDO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsLogDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsTemplateDO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; import java.util.Date; import java.util.List; @@ -31,7 +31,7 @@ public interface SmsLogService { * @return 发送日志编号 */ Long createSmsLog(String mobile, Long userId, Integer userType, Boolean isSend, - SysSmsTemplateDO template, String templateContent, Map templateParams); + SmsTemplateDO template, String templateContent, Map templateParams); /** * 更新日志的发送结果 @@ -64,7 +64,7 @@ public interface SmsLogService { * @param pageReqVO 分页查询 * @return 短信日志分页 */ - PageResult getSmsLogPage(SmsLogPageReqVO pageReqVO); + PageResult getSmsLogPage(SmsLogPageReqVO pageReqVO); /** * 获得短信日志列表, 用于 Excel 导出 @@ -72,6 +72,6 @@ public interface SmsLogService { * @param exportReqVO 查询条件 * @return 短信日志列表 */ - List getSmsLogList(SmsLogExportReqVO exportReqVO); + List getSmsLogList(SmsLogExportReqVO exportReqVO); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsLogServiceImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsLogServiceImpl.java index 75fa8848c..a5abf4003 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsLogServiceImpl.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsLogServiceImpl.java @@ -3,12 +3,12 @@ package cn.iocoder.yudao.module.system.service.sms; import cn.iocoder.yudao.framework.common.pojo.CommonResult; 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.module.system.dal.dataobject.sms.SysSmsTemplateDO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsLogDO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; import cn.iocoder.yudao.module.system.dal.mysql.sms.SmsLogMapper; -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsLogDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.module.system.enums.sms.SysSmsReceiveStatusEnum; -import cn.iocoder.yudao.module.system.enums.sms.SysSmsSendStatusEnum; +import cn.iocoder.yudao.module.system.enums.sms.SmsReceiveStatusEnum; +import cn.iocoder.yudao.module.system.enums.sms.SmsSendStatusEnum; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -32,11 +32,11 @@ public class SmsLogServiceImpl implements SmsLogService { @Override public Long createSmsLog(String mobile, Long userId, Integer userType, Boolean isSend, - SysSmsTemplateDO template, String templateContent, Map templateParams) { - SysSmsLogDO.SysSmsLogDOBuilder logBuilder = SysSmsLogDO.builder(); + SmsTemplateDO template, String templateContent, Map templateParams) { + SmsLogDO.SmsLogDOBuilder logBuilder = SmsLogDO.builder(); // 根据是否要发送,设置状态 - logBuilder.sendStatus(Objects.equals(isSend, true) ? SysSmsSendStatusEnum.INIT.getStatus() - : SysSmsSendStatusEnum.IGNORE.getStatus()); + logBuilder.sendStatus(Objects.equals(isSend, true) ? SmsSendStatusEnum.INIT.getStatus() + : SmsSendStatusEnum.IGNORE.getStatus()); // 设置手机相关字段 logBuilder.mobile(mobile).userId(userId).userType(userType); // 设置模板相关字段 @@ -46,10 +46,10 @@ public class SmsLogServiceImpl implements SmsLogService { // 设置渠道相关字段 logBuilder.channelId(template.getChannelId()).channelCode(template.getChannelCode()); // 设置接收相关字段 - logBuilder.receiveStatus(SysSmsReceiveStatusEnum.INIT.getStatus()); + logBuilder.receiveStatus(SmsReceiveStatusEnum.INIT.getStatus()); // 插入数据库 - SysSmsLogDO logDO = logBuilder.build(); + SmsLogDO logDO = logBuilder.build(); smsLogMapper.insert(logDO); return logDO.getId(); } @@ -58,9 +58,9 @@ public class SmsLogServiceImpl implements SmsLogService { public void updateSmsSendResult(Long id, Integer sendCode, String sendMsg, String apiSendCode, String apiSendMsg, String apiRequestId, String apiSerialNo) { - SysSmsSendStatusEnum sendStatus = CommonResult.isSuccess(sendCode) ? - SysSmsSendStatusEnum.SUCCESS : SysSmsSendStatusEnum.FAILURE; - smsLogMapper.updateById(SysSmsLogDO.builder().id(id).sendStatus(sendStatus.getStatus()) + SmsSendStatusEnum sendStatus = CommonResult.isSuccess(sendCode) ? + SmsSendStatusEnum.SUCCESS : SmsSendStatusEnum.FAILURE; + smsLogMapper.updateById(SmsLogDO.builder().id(id).sendStatus(sendStatus.getStatus()) .sendTime(new Date()).sendCode(sendCode).sendMsg(sendMsg) .apiSendCode(apiSendCode).apiSendMsg(apiSendMsg) .apiRequestId(apiRequestId).apiSerialNo(apiSerialNo).build()); @@ -69,19 +69,19 @@ public class SmsLogServiceImpl implements SmsLogService { @Override public void updateSmsReceiveResult(Long id, Boolean success, Date receiveTime, String apiReceiveCode, String apiReceiveMsg) { - SysSmsReceiveStatusEnum receiveStatus = Objects.equals(success, true) ? - SysSmsReceiveStatusEnum.SUCCESS : SysSmsReceiveStatusEnum.FAILURE; - smsLogMapper.updateById(SysSmsLogDO.builder().id(id).receiveStatus(receiveStatus.getStatus()) + SmsReceiveStatusEnum receiveStatus = Objects.equals(success, true) ? + SmsReceiveStatusEnum.SUCCESS : SmsReceiveStatusEnum.FAILURE; + smsLogMapper.updateById(SmsLogDO.builder().id(id).receiveStatus(receiveStatus.getStatus()) .receiveTime(receiveTime).apiReceiveCode(apiReceiveCode).apiReceiveMsg(apiReceiveMsg).build()); } @Override - public PageResult getSmsLogPage(SmsLogPageReqVO pageReqVO) { + public PageResult getSmsLogPage(SmsLogPageReqVO pageReqVO) { return smsLogMapper.selectPage(pageReqVO); } @Override - public List getSmsLogList(SmsLogExportReqVO exportReqVO) { + public List getSmsLogList(SmsLogExportReqVO exportReqVO) { return smsLogMapper.selectList(exportReqVO); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsSendServiceImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsSendServiceImpl.java index 8819a2710..538e0f925 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsSendServiceImpl.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsSendServiceImpl.java @@ -12,7 +12,7 @@ import cn.iocoder.yudao.framework.sms.core.client.dto.SmsReceiveRespDTO; import cn.iocoder.yudao.framework.sms.core.client.dto.SmsSendRespDTO; import cn.iocoder.yudao.module.member.api.user.MemberUserApi; import cn.iocoder.yudao.module.member.api.user.dto.UserRespDTO; -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsTemplateDO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.mq.message.sms.SmsSendMessage; import cn.iocoder.yudao.module.system.mq.producer.sms.SmsProducer; @@ -83,7 +83,7 @@ public class SmsSendServiceImpl implements SmsSendService { public Long sendSingleSms(String mobile, Long userId, Integer userType, String templateCode, Map templateParams) { // 校验短信模板是否合法 - SysSmsTemplateDO template = this.checkSmsTemplateValid(templateCode); + SmsTemplateDO template = this.checkSmsTemplateValid(templateCode); // 校验手机号码是否存在 mobile = this.checkMobile(mobile); // 构建有序的模板参数。为什么放在这个位置,是提前保证模板参数的正确性,而不是到了插入发送日志 @@ -104,9 +104,9 @@ public class SmsSendServiceImpl implements SmsSendService { @VisibleForTesting - public SysSmsTemplateDO checkSmsTemplateValid(String templateCode) { + public SmsTemplateDO checkSmsTemplateValid(String templateCode) { // 获得短信模板。考虑到效率,从缓存中获取 - SysSmsTemplateDO template = smsTemplateService.getSmsTemplateByCodeFromCache(templateCode); + SmsTemplateDO template = smsTemplateService.getSmsTemplateByCodeFromCache(templateCode); // 短信模板不存在 if (template == null) { throw exception(SMS_SEND_TEMPLATE_NOT_EXISTS); @@ -124,7 +124,7 @@ public class SmsSendServiceImpl implements SmsSendService { * @return 处理后的参数 */ @VisibleForTesting - public List> buildTemplateParams(SysSmsTemplateDO template, Map templateParams) { + public List> buildTemplateParams(SmsTemplateDO template, Map templateParams) { return template.getParams().stream().map(key -> { Object value = templateParams.get(key); if (value == null) { diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateService.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateService.java index bf00dabff..eaa655066 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateService.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateService.java @@ -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.SmsTemplateExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplatePageReqVO; import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateUpdateReqVO; -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsTemplateDO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import javax.validation.Valid; @@ -31,7 +31,7 @@ public interface SmsTemplateService { * @param code 模板编码 * @return 短信模板 */ - SysSmsTemplateDO getSmsTemplateByCodeFromCache(String code); + SmsTemplateDO getSmsTemplateByCodeFromCache(String code); /** * 格式化短信内容 @@ -48,7 +48,7 @@ public interface SmsTemplateService { * @param code 模板编码 * @return 短信模板 */ - SysSmsTemplateDO getSmsTemplateByCode(String code); + SmsTemplateDO getSmsTemplateByCode(String code); /** * 创建短信模板 @@ -78,7 +78,7 @@ public interface SmsTemplateService { * @param id 编号 * @return 短信模板 */ - SysSmsTemplateDO getSmsTemplate(Long id); + SmsTemplateDO getSmsTemplate(Long id); /** * 获得短信模板列表 @@ -86,7 +86,7 @@ public interface SmsTemplateService { * @param ids 编号 * @return 短信模板列表 */ - List getSmsTemplateList(Collection ids); + List getSmsTemplateList(Collection ids); /** * 获得短信模板分页 @@ -94,7 +94,7 @@ public interface SmsTemplateService { * @param pageReqVO 分页查询 * @return 短信模板分页 */ - PageResult getSmsTemplatePage(SmsTemplatePageReqVO pageReqVO); + PageResult getSmsTemplatePage(SmsTemplatePageReqVO pageReqVO); /** * 获得短信模板列表, 用于 Excel 导出 @@ -102,7 +102,7 @@ public interface SmsTemplateService { * @param exportReqVO 查询条件 * @return 短信模板分页 */ - List getSmsTemplateList(SmsTemplateExportReqVO exportReqVO); + List getSmsTemplateList(SmsTemplateExportReqVO exportReqVO); /** * 获得指定短信渠道下的短信模板数量 diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceImpl.java index 5199dd222..ce8e71435 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceImpl.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceImpl.java @@ -9,10 +9,10 @@ import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTempla import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplatePageReqVO; import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateUpdateReqVO; import cn.iocoder.yudao.module.system.convert.sms.SmsTemplateConvert; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; import cn.iocoder.yudao.module.system.dal.mysql.sms.SmsTemplateMapper; import cn.iocoder.yudao.module.system.mq.producer.sms.SmsProducer; -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsChannelDO; -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsTemplateDO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.sms.core.client.SmsClient; @@ -69,11 +69,11 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { /** * 短信模板缓存 - * key:短信模板编码 {@link SysSmsTemplateDO#getCode()} + * key:短信模板编码 {@link SmsTemplateDO#getCode()} * * 这里声明 volatile 修饰的原因是,每次刷新时,直接修改指向 */ - private volatile Map smsTemplateCache; + private volatile Map smsTemplateCache; /** * 缓存短信模板的最大更新时间,用于后续的增量轮询,判断是否有更新 */ @@ -83,13 +83,13 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { @PostConstruct public void initLocalCache() { // 获取短信模板列表,如果有更新 - List smsTemplateList = this.loadSmsTemplateIfUpdate(maxUpdateTime); + List smsTemplateList = this.loadSmsTemplateIfUpdate(maxUpdateTime); if (CollUtil.isEmpty(smsTemplateList)) { return; } // 写入缓存 - ImmutableMap.Builder builder = ImmutableMap.builder(); + ImmutableMap.Builder builder = ImmutableMap.builder(); smsTemplateList.forEach(sysSmsTemplateDO -> builder.put(sysSmsTemplateDO.getCode(), sysSmsTemplateDO)); smsTemplateCache = builder.build(); assert smsTemplateList.size() > 0; // 断言,避免告警 @@ -104,7 +104,7 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { * @param maxUpdateTime 当前短信模板的最大更新时间 * @return 短信模板列表 */ - private List loadSmsTemplateIfUpdate(Date maxUpdateTime) { + private List loadSmsTemplateIfUpdate(Date maxUpdateTime) { // 第一步,判断是否要更新。 if (maxUpdateTime == null) { // 如果更新时间为空,说明 DB 一定有新数据 log.info("[loadSmsTemplateIfUpdate][首次加载全量短信模板]"); @@ -124,7 +124,7 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { } @Override - public SysSmsTemplateDO getSmsTemplateByCodeFromCache(String code) { + public SmsTemplateDO getSmsTemplateByCodeFromCache(String code) { return smsTemplateCache.get(code); } @@ -134,7 +134,7 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { } @Override - public SysSmsTemplateDO getSmsTemplateByCode(String code) { + public SmsTemplateDO getSmsTemplateByCode(String code) { return smsTemplateMapper.selectByCode(code); } @@ -146,14 +146,14 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { @Override public Long createSmsTemplate(SmsTemplateCreateReqVO createReqVO) { // 校验短信渠道 - SysSmsChannelDO channelDO = checkSmsChannel(createReqVO.getChannelId()); + SmsChannelDO channelDO = checkSmsChannel(createReqVO.getChannelId()); // 校验短信编码是否重复 checkSmsTemplateCodeDuplicate(null, createReqVO.getCode()); // 校验短信模板 checkApiTemplate(createReqVO.getChannelId(), createReqVO.getApiTemplateId()); // 插入 - SysSmsTemplateDO template = SmsTemplateConvert.INSTANCE.convert(createReqVO); + SmsTemplateDO template = SmsTemplateConvert.INSTANCE.convert(createReqVO); template.setParams(parseTemplateContentParams(template.getContent())); template.setChannelCode(channelDO.getCode()); smsTemplateMapper.insert(template); @@ -168,14 +168,14 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { // 校验存在 this.validateSmsTemplateExists(updateReqVO.getId()); // 校验短信渠道 - SysSmsChannelDO channelDO = checkSmsChannel(updateReqVO.getChannelId()); + SmsChannelDO channelDO = checkSmsChannel(updateReqVO.getChannelId()); // 校验短信编码是否重复 checkSmsTemplateCodeDuplicate(updateReqVO.getId(), updateReqVO.getCode()); // 校验短信模板 checkApiTemplate(updateReqVO.getChannelId(), updateReqVO.getApiTemplateId()); // 更新 - SysSmsTemplateDO updateObj = SmsTemplateConvert.INSTANCE.convert(updateReqVO); + SmsTemplateDO updateObj = SmsTemplateConvert.INSTANCE.convert(updateReqVO); updateObj.setParams(parseTemplateContentParams(updateObj.getContent())); updateObj.setChannelCode(channelDO.getCode()); smsTemplateMapper.updateById(updateObj); @@ -200,22 +200,22 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { } @Override - public SysSmsTemplateDO getSmsTemplate(Long id) { + public SmsTemplateDO getSmsTemplate(Long id) { return smsTemplateMapper.selectById(id); } @Override - public List getSmsTemplateList(Collection ids) { + public List getSmsTemplateList(Collection ids) { return smsTemplateMapper.selectBatchIds(ids); } @Override - public PageResult getSmsTemplatePage(SmsTemplatePageReqVO pageReqVO) { + public PageResult getSmsTemplatePage(SmsTemplatePageReqVO pageReqVO) { return smsTemplateMapper.selectPage(pageReqVO); } @Override - public List getSmsTemplateList(SmsTemplateExportReqVO exportReqVO) { + public List getSmsTemplateList(SmsTemplateExportReqVO exportReqVO) { return smsTemplateMapper.selectList(exportReqVO); } @@ -225,8 +225,8 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { } @VisibleForTesting - public SysSmsChannelDO checkSmsChannel(Long channelId) { - SysSmsChannelDO channelDO = smsChannelService.getSmsChannel(channelId); + public SmsChannelDO checkSmsChannel(Long channelId) { + SmsChannelDO channelDO = smsChannelService.getSmsChannel(channelId); if (channelDO == null) { throw exception(SMS_CHANNEL_NOT_EXISTS); } @@ -238,7 +238,7 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { @VisibleForTesting public void checkSmsTemplateCodeDuplicate(Long id, String code) { - SysSmsTemplateDO template = smsTemplateMapper.selectByCode(code); + SmsTemplateDO template = smsTemplateMapper.selectByCode(code); if (template == null) { return; } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserService.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserService.java index e5ca68040..b7a7d00d7 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserService.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserService.java @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.system.service.social; import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.exception.ServiceException; -import cn.iocoder.yudao.module.system.dal.dataobject.social.SysSocialUserDO; +import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO; import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; import me.zhyd.oauth.model.AuthUser; @@ -56,7 +56,7 @@ public interface SocialUserService { * @param userType 全局用户类型 * @return 社交用户列表 */ - List getAllSocialUserList(Integer type, String unionId, Integer userType); + List getAllSocialUserList(Integer type, String unionId, Integer userType); /** * 获得指定用户的社交用户列表 @@ -65,7 +65,7 @@ public interface SocialUserService { * @param userType 用户类型 * @return 社交用户列表 */ - List getSocialUserList(Long userId, Integer userType); + List getSocialUserList(Long userId, Integer userType); /** * 绑定社交用户 diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImpl.java index ecb81d96a..533f7fdf9 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImpl.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImpl.java @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.system.service.social; import cn.hutool.core.collection.CollUtil; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.framework.common.util.http.HttpUtils; -import cn.iocoder.yudao.module.system.dal.dataobject.social.SysSocialUserDO; -import cn.iocoder.yudao.module.system.dal.mysql.social.SysSocialUserMapper; +import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO; +import cn.iocoder.yudao.module.system.dal.mysql.social.SocialUserMapper; import cn.iocoder.yudao.module.system.dal.redis.social.SocialAuthUserRedisDAO; import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; import com.google.common.annotations.VisibleForTesting; @@ -45,7 +45,7 @@ public class SocialUserServiceImpl implements SocialUserService { private SocialAuthUserRedisDAO authSocialUserRedisDAO; @Resource - private SysSocialUserMapper socialUserMapper; + private SocialUserMapper socialUserMapper; @Override public String getAuthorizeUrl(Integer type, String redirectUri) { @@ -73,22 +73,22 @@ public class SocialUserServiceImpl implements SocialUserService { } @Override - public List getAllSocialUserList(Integer type, String unionId, Integer userType) { + public List getAllSocialUserList(Integer type, String unionId, Integer userType) { List types = SocialTypeEnum.getRelationTypes(type); return socialUserMapper.selectListByTypeAndUnionId(userType, types, unionId); } @Override - public List getSocialUserList(Long userId, Integer userType) { + public List getSocialUserList(Long userId, Integer userType) { return socialUserMapper.selectListByUserId(userType, userId); } @Override @Transactional(rollbackFor = Exception.class) public void bindSocialUser(Long userId, Integer userType, Integer type, AuthUser authUser) { - // 获得 unionId 对应的 SysSocialUserDO 列表 + // 获得 unionId 对应的 SocialUserDO 列表 String unionId = getAuthUserUnionId(authUser); - List socialUsers = this.getAllSocialUserList(type, unionId, userType); + List socialUsers = this.getAllSocialUserList(type, unionId, userType); // 逻辑一:如果 userId 之前绑定过该 type 的其它账号,需要进行解绑 this.unbindOldSocialUser(userId, userType, type, unionId); @@ -100,12 +100,12 @@ public class SocialUserServiceImpl implements SocialUserService { if (Objects.equals(socialUser.getUserId(), userId)) { return; } - socialUserMapper.updateById(new SysSocialUserDO().setId(socialUser.getId()).setUserId(userId)); + socialUserMapper.updateById(new SocialUserDO().setId(socialUser.getId()).setUserId(userId)); }); // 逻辑三:如果 authUser 不存在于 socialUsers 中,则进行新增;否则,进行更新 - SysSocialUserDO socialUser = CollUtil.findOneByField(socialUsers, "openid", authUser.getUuid()); - SysSocialUserDO saveSocialUser = SysSocialUserDO.builder() // 新增和更新的通用属性 + SocialUserDO socialUser = CollUtil.findOneByField(socialUsers, "openid", authUser.getUuid()); + SocialUserDO saveSocialUser = SocialUserDO.builder() // 新增和更新的通用属性 .token(authUser.getToken().getAccessToken()).rawTokenInfo(toJsonString(authUser.getToken())) .nickname(authUser.getNickname()).avatar(authUser.getAvatar()).rawUserInfo(toJsonString(authUser.getRawUserInfo())) .build(); @@ -121,8 +121,8 @@ public class SocialUserServiceImpl implements SocialUserService { @Override public void unbindSocialUser(Long userId, Integer userType, Integer type, String unionId) { - // 获得 unionId 对应的所有 SysSocialUserDO 社交用户 - List socialUsers = this.getAllSocialUserList(type, unionId, userType); + // 获得 unionId 对应的所有 SocialUserDO 社交用户 + List socialUsers = this.getAllSocialUserList(type, unionId, userType); if (CollUtil.isEmpty(socialUsers)) { return; } @@ -134,20 +134,20 @@ public class SocialUserServiceImpl implements SocialUserService { }); // 解绑 - socialUserMapper.deleteBatchIds(CollectionUtils.convertSet(socialUsers, SysSocialUserDO::getId)); + socialUserMapper.deleteBatchIds(CollectionUtils.convertSet(socialUsers, SocialUserDO::getId)); } @VisibleForTesting public void unbindOldSocialUser(Long userId, Integer userType, Integer type, String newUnionId) { List types = SocialTypeEnum.getRelationTypes(type); - List oldSocialUsers = socialUserMapper.selectListByTypeAndUserId(userType, types, userId); + List oldSocialUsers = socialUserMapper.selectListByTypeAndUserId(userType, types, userId); // 如果新老的 unionId 是一致的,说明无需解绑 if (CollUtil.isEmpty(oldSocialUsers) || Objects.equals(newUnionId, oldSocialUsers.get(0).getUnionId())) { return; } // 解绑 - socialUserMapper.deleteBatchIds(CollectionUtils.convertSet(oldSocialUsers, SysSocialUserDO::getId)); + socialUserMapper.deleteBatchIds(CollectionUtils.convertSet(oldSocialUsers, SocialUserDO::getId)); } /** diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/tenant/SysTenantCoreService.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/tenant/SysTenantCoreService.java deleted file mode 100644 index 030531d85..000000000 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/tenant/SysTenantCoreService.java +++ /dev/null @@ -1,11 +0,0 @@ -package cn.iocoder.yudao.module.system.service.tenant; - -import cn.iocoder.yudao.framework.tenant.core.service.TenantFrameworkService; - -/** - * 租户 Service 接口 - * - * @author 芋道源码 - */ -public interface SysTenantCoreService extends TenantFrameworkService { -} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantService.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantService.java index 8d2005ba6..5742a7a10 100755 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantService.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantService.java @@ -1,11 +1,12 @@ package cn.iocoder.yudao.module.system.service.tenant; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.tenant.core.service.TenantFrameworkService; import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantCreateReqVO; 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.module.system.controller.admin.tenant.vo.TenantUpdateReqVO; -import cn.iocoder.yudao.module.system.dal.dataobject.tenant.SysTenantDO; -import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO; import javax.validation.Valid; import java.util.Collection; @@ -16,7 +17,7 @@ import java.util.List; * * @author 芋道源码 */ -public interface TenantService { +public interface TenantService extends TenantFrameworkService { /** * 创建租户 @@ -46,7 +47,7 @@ public interface TenantService { * @param id 编号 * @return 租户 */ - SysTenantDO getTenant(Long id); + TenantDO getTenant(Long id); /** * 获得租户列表 @@ -54,7 +55,7 @@ public interface TenantService { * @param ids 编号 * @return 租户列表 */ - List getTenantList(Collection ids); + List getTenantList(Collection ids); /** * 获得租户分页 @@ -62,7 +63,7 @@ public interface TenantService { * @param pageReqVO 分页查询 * @return 租户分页 */ - PageResult getTenantPage(TenantPageReqVO pageReqVO); + PageResult getTenantPage(TenantPageReqVO pageReqVO); /** * 获得租户列表, 用于 Excel 导出 @@ -70,7 +71,7 @@ public interface TenantService { * @param exportReqVO 查询条件 * @return 租户列表 */ - List getTenantList(TenantExportReqVO exportReqVO); + List getTenantList(TenantExportReqVO exportReqVO); /** * 获得名字对应的租户 @@ -78,6 +79,6 @@ public interface TenantService { * @param name 组户名 * @return 租户 */ - SysTenantDO getTenantByName(String name); + TenantDO getTenantByName(String name); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java index 4b40236a1..6a584d29d 100755 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java @@ -1,13 +1,14 @@ package cn.iocoder.yudao.module.system.service.tenant; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantCreateReqVO; 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.module.system.controller.admin.tenant.vo.TenantUpdateReqVO; import cn.iocoder.yudao.module.system.convert.tenant.TenantConvert; -import cn.iocoder.yudao.module.system.dal.mysql.tenant.SysTenantMapper; -import cn.iocoder.yudao.module.system.dal.dataobject.tenant.SysTenantDO; -import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO; +import cn.iocoder.yudao.module.system.dal.mysql.tenant.TenantMapper; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; @@ -15,8 +16,8 @@ import javax.annotation.Resource; import java.util.Collection; import java.util.List; -import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.TENANT_NOT_EXISTS; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.TENANT_NOT_EXISTS; /** * 租户 Service 实现类 @@ -28,12 +29,18 @@ import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionU public class TenantServiceImpl implements TenantService { @Resource - private SysTenantMapper tenantMapper; + private TenantMapper tenantMapper; + + @Override + public List getTenantIds() { + List tenants = tenantMapper.selectList(); + return CollectionUtils.convertList(tenants, TenantDO::getId); + } @Override public Long createTenant(TenantCreateReqVO createReqVO) { // 插入 - SysTenantDO tenant = TenantConvert.INSTANCE.convert(createReqVO); + TenantDO tenant = TenantConvert.INSTANCE.convert(createReqVO); tenantMapper.insert(tenant); // 返回 return tenant.getId(); @@ -44,7 +51,7 @@ public class TenantServiceImpl implements TenantService { // 校验存在 this.validateTenantExists(updateReqVO.getId()); // 更新 - SysTenantDO updateObj = TenantConvert.INSTANCE.convert(updateReqVO); + TenantDO updateObj = TenantConvert.INSTANCE.convert(updateReqVO); tenantMapper.updateById(updateObj); } @@ -63,27 +70,27 @@ public class TenantServiceImpl implements TenantService { } @Override - public SysTenantDO getTenant(Long id) { + public TenantDO getTenant(Long id) { return tenantMapper.selectById(id); } @Override - public List getTenantList(Collection ids) { + public List getTenantList(Collection ids) { return tenantMapper.selectBatchIds(ids); } @Override - public PageResult getTenantPage(TenantPageReqVO pageReqVO) { + public PageResult getTenantPage(TenantPageReqVO pageReqVO) { return tenantMapper.selectPage(pageReqVO); } @Override - public List getTenantList(TenantExportReqVO exportReqVO) { + public List getTenantList(TenantExportReqVO exportReqVO) { return tenantMapper.selectList(exportReqVO); } @Override - public SysTenantDO getTenantByName(String name) { + public TenantDO getTenantByName(String name) { return tenantMapper.selectByName(name); } diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/tenant/impl/SysTenantCoreServiceImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/tenant/impl/SysTenantCoreServiceImpl.java deleted file mode 100644 index 67b5acfe4..000000000 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/tenant/impl/SysTenantCoreServiceImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package cn.iocoder.yudao.module.system.service.tenant.impl; - -import cn.iocoder.yudao.module.system.dal.dataobject.tenant.SysTenantDO; -import cn.iocoder.yudao.module.system.dal.mysql.tenant.SysTenantCoreMapper; -import cn.iocoder.yudao.module.system.service.tenant.SysTenantCoreService; -import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 租户 Service 实现类 - * - * @author 芋道源码 - */ -@Service -public class SysTenantCoreServiceImpl implements SysTenantCoreService { - - @Resource - private SysTenantCoreMapper tenantCoreMapper; - - @Override - public List getTenantIds() { - List tenants = tenantCoreMapper.selectList(); - return CollectionUtils.convertList(tenants, SysTenantDO::getId); - } - -} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java index 25c413e12..e150d598d 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java @@ -13,7 +13,7 @@ import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfi 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.module.system.convert.user.UserConvert; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper; import cn.iocoder.yudao.module.system.service.dept.DeptService; @@ -241,7 +241,7 @@ public class AdminUserServiceImpl implements AdminUserService { return Collections.emptySet(); } Set deptIds = CollectionUtils.convertSet(deptService.getDeptsByParentIdFromCache( - deptId, true), SysDeptDO::getId); + deptId, true), DeptDO::getId); deptIds.add(deptId); // 包括自身 return deptIds; } diff --git a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/auth/UserSessionServiceImplTest.java b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/auth/UserSessionServiceImplTest.java index 33b2a3b78..1862c68c8 100644 --- a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/auth/UserSessionServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/auth/UserSessionServiceImplTest.java @@ -5,12 +5,12 @@ import cn.iocoder.yudao.framework.security.config.SecurityProperties; import cn.iocoder.yudao.framework.security.core.LoginUser; import cn.iocoder.yudao.module.system.controller.admin.auth.vo.session.UserSessionPageReqVO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; -import cn.iocoder.yudao.module.system.dal.mysql.auth.SysUserSessionMapper; +import cn.iocoder.yudao.module.system.dal.mysql.auth.UserSessionMapper; import cn.iocoder.yudao.module.system.service.logger.LoginLogService; import cn.iocoder.yudao.module.system.service.user.AdminUserService; -import cn.iocoder.yudao.module.system.dal.dataobject.auth.SysUserSessionDO; +import cn.iocoder.yudao.module.system.dal.dataobject.auth.UserSessionDO; import cn.iocoder.yudao.module.system.dal.redis.auth.LoginUserRedisDAO; -import cn.iocoder.yudao.module.system.enums.common.SysSexEnum; +import cn.iocoder.yudao.module.system.enums.common.SexEnum; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; @@ -49,13 +49,13 @@ public class UserSessionServiceImplTest extends BaseDbAndRedisUnitTest { private UserSessionServiceImpl userSessionService; @Resource - private SysUserSessionMapper userSessionMapper; + private UserSessionMapper userSessionMapper; @MockBean private AdminUserService userService; @MockBean private LoginLogService loginLogService; - @MockBean + @Resource private LoginUserRedisDAO loginUserRedisDAO; @MockBean @@ -65,13 +65,13 @@ public class UserSessionServiceImplTest extends BaseDbAndRedisUnitTest { public void testGetUserSessionPage_success() { // mock 数据 AdminUserDO dbUser = randomPojo(AdminUserDO.class, o -> { - o.setSex(randomEle(SysSexEnum.values()).getSex()); + o.setSex(randomEle(SexEnum.values()).getSex()); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); }); when(userService.getUsersByUsername(eq(dbUser.getUsername()))).thenReturn(singletonList(dbUser)); // 插入可被查询到的数据 String userIp = randomString(); - SysUserSessionDO dbSession = randomPojo(SysUserSessionDO.class, o -> { + UserSessionDO dbSession = randomPojo(UserSessionDO.class, o -> { o.setUserId(dbUser.getId()); o.setUserType(randomEle(UserTypeEnum.values()).getValue()); o.setUserIp(userIp); @@ -93,7 +93,7 @@ public class UserSessionServiceImplTest extends BaseDbAndRedisUnitTest { reqVO.setUserIp(userIp); // 调用 - PageResult pageResult = userSessionService.getUserSessionPage(reqVO); + PageResult pageResult = userSessionService.getUserSessionPage(reqVO); // 断言 assertEquals(1, pageResult.getTotal()); assertEquals(1, pageResult.getList().size()); @@ -107,15 +107,15 @@ public class UserSessionServiceImplTest extends BaseDbAndRedisUnitTest { int expectedTimeoutCount = 120, expectedTotal = 1; // 准备数据 - List prepareData = Stream + List prepareData = Stream .iterate(0, i -> i) .limit(expectedTimeoutCount) - .map(i -> randomPojo(SysUserSessionDO.class, o -> { + .map(i -> randomPojo(UserSessionDO.class, o -> { o.setUserType(randomEle(UserTypeEnum.values()).getValue()); o.setSessionTimeout(DateUtil.offsetSecond(new Date(), -1)); })) .collect(Collectors.toList()); - SysUserSessionDO sessionDO = randomPojo(SysUserSessionDO.class, o -> { + UserSessionDO sessionDO = randomPojo(UserSessionDO.class, o -> { o.setUserType(randomEle(UserTypeEnum.values()).getValue()); o.setSessionTimeout(DateUtil.offsetMinute(new Date(), 30)); }); @@ -126,7 +126,7 @@ public class UserSessionServiceImplTest extends BaseDbAndRedisUnitTest { long actualTimeoutCount = userSessionService.clearSessionTimeout(); // 校验 assertEquals(expectedTimeoutCount, actualTimeoutCount); - List userSessionDOS = userSessionMapper.selectList(); + List userSessionDOS = userSessionMapper.selectList(); assertEquals(expectedTotal, userSessionDOS.size()); assertPojoEquals(sessionDO, userSessionDOS.get(0), "updateTime"); } @@ -145,8 +145,8 @@ public class UserSessionServiceImplTest extends BaseDbAndRedisUnitTest { // 调用 String sessionId = userSessionService.createUserSession(loginUser, userIp, userAgent); - // 校验 SysUserSessionDO 记录 - SysUserSessionDO userSessionDO = userSessionMapper.selectById(sessionId); + // 校验 UserSessionDO 记录 + UserSessionDO userSessionDO = userSessionMapper.selectById(sessionId); assertPojoEquals(loginUser, userSessionDO, "id", "updateTime"); assertEquals(sessionId, userSessionDO.getId()); assertEquals(userIp, userSessionDO.getUserIp()); @@ -171,7 +171,7 @@ public class UserSessionServiceImplTest extends BaseDbAndRedisUnitTest { // mock 数据 loginUser.setUpdateTime(date); loginUserRedisDAO.set(sessionId, loginUser); - SysUserSessionDO userSession = SysUserSessionDO.builder().id(sessionId) + UserSessionDO userSession = UserSessionDO.builder().id(sessionId) .userId(loginUser.getId()).userType(loginUser.getUserType()) .userIp(userIp).userAgent(userAgent).username(userName) .sessionTimeout(addTime(Duration.ofMillis(timeLong))) @@ -183,8 +183,8 @@ public class UserSessionServiceImplTest extends BaseDbAndRedisUnitTest { // 校验 LoginUser 缓存 LoginUser redisLoginUser = loginUserRedisDAO.get(sessionId); assertNotEquals(redisLoginUser.getUpdateTime(), date); - // 校验 SysUserSessionDO 记录 - SysUserSessionDO updateDO = userSessionMapper.selectById(sessionId); + // 校验 UserSessionDO 记录 + UserSessionDO updateDO = userSessionMapper.selectById(sessionId); assertEquals(updateDO.getUsername(), loginUser.getUsername()); assertNotEquals(updateDO.getUpdateTime(), userSession.getUpdateTime()); assertNotEquals(updateDO.getSessionTimeout(), addTime(Duration.ofMillis(timeLong))); @@ -202,7 +202,7 @@ public class UserSessionServiceImplTest extends BaseDbAndRedisUnitTest { when(securityProperties.getSessionTimeout()).thenReturn(Duration.ofDays(1)); // mock 数据 loginUserRedisDAO.set(sessionId, loginUser); - SysUserSessionDO userSession = SysUserSessionDO.builder().id(sessionId) + UserSessionDO userSession = UserSessionDO.builder().id(sessionId) .userId(loginUser.getId()).userType(loginUser.getUserType()) .userIp(userIp).userAgent(userAgent).username(loginUser.getUsername()) .sessionTimeout(addTime(Duration.ofMillis(timeLong))) diff --git a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceTest.java b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceTest.java index bfda1290e..3f78cec2f 100644 --- a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceTest.java +++ b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceTest.java @@ -4,8 +4,8 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptUpdateReqVO; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; -import cn.iocoder.yudao.module.system.dal.mysql.dept.SysDeptMapper; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; +import cn.iocoder.yudao.module.system.dal.mysql.dept.DeptMapper; import cn.iocoder.yudao.module.system.enums.dept.DeptIdEnum; import cn.iocoder.yudao.module.system.mq.producer.dept.DeptProducer; import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; @@ -43,7 +43,7 @@ public class DeptServiceTest extends BaseDbUnitTest { @Resource private DeptServiceImpl deptService; @Resource - private SysDeptMapper deptMapper; + private DeptMapper deptMapper; @MockBean private DeptProducer deptProducer; @@ -51,20 +51,20 @@ public class DeptServiceTest extends BaseDbUnitTest { @SuppressWarnings("unchecked") void testInitLocalCache() { // mock 数据 - SysDeptDO deptDO1 = randomDeptDO(); + DeptDO deptDO1 = randomDeptDO(); deptMapper.insert(deptDO1); - SysDeptDO deptDO2 = randomDeptDO(); + DeptDO deptDO2 = randomDeptDO(); deptMapper.insert(deptDO2); // 调用 deptService.initLocalCache(); // 断言 deptCache 缓存 - Map deptCache = (Map) getFieldValue(deptService, "deptCache"); + Map deptCache = (Map) getFieldValue(deptService, "deptCache"); assertEquals(2, deptCache.size()); assertPojoEquals(deptDO1, deptCache.get(deptDO1.getId())); assertPojoEquals(deptDO2, deptCache.get(deptDO2.getId())); // 断言 parentDeptCache 缓存 - Multimap parentDeptCache = (Multimap) getFieldValue(deptService, "parentDeptCache"); + Multimap parentDeptCache = (Multimap) getFieldValue(deptService, "parentDeptCache"); assertEquals(2, parentDeptCache.size()); assertPojoEquals(deptDO1, parentDeptCache.get(deptDO1.getParentId())); assertPojoEquals(deptDO2, parentDeptCache.get(deptDO2.getParentId())); @@ -76,7 +76,7 @@ public class DeptServiceTest extends BaseDbUnitTest { @Test void testListDepts() { // mock 数据 - SysDeptDO dept = randomPojo(SysDeptDO.class, o -> { // 等会查询到 + DeptDO dept = randomPojo(DeptDO.class, o -> { // 等会查询到 o.setName("开发部"); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); }); @@ -90,7 +90,7 @@ public class DeptServiceTest extends BaseDbUnitTest { reqVO.setName("开"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); // 调用 - List sysDeptDOS = deptService.getSimpleDepts(reqVO); + List sysDeptDOS = deptService.getSimpleDepts(reqVO); // 断言 assertEquals(1, sysDeptDOS.size()); assertPojoEquals(dept, sysDeptDOS.get(0)); @@ -109,7 +109,7 @@ public class DeptServiceTest extends BaseDbUnitTest { // 断言 assertNotNull(deptId); // 校验记录的属性是否正确 - SysDeptDO deptDO = deptMapper.selectById(deptId); + DeptDO deptDO = deptMapper.selectById(deptId); assertPojoEquals(reqVO, deptDO); // 校验调用 verify(deptProducer, times(1)).sendDeptRefreshMessage(); @@ -118,7 +118,7 @@ public class DeptServiceTest extends BaseDbUnitTest { @Test void testUpdateDept_success() { // mock 数据 - SysDeptDO dbDeptDO = randomPojo(SysDeptDO.class, o -> o.setStatus(randomCommonStatus())); + DeptDO dbDeptDO = randomPojo(DeptDO.class, o -> o.setStatus(randomCommonStatus())); deptMapper.insert(dbDeptDO);// @Sql: 先插入出一条存在的数据 // 准备参数 DeptUpdateReqVO reqVO = randomPojo(DeptUpdateReqVO.class, o -> { @@ -130,14 +130,14 @@ public class DeptServiceTest extends BaseDbUnitTest { // 调用 deptService.updateDept(reqVO); // 校验是否更新正确 - SysDeptDO deptDO = deptMapper.selectById(reqVO.getId()); // 获取最新的 + DeptDO deptDO = deptMapper.selectById(reqVO.getId()); // 获取最新的 assertPojoEquals(reqVO, deptDO); } @Test void testDeleteDept_success() { // mock 数据 - SysDeptDO dbDeptDO = randomPojo(SysDeptDO.class, o -> o.setStatus(randomCommonStatus())); + DeptDO dbDeptDO = randomPojo(DeptDO.class, o -> o.setStatus(randomCommonStatus())); deptMapper.insert(dbDeptDO);// @Sql: 先插入出一条存在的数据 // 准备参数 Long id = dbDeptDO.getId(); @@ -150,12 +150,12 @@ public class DeptServiceTest extends BaseDbUnitTest { @Test void testCheckDept_nameDuplicateForUpdate() { // mock 数据 - SysDeptDO deptDO = randomDeptDO(); + DeptDO deptDO = randomDeptDO(); // 设置根节点部门 deptDO.setParentId(DeptIdEnum.ROOT.getId()); deptMapper.insert(deptDO); // mock 数据 稍后模拟重复它的 name - SysDeptDO nameDeptDO = randomDeptDO(); + DeptDO nameDeptDO = randomDeptDO(); // 设置根节点部门 nameDeptDO.setParentId(DeptIdEnum.ROOT.getId()); deptMapper.insert(nameDeptDO); @@ -192,10 +192,10 @@ public class DeptServiceTest extends BaseDbUnitTest { @Test void testCheckDept_exitsChildrenForDelete() { // mock 数据 - SysDeptDO parentDept = randomPojo(SysDeptDO.class, o -> o.setStatus(randomCommonStatus())); + DeptDO parentDept = randomPojo(DeptDO.class, o -> o.setStatus(randomCommonStatus())); deptMapper.insert(parentDept);// @Sql: 先插入出一条存在的数据 // 准备参数 - SysDeptDO childrenDeptDO = randomPojo(SysDeptDO.class, o -> { + DeptDO childrenDeptDO = randomPojo(DeptDO.class, o -> { o.setParentId(parentDept.getId()); o.setStatus(randomCommonStatus()); }); @@ -208,7 +208,7 @@ public class DeptServiceTest extends BaseDbUnitTest { @Test void testCheckDept_parentErrorForUpdate() { // mock 数据 - SysDeptDO dbDeptDO = randomPojo(SysDeptDO.class, o -> o.setStatus(randomCommonStatus())); + DeptDO dbDeptDO = randomPojo(DeptDO.class, o -> o.setStatus(randomCommonStatus())); deptMapper.insert(dbDeptDO); // 准备参数 DeptUpdateReqVO reqVO = randomPojo(DeptUpdateReqVO.class, @@ -225,7 +225,7 @@ public class DeptServiceTest extends BaseDbUnitTest { @Test void testCheckDept_notEnableForCreate() { // mock 数据 - SysDeptDO deptDO = randomPojo(SysDeptDO.class, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus())); + DeptDO deptDO = randomPojo(DeptDO.class, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus())); deptMapper.insert(deptDO); // 准备参数 DeptCreateReqVO reqVO = randomPojo(DeptCreateReqVO.class, @@ -240,9 +240,9 @@ public class DeptServiceTest extends BaseDbUnitTest { @Test void testCheckDept_parentIsChildForUpdate() { // mock 数据 - SysDeptDO parentDept = randomPojo(SysDeptDO.class, o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus())); + DeptDO parentDept = randomPojo(DeptDO.class, o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus())); deptMapper.insert(parentDept); - SysDeptDO childDept = randomPojo(SysDeptDO.class, o -> { + DeptDO childDept = randomPojo(DeptDO.class, o -> { o.setStatus(CommonStatusEnum.ENABLE.getStatus()); o.setParentId(parentDept.getId()); }); @@ -262,11 +262,11 @@ public class DeptServiceTest extends BaseDbUnitTest { } @SafeVarargs - private static SysDeptDO randomDeptDO(Consumer... consumers) { - Consumer consumer = (o) -> { + private static DeptDO randomDeptDO(Consumer... consumers) { + Consumer consumer = (o) -> { o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); // 保证 status 的范围 }; - return randomPojo(SysDeptDO.class, ArrayUtils.append(consumer, consumers)); + return randomPojo(DeptDO.class, ArrayUtils.append(consumer, consumers)); } } diff --git a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/dept/PostServiceTest.java b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/dept/PostServiceTest.java index d6bbab6f7..19850d0c7 100644 --- a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/dept/PostServiceTest.java +++ b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/dept/PostServiceTest.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.system.service.dept; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysPostDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; @@ -9,7 +9,7 @@ import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostCreateRe 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.module.system.controller.admin.dept.vo.post.PostUpdateReqVO; -import cn.iocoder.yudao.module.system.dal.mysql.dept.SysPostMapper; +import cn.iocoder.yudao.module.system.dal.mysql.dept.PostMapper; import cn.iocoder.yudao.module.system.test.BaseDbUnitTest; import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Import; @@ -32,12 +32,12 @@ public class PostServiceTest extends BaseDbUnitTest { @Resource private PostServiceImpl postService; @Resource - private SysPostMapper postMapper; + private PostMapper postMapper; @Test void testPagePosts() { // mock 数据 - SysPostDO postDO = randomPojo(SysPostDO.class, o -> { + PostDO postDO = randomPojo(PostDO.class, o -> { o.setName("码仔"); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); }); @@ -53,7 +53,7 @@ public class PostServiceTest extends BaseDbUnitTest { reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); // 调用 - PageResult pageResult = postService.getPostPage(reqVO); + PageResult pageResult = postService.getPostPage(reqVO); // 断言 assertEquals(1, pageResult.getTotal()); @@ -64,7 +64,7 @@ public class PostServiceTest extends BaseDbUnitTest { @Test void testListPosts() { // mock 数据 - SysPostDO postDO = randomPojo(SysPostDO.class, o -> { + PostDO postDO = randomPojo(PostDO.class, o -> { o.setName("码仔"); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); }); @@ -79,7 +79,7 @@ public class PostServiceTest extends BaseDbUnitTest { reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); // 调用 - List list = postService.getPosts(reqVO); + List list = postService.getPosts(reqVO); // 断言 assertEquals(1, list.size()); assertPojoEquals(postDO, list.get(0)); @@ -88,12 +88,12 @@ public class PostServiceTest extends BaseDbUnitTest { @Test void testGetPost() { // mock 数据 - SysPostDO dbPostDO = randomPostDO(); + PostDO dbPostDO = randomPostDO(); postMapper.insert(dbPostDO); // 准备参数 Long id = dbPostDO.getId(); // 调用 - SysPostDO post = postService.getPost(id); + PostDO post = postService.getPost(id); // 断言 assertNotNull(post); assertPojoEquals(dbPostDO, post); @@ -109,14 +109,14 @@ public class PostServiceTest extends BaseDbUnitTest { // 断言 assertNotNull(postId); // 校验记录的属性是否正确 - SysPostDO post = postMapper.selectById(postId); + PostDO post = postMapper.selectById(postId); assertPojoEquals(reqVO, post); } @Test void testUpdatePost_success() { // mock 数据 - SysPostDO postDO = randomPostDO(); + PostDO postDO = randomPostDO(); postMapper.insert(postDO);// @Sql: 先插入出一条存在的数据 // 准备参数 PostUpdateReqVO reqVO = randomPojo(PostUpdateReqVO.class, @@ -128,14 +128,14 @@ public class PostServiceTest extends BaseDbUnitTest { // 调用 postService.updatePost(reqVO); // 校验是否更新正确 - SysPostDO post = postMapper.selectById(reqVO.getId());// 获取最新的 + PostDO post = postMapper.selectById(reqVO.getId());// 获取最新的 assertPojoEquals(reqVO, post); } @Test void testDeletePost_success() { // mock 数据 - SysPostDO postDO = randomPostDO(); + PostDO postDO = randomPostDO(); postMapper.insert(postDO); // 准备参数 Long id = postDO.getId(); @@ -155,7 +155,7 @@ public class PostServiceTest extends BaseDbUnitTest { @Test void testCheckPost_nameDuplicateForCreate() { // mock 数据 - SysPostDO postDO = randomPostDO(); + PostDO postDO = randomPostDO(); postMapper.insert(postDO);// @Sql: 先插入出一条存在的数据 // 准备参数 PostCreateReqVO reqVO = randomPojo(PostCreateReqVO.class, @@ -167,10 +167,10 @@ public class PostServiceTest extends BaseDbUnitTest { @Test void testCheckPost_codeDuplicateForUpdate() { // mock 数据 - SysPostDO postDO = randomPostDO(); + PostDO postDO = randomPostDO(); postMapper.insert(postDO); // mock 数据 稍后模拟重复它的 code - SysPostDO codePostDO = randomPostDO(); + PostDO codePostDO = randomPostDO(); postMapper.insert(codePostDO); // 准备参数 PostUpdateReqVO reqVO = randomPojo(PostUpdateReqVO.class, @@ -185,10 +185,10 @@ public class PostServiceTest extends BaseDbUnitTest { } @SafeVarargs - private static SysPostDO randomPostDO(Consumer... consumers) { - Consumer consumer = (o) -> { + private static PostDO randomPostDO(Consumer... consumers) { + Consumer consumer = (o) -> { o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); // 保证 status 的范围 }; - return randomPojo(SysPostDO.class, ArrayUtils.append(consumer, consumers)); + return randomPojo(PostDO.class, ArrayUtils.append(consumer, consumers)); } } diff --git a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceTest.java b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceTest.java index e0f3d0e2b..94691d484 100644 --- a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceTest.java +++ b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceTest.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.system.service.dict; -import cn.iocoder.yudao.module.system.dal.dataobject.dict.SysDictDataDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataCreateReqVO; @@ -8,7 +8,7 @@ import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataExpo import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataPageReqVO; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataUpdateReqVO; import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictTypeDO; -import cn.iocoder.yudao.module.system.dal.mysql.dict.SysDictDataMapper; +import cn.iocoder.yudao.module.system.dal.mysql.dict.DictDataMapper; import cn.iocoder.yudao.module.system.mq.producer.dict.DictDataProducer; import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; @@ -39,7 +39,7 @@ public class DictDataServiceTest extends BaseDbUnitTest { private DictDataServiceImpl dictDataService; @Resource - private SysDictDataMapper dictDataMapper; + private DictDataMapper dictDataMapper; @MockBean private DictTypeService dictTypeService; @MockBean @@ -52,22 +52,22 @@ public class DictDataServiceTest extends BaseDbUnitTest { @SuppressWarnings("unchecked") public void testInitLocalCache() { // mock 数据 - SysDictDataDO dictData01 = randomDictDataDO(); + DictDataDO dictData01 = randomDictDataDO(); dictDataMapper.insert(dictData01); - SysDictDataDO dictData02 = randomDictDataDO(); + DictDataDO dictData02 = randomDictDataDO(); dictDataMapper.insert(dictData02); // 调用 dictDataService.initLocalCache(); // 断言 labelDictDataCache 缓存 - ImmutableTable labelDictDataCache = - (ImmutableTable) getFieldValue(dictDataService, "labelDictDataCache"); + ImmutableTable labelDictDataCache = + (ImmutableTable) getFieldValue(dictDataService, "labelDictDataCache"); assertEquals(2, labelDictDataCache.size()); assertPojoEquals(dictData01, labelDictDataCache.get(dictData01.getDictType(), dictData01.getLabel())); assertPojoEquals(dictData02, labelDictDataCache.get(dictData02.getDictType(), dictData02.getLabel())); // 断言 valueDictDataCache 缓存 - ImmutableTable valueDictDataCache = - (ImmutableTable) getFieldValue(dictDataService, "valueDictDataCache"); + ImmutableTable valueDictDataCache = + (ImmutableTable) getFieldValue(dictDataService, "valueDictDataCache"); assertEquals(2, valueDictDataCache.size()); assertPojoEquals(dictData01, valueDictDataCache.get(dictData01.getDictType(), dictData01.getValue())); assertPojoEquals(dictData02, valueDictDataCache.get(dictData02.getDictType(), dictData02.getValue())); @@ -79,7 +79,7 @@ public class DictDataServiceTest extends BaseDbUnitTest { @Test public void testGetDictDataPage() { // mock 数据 - SysDictDataDO dbDictData = randomPojo(SysDictDataDO.class, o -> { // 等会查询到 + DictDataDO dbDictData = randomPojo(DictDataDO.class, o -> { // 等会查询到 o.setLabel("芋艿"); o.setDictType("yunai"); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); @@ -98,7 +98,7 @@ public class DictDataServiceTest extends BaseDbUnitTest { reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); // 调用 - PageResult pageResult = dictDataService.getDictDataPage(reqVO); + PageResult pageResult = dictDataService.getDictDataPage(reqVO); // 断言 assertEquals(1, pageResult.getTotal()); assertEquals(1, pageResult.getList().size()); @@ -108,7 +108,7 @@ public class DictDataServiceTest extends BaseDbUnitTest { @Test public void testGetDictDataList() { // mock 数据 - SysDictDataDO dbDictData = randomPojo(SysDictDataDO.class, o -> { // 等会查询到 + DictDataDO dbDictData = randomPojo(DictDataDO.class, o -> { // 等会查询到 o.setLabel("芋艿"); o.setDictType("yunai"); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); @@ -127,7 +127,7 @@ public class DictDataServiceTest extends BaseDbUnitTest { reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); // 调用 - List list = dictDataService.getDictDatas(reqVO); + List list = dictDataService.getDictDatas(reqVO); // 断言 assertEquals(1, list.size()); assertPojoEquals(dbDictData, list.get(0)); @@ -146,7 +146,7 @@ public class DictDataServiceTest extends BaseDbUnitTest { // 断言 assertNotNull(dictDataId); // 校验记录的属性是否正确 - SysDictDataDO dictData = dictDataMapper.selectById(dictDataId); + DictDataDO dictData = dictDataMapper.selectById(dictDataId); assertPojoEquals(reqVO, dictData); // 校验调用 verify(dictDataProducer, times(1)).sendDictDataRefreshMessage(); @@ -155,7 +155,7 @@ public class DictDataServiceTest extends BaseDbUnitTest { @Test public void testUpdateDictData_success() { // mock 数据 - SysDictDataDO dbDictData = randomDictDataDO(); + DictDataDO dbDictData = randomDictDataDO(); dictDataMapper.insert(dbDictData);// @Sql: 先插入出一条存在的数据 // 准备参数 DictDataUpdateReqVO reqVO = randomPojo(DictDataUpdateReqVO.class, o -> { @@ -168,7 +168,7 @@ public class DictDataServiceTest extends BaseDbUnitTest { // 调用 dictDataService.updateDictData(reqVO); // 校验是否更新正确 - SysDictDataDO dictData = dictDataMapper.selectById(reqVO.getId()); // 获取最新的 + DictDataDO dictData = dictDataMapper.selectById(reqVO.getId()); // 获取最新的 assertPojoEquals(reqVO, dictData); // 校验调用 verify(dictDataProducer, times(1)).sendDictDataRefreshMessage(); @@ -177,7 +177,7 @@ public class DictDataServiceTest extends BaseDbUnitTest { @Test public void testDeleteDictData_success() { // mock 数据 - SysDictDataDO dbDictData = randomDictDataDO(); + DictDataDO dbDictData = randomDictDataDO(); dictDataMapper.insert(dbDictData);// @Sql: 先插入出一条存在的数据 // 准备参数 Long id = dbDictData.getId(); @@ -193,7 +193,7 @@ public class DictDataServiceTest extends BaseDbUnitTest { @Test public void testCheckDictDataExists_success() { // mock 数据 - SysDictDataDO dbDictData = randomDictDataDO(); + DictDataDO dbDictData = randomDictDataDO(); dictDataMapper.insert(dbDictData);// @Sql: 先插入出一条存在的数据 // 调用成功 @@ -273,18 +273,18 @@ public class DictDataServiceTest extends BaseDbUnitTest { // ========== 随机对象 ========== @SafeVarargs - private static SysDictDataDO randomDictDataDO(Consumer... consumers) { - Consumer consumer = (o) -> { + private static DictDataDO randomDictDataDO(Consumer... consumers) { + Consumer consumer = (o) -> { o.setStatus(randomCommonStatus()); // 保证 status 的范围 }; - return randomPojo(SysDictDataDO.class, ArrayUtils.append(consumer, consumers)); + return randomPojo(DictDataDO.class, ArrayUtils.append(consumer, consumers)); } /** * 生成一个有效的字典类型 * * @param type 字典类型 - * @return SysDictTypeDO 对象 + * @return DictTypeDO 对象 */ private static DictTypeDO randomDictTypeDO(String type) { return randomPojo(DictTypeDO.class, o -> { diff --git a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceTest.java b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceTest.java index 3b2d763be..406f1e8a4 100644 --- a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceTest.java +++ b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceTest.java @@ -7,7 +7,7 @@ import cn.iocoder.yudao.module.system.controller.admin.dict.vo.type.DictTypeUpda import cn.iocoder.yudao.module.system.controller.admin.dict.vo.type.DictTypeExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.type.DictTypePageReqVO; import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictTypeDO; -import cn.iocoder.yudao.module.system.dal.mysql.dict.SysDictTypeMapper; +import cn.iocoder.yudao.module.system.dal.mysql.dict.DictTypeMapper; import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import cn.iocoder.yudao.module.system.test.BaseDbUnitTest; @@ -36,7 +36,7 @@ public class DictTypeServiceTest extends BaseDbUnitTest { private DictTypeServiceImpl dictTypeService; @Resource - private SysDictTypeMapper dictTypeMapper; + private DictTypeMapper dictTypeMapper; @MockBean private DictDataService dictDataService; diff --git a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceTest.java b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceTest.java index 045b10f39..e16cbf1f2 100644 --- a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceTest.java +++ b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceTest.java @@ -7,7 +7,7 @@ import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodeCre import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodeExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodePageReqVO; import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodeUpdateReqVO; -import cn.iocoder.yudao.module.system.dal.mysql.errorcode.SysErrorCodeMapper; +import cn.iocoder.yudao.module.system.dal.mysql.errorcode.ErrorCodeMapper; import cn.iocoder.yudao.module.system.enums.errorcode.ErrorCodeTypeEnum; import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; @@ -36,7 +36,7 @@ public class ErrorCodeServiceTest extends BaseDbUnitTest { private ErrorCodeServiceImpl errorCodeService; @Resource - private SysErrorCodeMapper errorCodeMapper; + private ErrorCodeMapper errorCodeMapper; @Test public void testCreateErrorCode_success() { @@ -200,7 +200,7 @@ public class ErrorCodeServiceTest extends BaseDbUnitTest { } /** - * 情况 2.1,错误码存在,但是是 SysErrorCodeTypeEnum.MANUAL_OPERATION 类型 + * 情况 2.1,错误码存在,但是是 ErrorCodeTypeEnum.MANUAL_OPERATION 类型 */ @Test public void testAutoGenerateErrorCodes_021() { diff --git a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/logger/LoginLogServiceImplTest.java b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/logger/LoginLogServiceImplTest.java index b17ad1404..1d59a64d0 100644 --- a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/logger/LoginLogServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/logger/LoginLogServiceImplTest.java @@ -1,7 +1,7 @@ package cn.iocoder.yudao.module.system.service.logger; import cn.hutool.core.util.RandomUtil; -import cn.iocoder.yudao.module.system.dal.dataobject.logger.SysLoginLogDO; +import cn.iocoder.yudao.module.system.dal.dataobject.logger.LoginLogDO; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils; @@ -38,7 +38,7 @@ public class LoginLogServiceImplTest extends BaseDbUnitTest { public void testGetLoginLogPage() { // 构造测试数据 // 登录成功的 - SysLoginLogDO loginLogDO = RandomUtils.randomPojo(SysLoginLogDO.class, logDO -> { + LoginLogDO loginLogDO = RandomUtils.randomPojo(LoginLogDO.class, logDO -> { logDO.setLogType(RandomUtil.randomEle(cn.iocoder.yudao.module.system.enums.logger.LoginLogTypeEnum.values()).getType()); logDO.setTraceId(TracerUtils.getTraceId()); logDO.setUserType(RandomUtil.randomEle(UserTypeEnum.values()).getValue()); @@ -70,7 +70,7 @@ public class LoginLogServiceImplTest extends BaseDbUnitTest { reqVO.setEndTime(buildTime(2021, 3, 7)); // 调用service方法 - PageResult pageResult = loginLogService.getLoginLogPage(reqVO); + PageResult pageResult = loginLogService.getLoginLogPage(reqVO); // 断言,只查到了一条符合条件的 assertEquals(1, pageResult.getTotal()); @@ -83,7 +83,7 @@ public class LoginLogServiceImplTest extends BaseDbUnitTest { // 构造测试数据 // 登录成功的 - SysLoginLogDO loginLogDO = RandomUtils.randomPojo(SysLoginLogDO.class, logDO -> { + LoginLogDO loginLogDO = RandomUtils.randomPojo(LoginLogDO.class, logDO -> { logDO.setLogType(RandomUtil.randomEle(cn.iocoder.yudao.module.system.enums.logger.LoginLogTypeEnum.values()).getType()); logDO.setTraceId(TracerUtils.getTraceId()); logDO.setUserType(RandomUtil.randomEle(UserTypeEnum.values()).getValue()); @@ -116,7 +116,7 @@ public class LoginLogServiceImplTest extends BaseDbUnitTest { // 调用service方法 - List loginLogList = loginLogService.getLoginLogList(reqVO); + List loginLogList = loginLogService.getLoginLogList(reqVO); // 断言 assertEquals(1, loginLogList.size()); @@ -136,7 +136,7 @@ public class LoginLogServiceImplTest extends BaseDbUnitTest { // 调用 loginLogService.createLoginLog(reqDTO); // 断言,忽略基本字段 - SysLoginLogDO sysLoginLogDO = loginLogMapper.selectOne(null); + LoginLogDO sysLoginLogDO = loginLogMapper.selectOne(null); assertPojoEquals(reqDTO, sysLoginLogDO); } diff --git a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImplTest.java b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImplTest.java index feebc7145..b7bbcbed1 100644 --- a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImplTest.java @@ -7,7 +7,7 @@ import cn.iocoder.yudao.module.system.dal.dataobject.logger.OperateLogDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.dal.mysql.logger.OperateLogMapper; import cn.iocoder.yudao.module.system.service.user.AdminUserService; -import cn.iocoder.yudao.module.system.enums.common.SysSexEnum; +import cn.iocoder.yudao.module.system.enums.common.SexEnum; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; import cn.iocoder.yudao.framework.common.pojo.PageResult; @@ -68,7 +68,7 @@ public class OperateLogServiceImplTest extends BaseDbUnitTest { // 先构造用户 AdminUserDO user = RandomUtils.randomPojo(AdminUserDO.class, o -> { o.setNickname("wangkai"); - o.setSex(SysSexEnum.MALE.getSex()); + o.setSex(SexEnum.MALE.getSex()); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); }); when(userService.getUsersByNickname("wangkai")).thenReturn(Collections.singletonList(user)); @@ -119,7 +119,7 @@ public class OperateLogServiceImplTest extends BaseDbUnitTest { // 先构造用户 AdminUserDO user = RandomUtils.randomPojo(AdminUserDO.class, o -> { o.setNickname("wangkai"); - o.setSex(SysSexEnum.MALE.getSex()); + o.setSex(SexEnum.MALE.getSex()); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); }); when(userService.getUsersByNickname("wangkai")).thenReturn(Collections.singletonList(user)); diff --git a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/notice/NoticeServiceImplTest.java b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/notice/NoticeServiceImplTest.java index 0d5babc50..ed0a707b5 100644 --- a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/notice/NoticeServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/notice/NoticeServiceImplTest.java @@ -6,7 +6,7 @@ import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticeCreateReq import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticePageReqVO; import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticeUpdateReqVO; import cn.iocoder.yudao.module.system.dal.dataobject.notice.NoticeDO; -import cn.iocoder.yudao.module.system.dal.mysql.notice.SysNoticeMapper; +import cn.iocoder.yudao.module.system.dal.mysql.notice.NoticeMapper; import cn.iocoder.yudao.module.system.enums.notice.NoticeTypeEnum; import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import cn.iocoder.yudao.module.system.test.BaseDbUnitTest; @@ -32,7 +32,7 @@ class NoticeServiceImplTest extends BaseDbUnitTest { private NoticeServiceImpl sysNoticeService; @Resource - private SysNoticeMapper sysNoticeMapper; + private NoticeMapper sysNoticeMapper; @Test public void testPageNotices_success() { @@ -66,7 +66,7 @@ class NoticeServiceImplTest extends BaseDbUnitTest { @Test public void testGetNotice_success() { // 插入前置数据 - NoticeDO dbNotice = randomSysNoticeDO(); + NoticeDO dbNotice = randomNoticeDO(); sysNoticeMapper.insert(dbNotice); // 查询 @@ -80,7 +80,7 @@ class NoticeServiceImplTest extends BaseDbUnitTest { @Test public void testCreateNotice_success() { // 准备参数 - NoticeCreateReqVO reqVO = randomSysNoticeCreateReqVO(); + NoticeCreateReqVO reqVO = randomNoticeCreateReqVO(); // 校验插入是否成功 Long noticeId = sysNoticeService.createNotice(reqVO); @@ -94,11 +94,11 @@ class NoticeServiceImplTest extends BaseDbUnitTest { @Test public void testUpdateNotice_success() { // 插入前置数据 - NoticeDO dbNoticeDO = randomSysNoticeDO(); + NoticeDO dbNoticeDO = randomNoticeDO(); sysNoticeMapper.insert(dbNoticeDO); // 准备更新参数 - NoticeUpdateReqVO reqVO = randomSysNoticeUpdateReqVO(o -> o.setId(dbNoticeDO.getId())); + NoticeUpdateReqVO reqVO = randomNoticeUpdateReqVO(o -> o.setId(dbNoticeDO.getId())); // 更新 sysNoticeService.updateNotice(reqVO); @@ -111,7 +111,7 @@ class NoticeServiceImplTest extends BaseDbUnitTest { @Test public void testDeleteNotice_success() { // 插入前置数据 - NoticeDO dbNotice = randomSysNoticeDO(); + NoticeDO dbNotice = randomNoticeDO(); sysNoticeMapper.insert(dbNotice); // 删除 @@ -124,7 +124,7 @@ class NoticeServiceImplTest extends BaseDbUnitTest { @Test public void checkNoticeExists_success() { // 插入前置数据 - NoticeDO dbNotice = randomSysNoticeDO(); + NoticeDO dbNotice = randomNoticeDO(); sysNoticeMapper.insert(dbNotice); // 成功调用 @@ -137,7 +137,7 @@ class NoticeServiceImplTest extends BaseDbUnitTest { } @SafeVarargs - private static NoticeDO randomSysNoticeDO(Consumer... consumers) { + private static NoticeDO randomNoticeDO(Consumer... consumers) { NoticeDO notice = randomPojo(NoticeDO.class, consumers); notice.setType(randomEle(NoticeTypeEnum.values()).getType()); notice.setStatus(CommonStatusEnum.ENABLE.getStatus()); @@ -145,14 +145,14 @@ class NoticeServiceImplTest extends BaseDbUnitTest { } @SafeVarargs - private static NoticeUpdateReqVO randomSysNoticeUpdateReqVO(Consumer... consumers) { + private static NoticeUpdateReqVO randomNoticeUpdateReqVO(Consumer... consumers) { NoticeUpdateReqVO reqVO = randomPojo(NoticeUpdateReqVO.class, consumers); reqVO.setType(randomEle(NoticeTypeEnum.values()).getType()); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); return reqVO; } - private static NoticeCreateReqVO randomSysNoticeCreateReqVO() { + private static NoticeCreateReqVO randomNoticeCreateReqVO() { NoticeCreateReqVO reqVO = randomPojo(NoticeCreateReqVO.class); reqVO.setType(randomEle(NoticeTypeEnum.values()).getType()); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); diff --git a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceTest.java b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceTest.java index dc915e307..dc6a99ed9 100644 --- a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceTest.java +++ b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceTest.java @@ -1,7 +1,7 @@ package cn.iocoder.yudao.module.system.service.permission; import cn.hutool.core.collection.CollUtil; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysDeptDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleMenuDO; import cn.iocoder.yudao.module.system.dal.dataobject.permission.UserRoleDO; @@ -194,7 +194,7 @@ public class PermissionServiceTest extends BaseDbUnitTest { RoleDO roleDO = randomPojo(RoleDO.class, o -> o.setDataScope(DataScopeEnum.DEPT_AND_CHILD.getScope())); when(roleService.getRolesFromCache(same(loginUser.getRoleIds()))).thenReturn(singletonList(roleDO)); // mock 方法(部门) - SysDeptDO deptDO = randomPojo(SysDeptDO.class); + DeptDO deptDO = randomPojo(DeptDO.class); when(deptService.getDeptsByParentIdFromCache(eq(loginUser.getDeptId()), eq(true))) .thenReturn(singletonList(deptDO)); diff --git a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelServiceTest.java b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelServiceTest.java index d255cbf74..7e8b8445e 100644 --- a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelServiceTest.java +++ b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelServiceTest.java @@ -6,7 +6,7 @@ import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannel import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelUpdateReqVO; import cn.iocoder.yudao.module.system.dal.mysql.sms.SmsChannelMapper; import cn.iocoder.yudao.module.system.mq.producer.sms.SmsProducer; -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsChannelDO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; @@ -51,9 +51,9 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { @Test public void testInitLocalCache_success() { // mock 数据 - SysSmsChannelDO smsChannelDO01 = randomSmsChannelDO(); + SmsChannelDO smsChannelDO01 = randomSmsChannelDO(); smsChannelMapper.insert(smsChannelDO01); - SysSmsChannelDO smsChannelDO02 = randomSmsChannelDO(); + SmsChannelDO smsChannelDO02 = randomSmsChannelDO(); smsChannelMapper.insert(smsChannelDO02); // 调用 @@ -78,7 +78,7 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { // 断言 assertNotNull(smsChannelId); // 校验记录的属性是否正确 - SysSmsChannelDO smsChannel = smsChannelMapper.selectById(smsChannelId); + SmsChannelDO smsChannel = smsChannelMapper.selectById(smsChannelId); assertPojoEquals(reqVO, smsChannel); // 校验调用 verify(smsProducer, times(1)).sendSmsChannelRefreshMessage(); @@ -87,7 +87,7 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { @Test public void testUpdateSmsChannel_success() { // mock 数据 - SysSmsChannelDO dbSmsChannel = randomSmsChannelDO(); + SmsChannelDO dbSmsChannel = randomSmsChannelDO(); smsChannelMapper.insert(dbSmsChannel);// @Sql: 先插入出一条存在的数据 // 准备参数 SmsChannelUpdateReqVO reqVO = randomPojo(SmsChannelUpdateReqVO.class, o -> { @@ -99,7 +99,7 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { // 调用 smsChannelService.updateSmsChannel(reqVO); // 校验是否更新正确 - SysSmsChannelDO smsChannel = smsChannelMapper.selectById(reqVO.getId()); // 获取最新的 + SmsChannelDO smsChannel = smsChannelMapper.selectById(reqVO.getId()); // 获取最新的 assertPojoEquals(reqVO, smsChannel); // 校验调用 verify(smsProducer, times(1)).sendSmsChannelRefreshMessage(); @@ -117,7 +117,7 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { @Test public void testDeleteSmsChannel_success() { // mock 数据 - SysSmsChannelDO dbSmsChannel = randomSmsChannelDO(); + SmsChannelDO dbSmsChannel = randomSmsChannelDO(); smsChannelMapper.insert(dbSmsChannel);// @Sql: 先插入出一条存在的数据 // 准备参数 Long id = dbSmsChannel.getId(); @@ -142,7 +142,7 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { @Test public void testDeleteSmsChannel_hasChildren() { // mock 数据 - SysSmsChannelDO dbSmsChannel = randomSmsChannelDO(); + SmsChannelDO dbSmsChannel = randomSmsChannelDO(); smsChannelMapper.insert(dbSmsChannel);// @Sql: 先插入出一条存在的数据 // 准备参数 Long id = dbSmsChannel.getId(); @@ -156,7 +156,7 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { @Test public void testGetSmsChannelPage() { // mock 数据 - SysSmsChannelDO dbSmsChannel = randomPojo(SysSmsChannelDO.class, o -> { // 等会查询到 + SmsChannelDO dbSmsChannel = randomPojo(SmsChannelDO.class, o -> { // 等会查询到 o.setSignature("芋道源码"); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); o.setCreateTime(buildTime(2020, 12, 12)); @@ -176,7 +176,7 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { reqVO.setEndCreateTime(buildTime(2020, 12, 24)); // 调用 - PageResult pageResult = smsChannelService.getSmsChannelPage(reqVO); + PageResult pageResult = smsChannelService.getSmsChannelPage(reqVO); // 断言 assertEquals(1, pageResult.getTotal()); assertEquals(1, pageResult.getList().size()); @@ -186,11 +186,11 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { // ========== 随机对象 ========== @SafeVarargs - private static SysSmsChannelDO randomSmsChannelDO(Consumer... consumers) { - Consumer consumer = (o) -> { + private static SmsChannelDO randomSmsChannelDO(Consumer... consumers) { + Consumer consumer = (o) -> { o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); // 保证 status 的范围 }; - return randomPojo(SysSmsChannelDO.class, ArrayUtils.append(consumer, consumers)); + return randomPojo(SmsChannelDO.class, ArrayUtils.append(consumer, consumers)); } } diff --git a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsLogServiceTest.java b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsLogServiceTest.java index 7b0b0918f..de6a6bd0c 100644 --- a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsLogServiceTest.java +++ b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsLogServiceTest.java @@ -4,12 +4,12 @@ import cn.hutool.core.map.MapUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; 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.module.system.dal.dataobject.sms.SysSmsTemplateDO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsLogDO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; import cn.iocoder.yudao.module.system.dal.mysql.sms.SmsLogMapper; -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsLogDO; -import cn.iocoder.yudao.module.system.enums.sms.SysSmsReceiveStatusEnum; -import cn.iocoder.yudao.module.system.enums.sms.SysSmsSendStatusEnum; -import cn.iocoder.yudao.module.system.enums.sms.SysSmsTemplateTypeEnum; +import cn.iocoder.yudao.module.system.enums.sms.SmsReceiveStatusEnum; +import cn.iocoder.yudao.module.system.enums.sms.SmsSendStatusEnum; +import cn.iocoder.yudao.module.system.enums.sms.SmsTemplateTypeEnum; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; @@ -44,13 +44,13 @@ public class SmsLogServiceTest extends BaseDbUnitTest { @Test public void testGetSmsLogPage() { // mock 数据 - SysSmsLogDO dbSmsLog = randomSmsLogDO(o -> { // 等会查询到 + SmsLogDO dbSmsLog = randomSmsLogDO(o -> { // 等会查询到 o.setChannelId(1L); o.setTemplateId(10L); o.setMobile("15601691300"); - o.setSendStatus(SysSmsSendStatusEnum.INIT.getStatus()); + o.setSendStatus(SmsSendStatusEnum.INIT.getStatus()); o.setSendTime(buildTime(2020, 11, 11)); - o.setReceiveStatus(SysSmsReceiveStatusEnum.INIT.getStatus()); + o.setReceiveStatus(SmsReceiveStatusEnum.INIT.getStatus()); o.setReceiveTime(buildTime(2021, 11, 11)); }); smsLogMapper.insert(dbSmsLog); @@ -61,11 +61,11 @@ public class SmsLogServiceTest extends BaseDbUnitTest { // 测试 mobile 不匹配 smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setMobile("18818260999"))); // 测试 sendStatus 不匹配 - smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setSendStatus(SysSmsSendStatusEnum.IGNORE.getStatus()))); + smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setSendStatus(SmsSendStatusEnum.IGNORE.getStatus()))); // 测试 sendTime 不匹配 smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setSendTime(buildTime(2020, 12, 12)))); // 测试 receiveStatus 不匹配 - smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setReceiveStatus(SysSmsReceiveStatusEnum.SUCCESS.getStatus()))); + smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setReceiveStatus(SmsReceiveStatusEnum.SUCCESS.getStatus()))); // 测试 receiveTime 不匹配 smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setReceiveTime(buildTime(2021, 12, 12)))); // 准备参数 @@ -73,15 +73,15 @@ public class SmsLogServiceTest extends BaseDbUnitTest { reqVO.setChannelId(1L); reqVO.setTemplateId(10L); reqVO.setMobile("156"); - reqVO.setSendStatus(SysSmsSendStatusEnum.INIT.getStatus()); + reqVO.setSendStatus(SmsSendStatusEnum.INIT.getStatus()); reqVO.setBeginSendTime(buildTime(2020, 11, 1)); reqVO.setEndSendTime(buildTime(2020, 11, 30)); - reqVO.setReceiveStatus(SysSmsReceiveStatusEnum.INIT.getStatus()); + reqVO.setReceiveStatus(SmsReceiveStatusEnum.INIT.getStatus()); reqVO.setBeginReceiveTime(buildTime(2021, 11, 1)); reqVO.setEndReceiveTime(buildTime(2021, 11, 30)); // 调用 - PageResult pageResult = smsLogService.getSmsLogPage(reqVO); + PageResult pageResult = smsLogService.getSmsLogPage(reqVO); // 断言 assertEquals(1, pageResult.getTotal()); assertEquals(1, pageResult.getList().size()); @@ -91,13 +91,13 @@ public class SmsLogServiceTest extends BaseDbUnitTest { @Test public void testGetSmsLogList() { // mock 数据 - SysSmsLogDO dbSmsLog = randomSmsLogDO(o -> { // 等会查询到 + SmsLogDO dbSmsLog = randomSmsLogDO(o -> { // 等会查询到 o.setChannelId(1L); o.setTemplateId(10L); o.setMobile("15601691300"); - o.setSendStatus(SysSmsSendStatusEnum.INIT.getStatus()); + o.setSendStatus(SmsSendStatusEnum.INIT.getStatus()); o.setSendTime(buildTime(2020, 11, 11)); - o.setReceiveStatus(SysSmsReceiveStatusEnum.INIT.getStatus()); + o.setReceiveStatus(SmsReceiveStatusEnum.INIT.getStatus()); o.setReceiveTime(buildTime(2021, 11, 11)); }); smsLogMapper.insert(dbSmsLog); @@ -108,11 +108,11 @@ public class SmsLogServiceTest extends BaseDbUnitTest { // 测试 mobile 不匹配 smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setMobile("18818260999"))); // 测试 sendStatus 不匹配 - smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setSendStatus(SysSmsSendStatusEnum.IGNORE.getStatus()))); + smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setSendStatus(SmsSendStatusEnum.IGNORE.getStatus()))); // 测试 sendTime 不匹配 smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setSendTime(buildTime(2020, 12, 12)))); // 测试 receiveStatus 不匹配 - smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setReceiveStatus(SysSmsReceiveStatusEnum.SUCCESS.getStatus()))); + smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setReceiveStatus(SmsReceiveStatusEnum.SUCCESS.getStatus()))); // 测试 receiveTime 不匹配 smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setReceiveTime(buildTime(2021, 12, 12)))); // 准备参数 @@ -120,15 +120,15 @@ public class SmsLogServiceTest extends BaseDbUnitTest { reqVO.setChannelId(1L); reqVO.setTemplateId(10L); reqVO.setMobile("156"); - reqVO.setSendStatus(SysSmsSendStatusEnum.INIT.getStatus()); + reqVO.setSendStatus(SmsSendStatusEnum.INIT.getStatus()); reqVO.setBeginSendTime(buildTime(2020, 11, 1)); reqVO.setEndSendTime(buildTime(2020, 11, 30)); - reqVO.setReceiveStatus(SysSmsReceiveStatusEnum.INIT.getStatus()); + reqVO.setReceiveStatus(SmsReceiveStatusEnum.INIT.getStatus()); reqVO.setBeginReceiveTime(buildTime(2021, 11, 1)); reqVO.setEndReceiveTime(buildTime(2021, 11, 30)); // 调用 - List list = smsLogService.getSmsLogList(reqVO); + List list = smsLogService.getSmsLogList(reqVO); // 断言 assertEquals(1, list.size()); assertPojoEquals(dbSmsLog, list.get(0)); @@ -141,8 +141,8 @@ public class SmsLogServiceTest extends BaseDbUnitTest { Long userId = randomLongId(); Integer userType = randomEle(UserTypeEnum.values()).getValue(); Boolean isSend = randomBoolean(); - SysSmsTemplateDO templateDO = randomPojo(SysSmsTemplateDO.class, - o -> o.setType(randomEle(SysSmsTemplateTypeEnum.values()).getType())); + SmsTemplateDO templateDO = randomPojo(SmsTemplateDO.class, + o -> o.setType(randomEle(SmsTemplateTypeEnum.values()).getType())); String templateContent = randomString(); Map templateParams = randomTemplateParams(); // mock 方法 @@ -151,8 +151,8 @@ public class SmsLogServiceTest extends BaseDbUnitTest { Long logId = smsLogService.createSmsLog(mobile, userId, userType, isSend, templateDO, templateContent, templateParams); // 断言 - SysSmsLogDO logDO = smsLogMapper.selectById(logId); - assertEquals(isSend ? SysSmsSendStatusEnum.INIT.getStatus() : SysSmsSendStatusEnum.IGNORE.getStatus(), + SmsLogDO logDO = smsLogMapper.selectById(logId); + assertEquals(isSend ? SmsSendStatusEnum.INIT.getStatus() : SmsSendStatusEnum.IGNORE.getStatus(), logDO.getSendStatus()); assertEquals(mobile, logDO.getMobile()); assertEquals(userType, logDO.getUserType()); @@ -164,14 +164,14 @@ public class SmsLogServiceTest extends BaseDbUnitTest { assertEquals(templateDO.getChannelCode(), logDO.getChannelCode()); assertEquals(templateContent, logDO.getTemplateContent()); assertEquals(templateParams, logDO.getTemplateParams()); - assertEquals(SysSmsReceiveStatusEnum.INIT.getStatus(), logDO.getReceiveStatus()); + assertEquals(SmsReceiveStatusEnum.INIT.getStatus(), logDO.getReceiveStatus()); } @Test public void testUpdateSmsSendResult() { // mock 数据 - SysSmsLogDO dbSmsLog = randomSmsLogDO( - o -> o.setSendStatus(SysSmsSendStatusEnum.IGNORE.getStatus())); + SmsLogDO dbSmsLog = randomSmsLogDO( + o -> o.setSendStatus(SmsSendStatusEnum.IGNORE.getStatus())); smsLogMapper.insert(dbSmsLog); // 准备参数 Long id = dbSmsLog.getId(); @@ -187,8 +187,8 @@ public class SmsLogServiceTest extends BaseDbUnitTest { apiSendCode, apiSendMsg, apiRequestId, apiSerialNo); // 断言 dbSmsLog = smsLogMapper.selectById(id); - assertEquals(CommonResult.isSuccess(sendCode) ? SysSmsSendStatusEnum.SUCCESS.getStatus() - : SysSmsSendStatusEnum.FAILURE.getStatus(), dbSmsLog.getSendStatus()); + assertEquals(CommonResult.isSuccess(sendCode) ? SmsSendStatusEnum.SUCCESS.getStatus() + : SmsSendStatusEnum.FAILURE.getStatus(), dbSmsLog.getSendStatus()); assertNotNull(dbSmsLog.getSendTime()); assertEquals(sendMsg, dbSmsLog.getSendMsg()); assertEquals(apiSendCode, dbSmsLog.getApiSendCode()); @@ -200,8 +200,8 @@ public class SmsLogServiceTest extends BaseDbUnitTest { @Test public void testUpdateSmsReceiveResult() { // mock 数据 - SysSmsLogDO dbSmsLog = randomSmsLogDO( - o -> o.setReceiveStatus(SysSmsReceiveStatusEnum.INIT.getStatus())); + SmsLogDO dbSmsLog = randomSmsLogDO( + o -> o.setReceiveStatus(SmsReceiveStatusEnum.INIT.getStatus())); smsLogMapper.insert(dbSmsLog); // 准备参数 Long id = dbSmsLog.getId(); @@ -214,8 +214,8 @@ public class SmsLogServiceTest extends BaseDbUnitTest { smsLogService.updateSmsReceiveResult(id, success, receiveTime, apiReceiveCode, apiReceiveMsg); // 断言 dbSmsLog = smsLogMapper.selectById(id); - assertEquals(success ? SysSmsReceiveStatusEnum.SUCCESS.getStatus() - : SysSmsReceiveStatusEnum.FAILURE.getStatus(), dbSmsLog.getReceiveStatus()); + assertEquals(success ? SmsReceiveStatusEnum.SUCCESS.getStatus() + : SmsReceiveStatusEnum.FAILURE.getStatus(), dbSmsLog.getReceiveStatus()); assertEquals(receiveTime, dbSmsLog.getReceiveTime()); assertEquals(apiReceiveCode, dbSmsLog.getApiReceiveCode()); assertEquals(apiReceiveMsg, dbSmsLog.getApiReceiveMsg()); @@ -224,15 +224,15 @@ public class SmsLogServiceTest extends BaseDbUnitTest { // ========== 随机对象 ========== @SafeVarargs - private static SysSmsLogDO randomSmsLogDO(Consumer... consumers) { - Consumer consumer = (o) -> { + private static SmsLogDO randomSmsLogDO(Consumer... consumers) { + Consumer consumer = (o) -> { o.setTemplateParams(randomTemplateParams()); - o.setTemplateType(randomEle(SysSmsTemplateTypeEnum.values()).getType()); // 保证 templateType 的范围 + o.setTemplateType(randomEle(SmsTemplateTypeEnum.values()).getType()); // 保证 templateType 的范围 o.setUserType(randomEle(UserTypeEnum.values()).getValue()); // 保证 userType 的范围 - o.setSendStatus(randomEle(SysSmsSendStatusEnum.values()).getStatus()); // 保证 sendStatus 的范围 - o.setReceiveStatus(randomEle(SysSmsReceiveStatusEnum.values()).getStatus()); // 保证 receiveStatus 的范围 + o.setSendStatus(randomEle(SmsSendStatusEnum.values()).getStatus()); // 保证 sendStatus 的范围 + o.setReceiveStatus(randomEle(SmsReceiveStatusEnum.values()).getStatus()); // 保证 receiveStatus 的范围 }; - return randomPojo(SysSmsLogDO.class, ArrayUtils.append(consumer, consumers)); + return randomPojo(SmsLogDO.class, ArrayUtils.append(consumer, consumers)); } diff --git a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/SysSmsSendServiceTest.java b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsSendServiceTest.java similarity index 95% rename from yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/SysSmsSendServiceTest.java rename to yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsSendServiceTest.java index 0bd82475f..7f9309499 100644 --- a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/SysSmsSendServiceTest.java +++ b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsSendServiceTest.java @@ -1,7 +1,7 @@ package cn.iocoder.yudao.module.system.service.sms; import cn.hutool.core.map.MapUtil; -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsTemplateDO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; import cn.iocoder.yudao.module.system.mq.message.sms.SmsSendMessage; import cn.iocoder.yudao.module.system.mq.producer.sms.SmsProducer; import cn.iocoder.yudao.framework.common.core.KeyValue; @@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; -public class SysSmsSendServiceTest extends BaseMockitoUnitTest { +public class SmsSendServiceTest extends BaseMockitoUnitTest { @InjectMocks private SmsSendServiceImpl smsService; @@ -57,7 +57,7 @@ public class SysSmsSendServiceTest extends BaseMockitoUnitTest { Map templateParams = MapUtil.builder().put("code", "1234") .put("op", "login").build(); // mock SmsTemplateService 的方法 - SysSmsTemplateDO template = randomPojo(SysSmsTemplateDO.class, o -> { + SmsTemplateDO template = randomPojo(SmsTemplateDO.class, o -> { o.setStatus(CommonStatusEnum.ENABLE.getStatus()); o.setContent("验证码为{code}, 操作为{op}"); o.setParams(Lists.newArrayList("code", "op")); @@ -94,7 +94,7 @@ public class SysSmsSendServiceTest extends BaseMockitoUnitTest { Map templateParams = MapUtil.builder().put("code", "1234") .put("op", "login").build(); // mock SmsTemplateService 的方法 - SysSmsTemplateDO template = randomPojo(SysSmsTemplateDO.class, o -> { + SmsTemplateDO template = randomPojo(SmsTemplateDO.class, o -> { o.setStatus(CommonStatusEnum.DISABLE.getStatus()); o.setContent("验证码为{code}, 操作为{op}"); o.setParams(Lists.newArrayList("code", "op")); @@ -131,7 +131,7 @@ public class SysSmsSendServiceTest extends BaseMockitoUnitTest { @Test public void testBuildTemplateParams_paramMiss() { // 准备参数 - SysSmsTemplateDO template = randomPojo(SysSmsTemplateDO.class, + SmsTemplateDO template = randomPojo(SmsTemplateDO.class, o -> o.setParams(Lists.newArrayList("code"))); Map templateParams = new HashMap<>(); // mock 方法 diff --git a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceTest.java b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceTest.java index 3025b8d64..034310fa2 100644 --- a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceTest.java +++ b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceTest.java @@ -4,11 +4,11 @@ import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTempla 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.module.system.controller.admin.sms.vo.template.SmsTemplateUpdateReqVO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; import cn.iocoder.yudao.module.system.dal.mysql.sms.SmsTemplateMapper; import cn.iocoder.yudao.module.system.mq.producer.sms.SmsProducer; -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsChannelDO; -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SysSmsTemplateDO; -import cn.iocoder.yudao.module.system.enums.sms.SysSmsTemplateTypeEnum; +import cn.iocoder.yudao.module.system.enums.sms.SmsTemplateTypeEnum; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; import cn.iocoder.yudao.framework.common.pojo.PageResult; @@ -64,15 +64,15 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { @SuppressWarnings("unchecked") void testInitLocalCache() { // mock 数据 - SysSmsTemplateDO smsTemplate01 = randomSmsTemplateDO(); + SmsTemplateDO smsTemplate01 = randomSmsTemplateDO(); smsTemplateMapper.insert(smsTemplate01); - SysSmsTemplateDO smsTemplate02 = randomSmsTemplateDO(); + SmsTemplateDO smsTemplate02 = randomSmsTemplateDO(); smsTemplateMapper.insert(smsTemplate02); // 调用 smsTemplateService.initLocalCache(); // 断言 deptCache 缓存 - Map smsTemplateCache = (Map) getFieldValue(smsTemplateService, "smsTemplateCache"); + Map smsTemplateCache = (Map) getFieldValue(smsTemplateService, "smsTemplateCache"); assertEquals(2, smsTemplateCache.size()); assertPojoEquals(smsTemplate01, smsTemplateCache.get(smsTemplate01.getCode())); assertPojoEquals(smsTemplate02, smsTemplateCache.get(smsTemplate02.getCode())); @@ -100,10 +100,10 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { SmsTemplateCreateReqVO reqVO = randomPojo(SmsTemplateCreateReqVO.class, o -> { o.setContent("正在进行登录操作{operation},您的验证码是{code}"); o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); // 保证 status 的范围 - o.setType(randomEle(SysSmsTemplateTypeEnum.values()).getType()); // 保证 type 的 范围 + o.setType(randomEle(SmsTemplateTypeEnum.values()).getType()); // 保证 type 的 范围 }); // mock Channel 的方法 - SysSmsChannelDO channelDO = randomPojo(SysSmsChannelDO.class, o -> { + SmsChannelDO channelDO = randomPojo(SmsChannelDO.class, o -> { o.setId(reqVO.getChannelId()); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); // 保证 status 开启,创建必须处于这个状态 }); @@ -118,7 +118,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { // 断言 assertNotNull(smsTemplateId); // 校验记录的属性是否正确 - SysSmsTemplateDO smsTemplate = smsTemplateMapper.selectById(smsTemplateId); + SmsTemplateDO smsTemplate = smsTemplateMapper.selectById(smsTemplateId); assertPojoEquals(reqVO, smsTemplate); assertEquals(Lists.newArrayList("operation", "code"), smsTemplate.getParams()); assertEquals(channelDO.getCode(), smsTemplate.getChannelCode()); @@ -130,17 +130,17 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { @SuppressWarnings("unchecked") public void testUpdateSmsTemplate_success() { // mock 数据 - SysSmsTemplateDO dbSmsTemplate = randomSmsTemplateDO(); + SmsTemplateDO dbSmsTemplate = randomSmsTemplateDO(); smsTemplateMapper.insert(dbSmsTemplate);// @Sql: 先插入出一条存在的数据 // 准备参数 SmsTemplateUpdateReqVO reqVO = randomPojo(SmsTemplateUpdateReqVO.class, o -> { o.setId(dbSmsTemplate.getId()); // 设置更新的 ID o.setContent("正在进行登录操作{operation},您的验证码是{code}"); o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); // 保证 status 的范围 - o.setType(randomEle(SysSmsTemplateTypeEnum.values()).getType()); // 保证 type 的 范围 + o.setType(randomEle(SmsTemplateTypeEnum.values()).getType()); // 保证 type 的 范围 }); // mock 方法 - SysSmsChannelDO channelDO = randomPojo(SysSmsChannelDO.class, o -> { + SmsChannelDO channelDO = randomPojo(SmsChannelDO.class, o -> { o.setId(reqVO.getChannelId()); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); // 保证 status 开启,创建必须处于这个状态 }); @@ -153,7 +153,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { // 调用 smsTemplateService.updateSmsTemplate(reqVO); // 校验是否更新正确 - SysSmsTemplateDO smsTemplate = smsTemplateMapper.selectById(reqVO.getId()); // 获取最新的 + SmsTemplateDO smsTemplate = smsTemplateMapper.selectById(reqVO.getId()); // 获取最新的 assertPojoEquals(reqVO, smsTemplate); assertEquals(Lists.newArrayList("operation", "code"), smsTemplate.getParams()); assertEquals(channelDO.getCode(), smsTemplate.getChannelCode()); @@ -173,7 +173,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { @Test public void testDeleteSmsTemplate_success() { // mock 数据 - SysSmsTemplateDO dbSmsTemplate = randomSmsTemplateDO(); + SmsTemplateDO dbSmsTemplate = randomSmsTemplateDO(); smsTemplateMapper.insert(dbSmsTemplate);// @Sql: 先插入出一条存在的数据 // 准备参数 Long id = dbSmsTemplate.getId(); @@ -198,8 +198,8 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { @Test public void testGetSmsTemplatePage() { // mock 数据 - SysSmsTemplateDO dbSmsTemplate = randomPojo(SysSmsTemplateDO.class, o -> { // 等会查询到 - o.setType(SysSmsTemplateTypeEnum.PROMOTION.getType()); + SmsTemplateDO dbSmsTemplate = randomPojo(SmsTemplateDO.class, o -> { // 等会查询到 + o.setType(SmsTemplateTypeEnum.PROMOTION.getType()); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); o.setCode("yudaoyuanma"); o.setContent("芋道源码"); @@ -209,7 +209,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { }); smsTemplateMapper.insert(dbSmsTemplate); // 测试 type 不匹配 - smsTemplateMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsTemplate, o -> o.setType(SysSmsTemplateTypeEnum.VERIFICATION_CODE.getType()))); + smsTemplateMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsTemplate, o -> o.setType(SmsTemplateTypeEnum.VERIFICATION_CODE.getType()))); // 测试 status 不匹配 smsTemplateMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsTemplate, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); // 测试 code 不匹配 @@ -224,7 +224,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { smsTemplateMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsTemplate, o -> o.setCreateTime(buildTime(2021, 12, 12)))); // 准备参数 SmsTemplatePageReqVO reqVO = new SmsTemplatePageReqVO(); - reqVO.setType(SysSmsTemplateTypeEnum.PROMOTION.getType()); + reqVO.setType(SmsTemplateTypeEnum.PROMOTION.getType()); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); reqVO.setCode("yudao"); reqVO.setContent("芋道"); @@ -234,7 +234,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { reqVO.setEndCreateTime(buildTime(2021, 12, 1)); // 调用 - PageResult pageResult = smsTemplateService.getSmsTemplatePage(reqVO); + PageResult pageResult = smsTemplateService.getSmsTemplatePage(reqVO); // 断言 assertEquals(1, pageResult.getTotal()); assertEquals(1, pageResult.getList().size()); @@ -244,8 +244,8 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { @Test public void testGetSmsTemplateList() { // mock 数据 - SysSmsTemplateDO dbSmsTemplate = randomPojo(SysSmsTemplateDO.class, o -> { // 等会查询到 - o.setType(SysSmsTemplateTypeEnum.PROMOTION.getType()); + SmsTemplateDO dbSmsTemplate = randomPojo(SmsTemplateDO.class, o -> { // 等会查询到 + o.setType(SmsTemplateTypeEnum.PROMOTION.getType()); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); o.setCode("yudaoyuanma"); o.setContent("芋道源码"); @@ -255,7 +255,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { }); smsTemplateMapper.insert(dbSmsTemplate); // 测试 type 不匹配 - smsTemplateMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsTemplate, o -> o.setType(SysSmsTemplateTypeEnum.VERIFICATION_CODE.getType()))); + smsTemplateMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsTemplate, o -> o.setType(SmsTemplateTypeEnum.VERIFICATION_CODE.getType()))); // 测试 status 不匹配 smsTemplateMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsTemplate, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); // 测试 code 不匹配 @@ -270,7 +270,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { smsTemplateMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsTemplate, o -> o.setCreateTime(buildTime(2021, 12, 12)))); // 准备参数 SmsTemplateExportReqVO reqVO = new SmsTemplateExportReqVO(); - reqVO.setType(SysSmsTemplateTypeEnum.PROMOTION.getType()); + reqVO.setType(SmsTemplateTypeEnum.PROMOTION.getType()); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); reqVO.setCode("yudao"); reqVO.setContent("芋道"); @@ -280,7 +280,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { reqVO.setEndCreateTime(buildTime(2021, 12, 1)); // 调用 - List list = smsTemplateService.getSmsTemplateList(reqVO); + List list = smsTemplateService.getSmsTemplateList(reqVO); // 断言 assertEquals(1, list.size()); assertPojoEquals(dbSmsTemplate, list.get(0)); @@ -291,14 +291,14 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { // 准备参数 Long channelId = randomLongId(); // mock 方法 - SysSmsChannelDO channelDO = randomPojo(SysSmsChannelDO.class, o -> { + SmsChannelDO channelDO = randomPojo(SmsChannelDO.class, o -> { o.setId(channelId); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); // 保证 status 开启,创建必须处于这个状态 }); when(smsChannelService.getSmsChannel(eq(channelId))).thenReturn(channelDO); // 调用 - SysSmsChannelDO returnChannelDO = smsTemplateService.checkSmsChannel(channelId); + SmsChannelDO returnChannelDO = smsTemplateService.checkSmsChannel(channelId); // 断言 assertPojoEquals(returnChannelDO, channelDO); } @@ -318,7 +318,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { // 准备参数 Long channelId = randomLongId(); // mock 方法 - SysSmsChannelDO channelDO = randomPojo(SysSmsChannelDO.class, o -> { + SmsChannelDO channelDO = randomPojo(SmsChannelDO.class, o -> { o.setId(channelId); o.setStatus(CommonStatusEnum.DISABLE.getStatus()); // 保证 status 禁用,触发失败 }); @@ -363,12 +363,12 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { // ========== 随机对象 ========== @SafeVarargs - private static SysSmsTemplateDO randomSmsTemplateDO(Consumer... consumers) { - Consumer consumer = (o) -> { + private static SmsTemplateDO randomSmsTemplateDO(Consumer... consumers) { + Consumer consumer = (o) -> { o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); // 保证 status 的范围 - o.setType(randomEle(SysSmsTemplateTypeEnum.values()).getType()); // 保证 type 的 范围 + o.setType(randomEle(SmsTemplateTypeEnum.values()).getType()); // 保证 type 的 范围 }; - return randomPojo(SysSmsTemplateDO.class, ArrayUtils.append(consumer, consumers)); + return randomPojo(SmsTemplateDO.class, ArrayUtils.append(consumer, consumers)); } } diff --git a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceTest.java b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceTest.java index a67da17f2..8fb527baa 100644 --- a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceTest.java +++ b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceTest.java @@ -1,7 +1,7 @@ package cn.iocoder.yudao.module.system.service.social; -import cn.iocoder.yudao.module.system.dal.dataobject.social.SysSocialUserDO; -import cn.iocoder.yudao.module.system.dal.mysql.social.SysSocialUserMapper; +import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO; +import cn.iocoder.yudao.module.system.dal.mysql.social.SocialUserMapper; import cn.iocoder.yudao.module.system.dal.redis.social.SocialAuthUserRedisDAO; import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; @@ -29,13 +29,13 @@ public class SocialUserServiceTest extends BaseDbAndRedisUnitTest { private SocialUserServiceImpl socialService; @Resource - private SysSocialUserMapper socialUserMapper; + private SocialUserMapper socialUserMapper; @MockBean private AuthRequestFactory authRequestFactory; /** - * 情况一,创建 SysSocialUserDO 的情况 + * 情况一,创建 SocialUserDO 的情况 */ @Test public void testBindSocialUser_create() { @@ -49,18 +49,18 @@ public class SocialUserServiceTest extends BaseDbAndRedisUnitTest { // 调用 socialService.bindSocialUser(userId, UserTypeEnum.ADMIN.getValue(), type, authUser); // 断言 - List socialUsers = socialUserMapper.selectList("user_id", userId); + List socialUsers = socialUserMapper.selectList("user_id", userId); assertEquals(1, socialUsers.size()); assertBindSocialUser(socialUsers.get(0), authUser, userId, type); } /** - * 情况二,更新 SysSocialUserDO 的情况 + * 情况二,更新 SocialUserDO 的情况 */ @Test public void testBindSocialUser_update() { // mock 数据 - SysSocialUserDO dbSocialUser = randomPojo(SysSocialUserDO.class, socialUserDO -> { + SocialUserDO dbSocialUser = randomPojo(SocialUserDO.class, socialUserDO -> { socialUserDO.setUserType(UserTypeEnum.ADMIN.getValue()); socialUserDO.setType(randomEle(SocialTypeEnum.values()).getType()); }); @@ -74,7 +74,7 @@ public class SocialUserServiceTest extends BaseDbAndRedisUnitTest { // 调用 socialService.bindSocialUser(userId, UserTypeEnum.ADMIN.getValue(), type, authUser); // 断言 - List socialUsers = socialUserMapper.selectList("user_id", userId); + List socialUsers = socialUserMapper.selectList("user_id", userId); assertEquals(1, socialUsers.size()); assertBindSocialUser(socialUsers.get(0), authUser, userId, type); } @@ -85,7 +85,7 @@ public class SocialUserServiceTest extends BaseDbAndRedisUnitTest { @Test public void testBindSocialUser_userId() { // mock 数据 - SysSocialUserDO dbSocialUser = randomPojo(SysSocialUserDO.class, socialUserDO -> { + SocialUserDO dbSocialUser = randomPojo(SocialUserDO.class, socialUserDO -> { socialUserDO.setUserType(UserTypeEnum.ADMIN.getValue()); socialUserDO.setType(randomEle(SocialTypeEnum.values()).getType()); }); @@ -99,12 +99,12 @@ public class SocialUserServiceTest extends BaseDbAndRedisUnitTest { // 调用 socialService.bindSocialUser(userId, UserTypeEnum.ADMIN.getValue(), type, authUser); // 断言 - List socialUsers = socialUserMapper.selectList("user_id", userId); + List socialUsers = socialUserMapper.selectList("user_id", userId); assertEquals(1, socialUsers.size()); } - private void assertBindSocialUser(SysSocialUserDO socialUser, AuthUser authUser, Long userId, - Integer type) { + private void assertBindSocialUser(SocialUserDO socialUser, AuthUser authUser, Long userId, + Integer type) { assertEquals(authUser.getToken().getAccessToken(), socialUser.getToken()); assertEquals(toJsonString(authUser.getToken()), socialUser.getRawTokenInfo()); assertEquals(authUser.getNickname(), socialUser.getNickname()); @@ -123,7 +123,7 @@ public class SocialUserServiceTest extends BaseDbAndRedisUnitTest { @Test public void testUnbindOldSocialUser_no() { // mock 数据 - SysSocialUserDO oldSocialUser = randomPojo(SysSocialUserDO.class, socialUserDO -> { + SocialUserDO oldSocialUser = randomPojo(SocialUserDO.class, socialUserDO -> { socialUserDO.setUserType(UserTypeEnum.ADMIN.getValue()); socialUserDO.setType(randomEle(SocialTypeEnum.values()).getType()); }); @@ -146,7 +146,7 @@ public class SocialUserServiceTest extends BaseDbAndRedisUnitTest { @Test public void testUnbindOldSocialUser_yes() { // mock 数据 - SysSocialUserDO oldSocialUser = randomPojo(SysSocialUserDO.class, socialUserDO -> { + SocialUserDO oldSocialUser = randomPojo(SocialUserDO.class, socialUserDO -> { socialUserDO.setUserType(UserTypeEnum.ADMIN.getValue()); socialUserDO.setType(randomEle(SocialTypeEnum.values()).getType()); }); diff --git a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceTest.java b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceTest.java index 49c96cc5a..ade6613a0 100644 --- a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceTest.java +++ b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceTest.java @@ -4,8 +4,8 @@ import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.TenantCreateReq 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.module.system.controller.admin.tenant.vo.TenantUpdateReqVO; -import cn.iocoder.yudao.module.system.dal.mysql.tenant.SysTenantMapper; -import cn.iocoder.yudao.module.system.dal.dataobject.tenant.SysTenantDO; +import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO; +import cn.iocoder.yudao.module.system.dal.mysql.tenant.TenantMapper; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.system.test.BaseDbUnitTest; @@ -30,7 +30,7 @@ public class TenantServiceTest extends BaseDbUnitTest { private TenantServiceImpl tenantService; @Resource - private SysTenantMapper tenantMapper; + private TenantMapper tenantMapper; @Test public void testCreateTenant_success() { @@ -42,14 +42,14 @@ public class TenantServiceTest extends BaseDbUnitTest { // 断言 assertNotNull(tenantId); // 校验记录的属性是否正确 - SysTenantDO tenant = tenantMapper.selectById(tenantId); + TenantDO tenant = tenantMapper.selectById(tenantId); assertPojoEquals(reqVO, tenant); } @Test public void testUpdateTenant_success() { // mock 数据 - SysTenantDO dbTenant = randomPojo(SysTenantDO.class, o -> o.setStatus(randomCommonStatus())); + TenantDO dbTenant = randomPojo(TenantDO.class, o -> o.setStatus(randomCommonStatus())); tenantMapper.insert(dbTenant);// @Sql: 先插入出一条存在的数据 // 准备参数 TenantUpdateReqVO reqVO = randomPojo(TenantUpdateReqVO.class, o -> { @@ -60,7 +60,7 @@ public class TenantServiceTest extends BaseDbUnitTest { // 调用 tenantService.updateTenant(reqVO); // 校验是否更新正确 - SysTenantDO tenant = tenantMapper.selectById(reqVO.getId()); // 获取最新的 + TenantDO tenant = tenantMapper.selectById(reqVO.getId()); // 获取最新的 assertPojoEquals(reqVO, tenant); } @@ -76,7 +76,7 @@ public class TenantServiceTest extends BaseDbUnitTest { @Test public void testDeleteTenant_success() { // mock 数据 - SysTenantDO dbTenant = randomPojo(SysTenantDO.class, + TenantDO dbTenant = randomPojo(TenantDO.class, o -> o.setStatus(randomCommonStatus())); tenantMapper.insert(dbTenant);// @Sql: 先插入出一条存在的数据 // 准备参数 @@ -100,7 +100,7 @@ public class TenantServiceTest extends BaseDbUnitTest { @Test public void testGetTenantPage() { // mock 数据 - SysTenantDO dbTenant = randomPojo(SysTenantDO.class, o -> { // 等会查询到 + TenantDO dbTenant = randomPojo(TenantDO.class, o -> { // 等会查询到 o.setName("芋道源码"); o.setContactName("芋艿"); o.setContactMobile("15601691300"); @@ -128,7 +128,7 @@ public class TenantServiceTest extends BaseDbUnitTest { reqVO.setEndCreateTime(buildTime(2020, 12, 24)); // 调用 - PageResult pageResult = tenantService.getTenantPage(reqVO); + PageResult pageResult = tenantService.getTenantPage(reqVO); // 断言 assertEquals(1, pageResult.getTotal()); assertEquals(1, pageResult.getList().size()); @@ -138,7 +138,7 @@ public class TenantServiceTest extends BaseDbUnitTest { @Test public void testGetTenantList() { // mock 数据 - SysTenantDO dbTenant = randomPojo(SysTenantDO.class, o -> { // 等会查询到 + TenantDO dbTenant = randomPojo(TenantDO.class, o -> { // 等会查询到 o.setName("芋道源码"); o.setContactName("芋艿"); o.setContactMobile("15601691300"); @@ -166,7 +166,7 @@ public class TenantServiceTest extends BaseDbUnitTest { reqVO.setEndCreateTime(buildTime(2020, 12, 24)); // 调用 - List list = tenantService.getTenantList(reqVO); + List list = tenantService.getTenantList(reqVO); // 断言 assertEquals(1, list.size()); assertPojoEquals(dbTenant, list.get(0)); diff --git a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/user/UserServiceImplTest.java b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/user/UserServiceImplTest.java index c96f9c44c..ffff7e2bd 100644 --- a/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/user/UserServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/user/UserServiceImplTest.java @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.system.service.user; import cn.hutool.core.util.RandomUtil; import cn.iocoder.yudao.coreservice.modules.infra.service.file.InfFileCoreService; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import cn.iocoder.yudao.framework.common.exception.ServiceException; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; @@ -10,11 +11,11 @@ import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; 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.module.system.dal.dataobject.dept.SysDeptDO; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.SysPostDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper; -import cn.iocoder.yudao.module.system.enums.common.SysSexEnum; +import cn.iocoder.yudao.module.system.enums.common.SexEnum; import cn.iocoder.yudao.module.system.service.dept.DeptService; import cn.iocoder.yudao.module.system.service.dept.PostService; import cn.iocoder.yudao.module.system.service.permission.PermissionService; @@ -68,18 +69,18 @@ public class UserServiceImplTest extends BaseDbUnitTest { public void testCreatUser_success() { // 准备参数 UserCreateReqVO reqVO = randomPojo(UserCreateReqVO.class, o -> { - o.setSex(RandomUtil.randomEle(SysSexEnum.values()).getSex()); + o.setSex(RandomUtil.randomEle(SexEnum.values()).getSex()); o.setMobile(randomString()); }); // mock deptService 的方法 - SysDeptDO dept = randomPojo(SysDeptDO.class, o -> { + DeptDO dept = randomPojo(DeptDO.class, o -> { o.setId(reqVO.getDeptId()); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); }); when(deptService.getDept(eq(dept.getId()))).thenReturn(dept); // mock postService 的方法 - List posts = CollectionUtils.convertList(reqVO.getPostIds(), postId -> - randomPojo(SysPostDO.class, o -> { + List posts = CollectionUtils.convertList(reqVO.getPostIds(), postId -> + randomPojo(PostDO.class, o -> { o.setId(postId); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); })); @@ -99,23 +100,23 @@ public class UserServiceImplTest extends BaseDbUnitTest { @Test public void testUpdateUser_success() { // mock 数据 - AdminUserDO dbUser = randomSysUserDO(); + AdminUserDO dbUser = randomAdminUserDO(); userMapper.insert(dbUser); // 准备参数 UserUpdateReqVO reqVO = randomPojo(UserUpdateReqVO.class, o -> { o.setId(dbUser.getId()); - o.setSex(RandomUtil.randomEle(SysSexEnum.values()).getSex()); + o.setSex(RandomUtil.randomEle(SexEnum.values()).getSex()); o.setMobile(randomString()); }); // mock deptService 的方法 - SysDeptDO dept = randomPojo(SysDeptDO.class, o -> { + DeptDO dept = randomPojo(DeptDO.class, o -> { o.setId(reqVO.getDeptId()); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); }); when(deptService.getDept(eq(dept.getId()))).thenReturn(dept); // mock postService 的方法 - List posts = CollectionUtils.convertList(reqVO.getPostIds(), postId -> - randomPojo(SysPostDO.class, o -> { + List posts = CollectionUtils.convertList(reqVO.getPostIds(), postId -> + randomPojo(PostDO.class, o -> { o.setId(postId); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); })); @@ -131,13 +132,13 @@ public class UserServiceImplTest extends BaseDbUnitTest { @Test public void testUpdateUserProfile_success() { // mock 数据 - AdminUserDO dbUser = randomSysUserDO(); + AdminUserDO dbUser = randomAdminUserDO(); userMapper.insert(dbUser); // 准备参数 Long userId = dbUser.getId(); UserProfileUpdateReqVO reqVO = randomPojo(UserProfileUpdateReqVO.class, o -> { o.setMobile(randomString()); - o.setSex(RandomUtil.randomEle(SysSexEnum.values()).getSex()); + o.setSex(RandomUtil.randomEle(SexEnum.values()).getSex()); }); // 调用 @@ -150,7 +151,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { @Test public void testUpdateUserPassword_success() { // mock 数据 - AdminUserDO dbUser = randomSysUserDO(o -> o.setPassword("encode:yudao")); + AdminUserDO dbUser = randomAdminUserDO(o -> o.setPassword("encode:yudao")); userMapper.insert(dbUser); // 准备参数 Long userId = dbUser.getId(); @@ -173,7 +174,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { @Test public void testUpdateUserAvatar_success() { // mock 数据 - AdminUserDO dbUser = randomSysUserDO(); + AdminUserDO dbUser = randomAdminUserDO(); userMapper.insert(dbUser); // 准备参数 Long userId = dbUser.getId(); @@ -193,7 +194,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { @Test public void testUpdateUserPassword02_success() { // mock 数据 - AdminUserDO dbUser = randomSysUserDO(); + AdminUserDO dbUser = randomAdminUserDO(); userMapper.insert(dbUser); // 准备参数 Long userId = dbUser.getId(); @@ -212,7 +213,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { @Test public void testUpdateUserStatus() { // mock 数据 - AdminUserDO dbUser = randomSysUserDO(); + AdminUserDO dbUser = randomAdminUserDO(); userMapper.insert(dbUser); // 准备参数 Long userId = dbUser.getId(); @@ -228,7 +229,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { @Test public void testDeleteUser_success(){ // mock 数据 - AdminUserDO dbUser = randomSysUserDO(); + AdminUserDO dbUser = randomAdminUserDO(); userMapper.insert(dbUser); // 准备参数 Long userId = dbUser.getId(); @@ -254,7 +255,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { reqVO.setEndTime(buildTime(2020, 12, 24)); reqVO.setDeptId(1L); // 其中,1L 是 2L 的父部门 // mock 方法 - List deptList = newArrayList(randomPojo(SysDeptDO.class, o -> o.setId(2L))); + List deptList = newArrayList(randomPojo(DeptDO.class, o -> o.setId(2L))); when(deptService.getDeptsByParentIdFromCache(eq(reqVO.getDeptId()), eq(true))).thenReturn(deptList); // 调用 @@ -278,7 +279,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { reqVO.setEndTime(buildTime(2020, 12, 24)); reqVO.setDeptId(1L); // 其中,1L 是 2L 的父部门 // mock 方法 - List deptList = newArrayList(randomPojo(SysDeptDO.class, o -> o.setId(2L))); + List deptList = newArrayList(randomPojo(DeptDO.class, o -> o.setId(2L))); when(deptService.getDeptsByParentIdFromCache(eq(reqVO.getDeptId()), eq(true))).thenReturn(deptList); // 调用 @@ -293,7 +294,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { */ private AdminUserDO initGetUserPageData() { // mock 数据 - AdminUserDO dbUser = randomSysUserDO(o -> { // 等会查询到 + AdminUserDO dbUser = randomAdminUserDO(o -> { // 等会查询到 o.setUsername("yudaoyuanma"); o.setMobile("15601691300"); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); @@ -320,8 +321,10 @@ public class UserServiceImplTest extends BaseDbUnitTest { @Test public void testImportUsers_01() { // 准备参数 - UserImportExcelVO importUser = randomPojo(UserImportExcelVO.class); - // mock 方法 + UserImportExcelVO importUser = randomPojo(UserImportExcelVO.class, o -> { + }); + // mock 方法,模拟失败 + doThrow(new ServiceException(DEPT_NOT_FOUND)).when(deptService).validDepts(any()); // 调用 UserImportRespVO respVO = userService.importUsers(newArrayList(importUser), true); @@ -340,10 +343,10 @@ public class UserServiceImplTest extends BaseDbUnitTest { // 准备参数 UserImportExcelVO importUser = randomPojo(UserImportExcelVO.class, o -> { o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); // 保证 status 的范围 - o.setSex(randomEle(SysSexEnum.values()).getSex()); // 保证 sex 的范围 + o.setSex(randomEle(SexEnum.values()).getSex()); // 保证 sex 的范围 }); // mock deptService 的方法 - SysDeptDO dept = randomPojo(SysDeptDO.class, o -> { + DeptDO dept = randomPojo(DeptDO.class, o -> { o.setId(importUser.getDeptId()); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); }); @@ -368,16 +371,16 @@ public class UserServiceImplTest extends BaseDbUnitTest { @Test public void testImportUsers_03() { // mock 数据 - AdminUserDO dbUser = randomSysUserDO(); + AdminUserDO dbUser = randomAdminUserDO(); userMapper.insert(dbUser); // 准备参数 UserImportExcelVO importUser = randomPojo(UserImportExcelVO.class, o -> { o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); // 保证 status 的范围 - o.setSex(randomEle(SysSexEnum.values()).getSex()); // 保证 sex 的范围 + o.setSex(randomEle(SexEnum.values()).getSex()); // 保证 sex 的范围 o.setUsername(dbUser.getUsername()); }); // mock deptService 的方法 - SysDeptDO dept = randomPojo(SysDeptDO.class, o -> { + DeptDO dept = randomPojo(DeptDO.class, o -> { o.setId(importUser.getDeptId()); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); }); @@ -398,16 +401,16 @@ public class UserServiceImplTest extends BaseDbUnitTest { @Test public void testImportUsers_04() { // mock 数据 - AdminUserDO dbUser = randomSysUserDO(); + AdminUserDO dbUser = randomAdminUserDO(); userMapper.insert(dbUser); // 准备参数 UserImportExcelVO importUser = randomPojo(UserImportExcelVO.class, o -> { o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); // 保证 status 的范围 - o.setSex(randomEle(SysSexEnum.values()).getSex()); // 保证 sex 的范围 + o.setSex(randomEle(SexEnum.values()).getSex()); // 保证 sex 的范围 o.setUsername(dbUser.getUsername()); }); // mock deptService 的方法 - SysDeptDO dept = randomPojo(SysDeptDO.class, o -> { + DeptDO dept = randomPojo(DeptDO.class, o -> { o.setId(importUser.getDeptId()); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); }); @@ -433,7 +436,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { // 准备参数 String username = randomString(); // mock 数据 - userMapper.insert(randomSysUserDO(o -> o.setUsername(username))); + userMapper.insert(randomAdminUserDO(o -> o.setUsername(username))); // 调用,校验异常 assertServiceException(() -> userService.checkUsernameUnique(null, username), @@ -446,7 +449,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { Long id = randomLongId(); String username = randomString(); // mock 数据 - userMapper.insert(randomSysUserDO(o -> o.setUsername(username))); + userMapper.insert(randomAdminUserDO(o -> o.setUsername(username))); // 调用,校验异常 assertServiceException(() -> userService.checkUsernameUnique(id, username), @@ -458,7 +461,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { // 准备参数 String email = randomString(); // mock 数据 - userMapper.insert(randomSysUserDO(o -> o.setEmail(email))); + userMapper.insert(randomAdminUserDO(o -> o.setEmail(email))); // 调用,校验异常 assertServiceException(() -> userService.checkEmailUnique(null, email), @@ -471,7 +474,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { Long id = randomLongId(); String email = randomString(); // mock 数据 - userMapper.insert(randomSysUserDO(o -> o.setEmail(email))); + userMapper.insert(randomAdminUserDO(o -> o.setEmail(email))); // 调用,校验异常 assertServiceException(() -> userService.checkEmailUnique(id, email), @@ -483,7 +486,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { // 准备参数 String mobile = randomString(); // mock 数据 - userMapper.insert(randomSysUserDO(o -> o.setMobile(mobile))); + userMapper.insert(randomAdminUserDO(o -> o.setMobile(mobile))); // 调用,校验异常 assertServiceException(() -> userService.checkMobileUnique(null, mobile), @@ -496,7 +499,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { Long id = randomLongId(); String mobile = randomString(); // mock 数据 - userMapper.insert(randomSysUserDO(o -> o.setMobile(mobile))); + userMapper.insert(randomAdminUserDO(o -> o.setMobile(mobile))); // 调用,校验异常 assertServiceException(() -> userService.checkMobileUnique(id, mobile), @@ -512,7 +515,7 @@ public class UserServiceImplTest extends BaseDbUnitTest { @Test public void testCheckOldPassword_passwordFailed() { // mock 数据 - AdminUserDO user = randomSysUserDO(); + AdminUserDO user = randomAdminUserDO(); userMapper.insert(user); // 准备参数 Long id = user.getId(); @@ -530,13 +533,13 @@ public class UserServiceImplTest extends BaseDbUnitTest { // // 准备参数 // Collection postIds = asSet(10L, 20L); // // mock 方法 -// SysUserDO user1 = randomSysUserDO(o -> o.setPostIds(asSet(10L, 30L))); +// AdminUserDO user1 = randomAdminUserDO(o -> o.setPostIds(asSet(10L, 30L))); // userMapper.insert(user1); -// SysUserDO user2 = randomSysUserDO(o -> o.setPostIds(singleton(100L))); +// AdminUserDO user2 = randomAdminUserDO(o -> o.setPostIds(singleton(100L))); // userMapper.insert(user2); // // // 调用 -// List result = userService.getUsersByPostIds(postIds); +// List result = userService.getUsersByPostIds(postIds); // // 断言 // assertEquals(1, result.size()); // assertEquals(user1, result.get(0)); @@ -545,10 +548,10 @@ public class UserServiceImplTest extends BaseDbUnitTest { // ========== 随机对象 ========== @SafeVarargs - private static AdminUserDO randomSysUserDO(Consumer... consumers) { + private static AdminUserDO randomAdminUserDO(Consumer... consumers) { Consumer consumer = (o) -> { o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); // 保证 status 的范围 - o.setSex(randomEle(SysSexEnum.values()).getSex()); // 保证 sex 的范围 + o.setSex(randomEle(SexEnum.values()).getSex()); // 保证 sex 的范围 }; return randomPojo(AdminUserDO.class, ArrayUtils.append(consumer, consumers)); } diff --git a/yudao-module-system/yudao-module-system-impl/src/test/resources/application-unit-test.yaml b/yudao-module-system/yudao-module-system-impl/src/test/resources/application-unit-test.yaml new file mode 100644 index 000000000..9164b07e6 --- /dev/null +++ b/yudao-module-system/yudao-module-system-impl/src/test/resources/application-unit-test.yaml @@ -0,0 +1,55 @@ +spring: + main: + lazy-initialization: true # 开启懒加载,加快速度 + banner-mode: off # 单元测试,禁用 Banner + +--- #################### 数据库相关配置 #################### + +spring: + # 数据源配置项 + datasource: + name: ruoyi-vue-pro + url: jdbc:h2:mem:testdb;MODE=MYSQL;DATABASE_TO_UPPER=false; # MODE 使用 MySQL 模式;DATABASE_TO_UPPER 配置表和字段使用小写 + driver-class-name: org.h2.Driver + username: sa + password: + schema: classpath:sql/create_tables.sql # MySQL 转 H2 的语句,使用 https://www.jooq.org/translate/ 工具 + druid: + async-init: true # 单元测试,异步初始化 Druid 连接池,提升启动速度 + initial-size: 1 # 单元测试,配置为 1,提升启动速度 + + # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 + redis: + host: 127.0.0.1 # 地址 + port: 16379 # 端口(单元测试,使用 16379 端口) + database: 0 # 数据库索引 + +mybatis: + lazy-initialization: true # 单元测试,设置 MyBatis Mapper 延迟加载,加速每个单元测试 + +--- #################### 定时任务相关配置 #################### + +--- #################### 配置中心相关配置 #################### + +--- #################### 服务保障相关配置 #################### + +# Lock4j 配置项(单元测试,禁用 Lock4j) + +# Resilience4j 配置项 + +--- #################### 监控相关配置 #################### + +--- #################### 芋道相关配置 #################### + +# 芋道配置项,设置当前项目所有自定义的配置 +yudao: + info: + base-package: cn.iocoder.yudao.module.member.dal.mysql + member-package: cn.iocoder.yudao.module.member # TODO 芋艿:要清理掉 + system-package: cn.iocoder.yudao.module.system # TODO 芋艿:要清理掉 + core-service: + base-package: cn.iocoder.yudao.module.member.dal.mysql # TODO 芋艿:要清理掉 + captcha: + timeout: 5m + width: 160 + height: 60 diff --git a/yudao-module-system/yudao-module-system-impl/src/test/resources/logback-spring.xml b/yudao-module-system/yudao-module-system-impl/src/test/resources/logback-spring.xml new file mode 100644 index 000000000..daf756bff --- /dev/null +++ b/yudao-module-system/yudao-module-system-impl/src/test/resources/logback-spring.xml @@ -0,0 +1,4 @@ + + + + diff --git a/yudao-module-system/yudao-module-system-impl/src/test/resources/sql/clean.sql b/yudao-module-system/yudao-module-system-impl/src/test/resources/sql/clean.sql new file mode 100644 index 000000000..88c7c845b --- /dev/null +++ b/yudao-module-system/yudao-module-system-impl/src/test/resources/sql/clean.sql @@ -0,0 +1,18 @@ +DELETE FROM "system_dept"; +DELETE FROM "system_dict_data"; +DELETE FROM "system_role"; +DELETE FROM "system_role_menu"; +DELETE FROM "system_menu"; +DELETE FROM "system_user_role"; +DELETE FROM "system_dict_type"; +DELETE FROM "system_user_session"; +DELETE FROM "system_post"; +DELETE FROM "system_login_log"; +DELETE FROM "system_operate_log"; +DELETE FROM "system_user"; +DELETE FROM "system_sms_channel"; +DELETE FROM "system_sms_template"; +DELETE FROM "system_sms_log"; +DELETE FROM "system_error_code"; +DELETE FROM "system_social_user"; +DELETE FROM "system_tenant"; diff --git a/yudao-module-system/yudao-module-system-impl/src/test/resources/sql/create_tables.sql b/yudao-module-system/yudao-module-system-impl/src/test/resources/sql/create_tables.sql new file mode 100644 index 000000000..914352e8f --- /dev/null +++ b/yudao-module-system/yudao-module-system-impl/src/test/resources/sql/create_tables.sql @@ -0,0 +1,405 @@ +-- sys 开头的 DB + +CREATE TABLE IF NOT EXISTS "system_dept" ( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "name" varchar(30) NOT NULL DEFAULT '', + "parent_id" bigint NOT NULL DEFAULT '0', + "sort" int NOT NULL DEFAULT '0', + "leader_user_id" bigint DEFAULT NULL, + "phone" varchar(11) DEFAULT NULL, + "email" varchar(50) DEFAULT NULL, + "status" tinyint NOT NULL, + "creator" varchar(64) DEFAULT '', + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar(64) DEFAULT '', + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + "tenant_id" bigint not null default '0', + PRIMARY KEY ("id") +) COMMENT '部门表'; + +CREATE TABLE IF NOT EXISTS "system_dict_data" ( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "sort" int NOT NULL DEFAULT '0', + "label" varchar(100) NOT NULL DEFAULT '', + "value" varchar(100) NOT NULL DEFAULT '', + "dict_type" varchar(100) NOT NULL DEFAULT '', + "status" tinyint NOT NULL DEFAULT '0', + "remark" varchar(500) DEFAULT NULL, + "creator" varchar(64) DEFAULT '', + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar(64) DEFAULT '', + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + PRIMARY KEY ("id") +) COMMENT '字典数据表'; + +CREATE TABLE IF NOT EXISTS "system_role" ( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "name" varchar(30) NOT NULL, + "code" varchar(100) NOT NULL, + "sort" int NOT NULL, + "data_scope" tinyint NOT NULL DEFAULT '1', + "data_scope_dept_ids" varchar(500) NOT NULL DEFAULT '', + "status" tinyint NOT NULL, + "type" tinyint NOT NULL, + "remark" varchar(500) DEFAULT NULL, + "creator" varchar(64) DEFAULT '', + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar(64) DEFAULT '', + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + PRIMARY KEY ("id") +) COMMENT '角色信息表'; + +CREATE TABLE IF NOT EXISTS "system_role_menu" ( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "role_id" bigint NOT NULL, + "menu_id" bigint NOT NULL, + "creator" varchar(64) DEFAULT '', + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar(64) DEFAULT '', + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + PRIMARY KEY ("id") +) COMMENT '角色和菜单关联表'; + +CREATE TABLE IF NOT EXISTS "system_menu" ( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "name" varchar(50) NOT NULL, + "permission" varchar(100) NOT NULL DEFAULT '', + "menu_type" tinyint NOT NULL, + "sort" int NOT NULL DEFAULT '0', + "parent_id" bigint NOT NULL DEFAULT '0', + "path" varchar(200) DEFAULT '', + "icon" varchar(100) DEFAULT '#', + "component" varchar(255) DEFAULT NULL, + "status" tinyint NOT NULL DEFAULT '0', + "creator" varchar(64) DEFAULT '', + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar(64) DEFAULT '', + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + PRIMARY KEY ("id") +) COMMENT '菜单权限表'; + +CREATE TABLE IF NOT EXISTS "system_user_role" ( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "user_id" bigint NOT NULL, + "role_id" bigint NOT NULL, + "creator" varchar(64) DEFAULT '', + "create_time" timestamp DEFAULT NULL, + "updater" varchar(64) DEFAULT '', + "update_time" timestamp DEFAULT NULL, + "deleted" bit DEFAULT FALSE, + PRIMARY KEY ("id") +) COMMENT '用户和角色关联表'; + +CREATE TABLE IF NOT EXISTS "system_dict_type" ( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "name" varchar(100) NOT NULL DEFAULT '', + "type" varchar(100) NOT NULL DEFAULT '', + "status" tinyint NOT NULL DEFAULT '0', + "remark" varchar(500) DEFAULT NULL, + "creator" varchar(64) DEFAULT '', + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar(64) DEFAULT '', + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + PRIMARY KEY ("id") +) COMMENT '字典类型表'; + +CREATE TABLE IF NOT EXISTS `system_user_session` ( + `id` varchar(32) NOT NULL, + `user_id` bigint DEFAULT NULL, + "user_type" tinyint NOT NULL, + `username` varchar(50) NOT NULL DEFAULT '', + `user_ip` varchar(50) DEFAULT NULL, + `user_agent` varchar(512) DEFAULT NULL, + `session_timeout` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "creator" varchar(64) DEFAULT '', + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updater` varchar(64) DEFAULT '' , + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + "tenant_id" bigint not null default '0', + PRIMARY KEY (`id`) +) COMMENT '用户在线 Session'; + +CREATE TABLE IF NOT EXISTS "system_post" ( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "code" varchar(64) NOT NULL, + "name" varchar(50) NOT NULL, + "sort" integer NOT NULL, + "status" tinyint NOT NULL, + "remark" varchar(500) DEFAULT NULL, + "creator" varchar(64) DEFAULT '', + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar(64) DEFAULT '', + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + "tenant_id" bigint not null default '0', + PRIMARY KEY ("id") +) COMMENT '岗位信息表'; + +CREATE TABLE IF NOT EXISTS "system_notice" ( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "title" varchar(50) NOT NULL COMMENT '公告标题', + "content" text NOT NULL COMMENT '公告内容', + "notice_type" tinyint NOT NULL COMMENT '公告类型(1通知 2公告)', + "status" tinyint NOT NULL DEFAULT '0' COMMENT '公告状态(0正常 1关闭)', + "creator" varchar(64) DEFAULT '' COMMENT '创建者', + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + "updater" varchar(64) DEFAULT '' COMMENT '更新者', + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + "deleted" bit NOT NULL DEFAULT 0 COMMENT '是否删除', + "tenant_id" bigint not null default '0', + PRIMARY KEY("id") +) COMMENT '通知公告表'; + +CREATE TABLE IF NOT EXISTS `system_login_log` ( + `id` bigint(20) NOT NULL GENERATED BY DEFAULT AS IDENTITY, + `log_type` bigint(4) NOT NULL, + "user_id" bigint not null default '0', + "user_type" tinyint NOT NULL, + `trace_id` varchar(64) NOT NULL DEFAULT '', + `username` varchar(50) NOT NULL DEFAULT '', + `result` tinyint(4) NOT NULL, + `user_ip` varchar(50) NOT NULL, + `user_agent` varchar(512) NOT NULL, + `creator` varchar(64) DEFAULT '', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updater` varchar(64) DEFAULT '', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `deleted` bit(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) COMMENT ='系统访问记录'; + +CREATE TABLE IF NOT EXISTS `system_operate_log` ( + `id` bigint(20) NOT NULL GENERATED BY DEFAULT AS IDENTITY, + `trace_id` varchar(64) NOT NULL DEFAULT '', + `user_id` bigint(20) NOT NULL, + `module` varchar(50) NOT NULL, + `name` varchar(50) NOT NULL, + `operate_type` bigint(4) NOT NULL DEFAULT '0', + `content` varchar(2000) NOT NULL DEFAULT '', + `exts` varchar(512) NOT NULL DEFAULT '', + `request_method` varchar(16) DEFAULT '', + `request_url` varchar(255) DEFAULT '', + `user_ip` varchar(50) DEFAULT NULL, + `user_agent` varchar(200) DEFAULT NULL, + `java_method` varchar(512) NOT NULL DEFAULT '', + `java_method_args` varchar(8000) DEFAULT '', + `start_time` datetime NOT NULL, + `duration` int(11) NOT NULL, + `result_code` int(11) NOT NULL DEFAULT '0', + `result_msg` varchar(512) DEFAULT '', + `result_data` varchar(4000) DEFAULT '', + `creator` varchar(64) DEFAULT '', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updater` varchar(64) DEFAULT '', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `deleted` bit(1) NOT NULL DEFAULT '0', + "tenant_id" bigint not null default '0', + PRIMARY KEY (`id`) +) COMMENT ='操作日志记录'; + +CREATE TABLE IF NOT EXISTS "system_user" ( + "id" bigint not null GENERATED BY DEFAULT AS IDENTITY, + "username" varchar(30) not null, + "password" varchar(100) not null default '', + "nickname" varchar(30) not null, + "remark" varchar(500) default null, + "dept_id" bigint default null, + "post_ids" varchar(255) default null, + "email" varchar(50) default '', + "mobile" varchar(11) default '', + "sex" tinyint default '0', + "avatar" varchar(100) default '', + "status" tinyint not null default '0', + "login_ip" varchar(50) default '', + "login_date" timestamp default null, + "creator" varchar(64) default '', + "create_time" timestamp not null default current_timestamp, + "updater" varchar(64) default '', + "update_time" timestamp not null default current_timestamp, + "deleted" bit not null default false, + "tenant_id" bigint not null default '0', + primary key ("id") +) comment '用户信息表'; + +CREATE TABLE IF NOT EXISTS "inf_api_access_log" ( + "id" bigint not null GENERATED BY DEFAULT AS IDENTITY, + "trace_id" varchar(64) not null default '', + "user_id" bigint not null default '0', + "user_type" tinyint not null default '0', + "application_name" varchar(50) not null, + "request_method" varchar(16) not null default '', + "request_url" varchar(255) not null default '', + "request_params" varchar(8000) not null default '', + "user_ip" varchar(50) not null, + "user_agent" varchar(512) not null, + "begin_time" timestamp not null, + "end_time" timestamp not null, + "duration" integer not null, + "result_code" integer not null default '0', + "result_msg" varchar(512) default '', + "creator" varchar(64) default '', + "create_time" timestamp not null default current_timestamp, + "updater" varchar(64) default '', + "update_time" timestamp not null default current_timestamp, + "deleted" bit not null default false, + "tenant_id" bigint not null default '0', + primary key ("id") +) COMMENT 'API 访问日志表'; + +CREATE TABLE IF NOT EXISTS "inf_api_error_log" ( + "id" bigint not null GENERATED BY DEFAULT AS IDENTITY, + "trace_id" varchar(64) not null, + "user_id" bigint not null default '0', + "user_type" tinyint not null default '0', + "application_name" varchar(50) not null, + "request_method" varchar(16) not null, + "request_url" varchar(255) not null, + "request_params" varchar(8000) not null, + "user_ip" varchar(50) not null, + "user_agent" varchar(512) not null, + "exception_time" timestamp not null, + "exception_name" varchar(128) not null default '', + "exception_message" clob not null, + "exception_root_cause_message" clob not null, + "exception_stack_trace" clob not null, + "exception_class_name" varchar(512) not null, + "exception_file_name" varchar(512) not null, + "exception_method_name" varchar(512) not null, + "exception_line_number" integer not null, + "process_status" tinyint not null, + "process_time" timestamp default null, + "process_user_id" bigint default '0', + "creator" varchar(64) default '', + "create_time" timestamp not null default current_timestamp, + "updater" varchar(64) default '', + "update_time" timestamp not null default current_timestamp, + "deleted" bit not null default false, + "tenant_id" bigint not null default '0', + primary key ("id") +) COMMENT '系统异常日志'; + +CREATE TABLE IF NOT EXISTS "system_sms_channel" ( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "signature" varchar(10) NOT NULL, + "code" varchar(63) NOT NULL, + "status" tinyint NOT NULL, + "remark" varchar(255) DEFAULT NULL, + "api_key" varchar(63) NOT NULL, + "api_secret" varchar(63) DEFAULT NULL, + "callback_url" varchar(255) DEFAULT NULL, + "creator" varchar(64) DEFAULT '', + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar(64) DEFAULT '', + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + PRIMARY KEY ("id") +) COMMENT '短信渠道'; + +CREATE TABLE IF NOT EXISTS "system_sms_template" ( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "type" tinyint NOT NULL, + "status" tinyint NOT NULL, + "code" varchar(63) NOT NULL, + "name" varchar(63) NOT NULL, + "content" varchar(255) NOT NULL, + "params" varchar(255) NOT NULL, + "remark" varchar(255) DEFAULT NULL, + "api_template_id" varchar(63) NOT NULL, + "channel_id" bigint NOT NULL, + "channel_code" varchar(63) NOT NULL, + "creator" varchar(64) DEFAULT '', + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar(64) DEFAULT '', + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + PRIMARY KEY ("id") +) COMMENT '短信模板'; + +CREATE TABLE IF NOT EXISTS "system_sms_log" ( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "channel_id" bigint NOT NULL, + "channel_code" varchar(63) NOT NULL, + "template_id" bigint NOT NULL, + "template_code" varchar(63) NOT NULL, + "template_type" tinyint NOT NULL, + "template_content" varchar(255) NOT NULL, + "template_params" varchar(255) NOT NULL, + "api_template_id" varchar(63) NOT NULL, + "mobile" varchar(11) NOT NULL, + "user_id" bigint DEFAULT '0', + "user_type" tinyint DEFAULT '0', + "send_status" tinyint NOT NULL DEFAULT '0', + "send_time" timestamp DEFAULT NULL, + "send_code" int DEFAULT NULL, + "send_msg" varchar(255) DEFAULT NULL, + "api_send_code" varchar(63) DEFAULT NULL, + "api_send_msg" varchar(255) DEFAULT NULL, + "api_request_id" varchar(255) DEFAULT NULL, + "api_serial_no" varchar(255) DEFAULT NULL, + "receive_status" tinyint NOT NULL DEFAULT '0', + "receive_time" timestamp DEFAULT NULL, + "api_receive_code" varchar(63) DEFAULT NULL, + "api_receive_msg" varchar(255) DEFAULT NULL, + "creator" varchar(64) DEFAULT '', + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar(64) DEFAULT '', + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + PRIMARY KEY ("id") +) COMMENT '短信日志'; + +CREATE TABLE IF NOT EXISTS "system_error_code" ( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "type" tinyint NOT NULL DEFAULT '0', + "application_name" varchar(50) NOT NULL, + "code" int NOT NULL DEFAULT '0', + "message" varchar(512) NOT NULL DEFAULT '', + "memo" varchar(512) DEFAULT '', + "creator" varchar(64) DEFAULT '', + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar(64) DEFAULT '', + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + PRIMARY KEY ("id") +) COMMENT '错误码表'; + +CREATE TABLE IF NOT EXISTS "system_social_user" ( + "id" number NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "user_id" bigint NOT NULL, + "user_type" tinyint NOT NULL DEFAULT '0', + "type" tinyint NOT NULL, + "openid" varchar(32) NOT NULL, + "token" varchar(256) DEFAULT NULL, + "union_id" varchar(32) NOT NULL, + "raw_token_info" varchar(1024) NOT NULL, + "nickname" varchar(32) NOT NULL, + "avatar" varchar(255) DEFAULT NULL, + "raw_user_info" varchar(1024) NOT NULL, + "creator" varchar(64) DEFAULT '', + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar(64) DEFAULT '', + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + PRIMARY KEY ("id") +) COMMENT '社交用户'; + +CREATE TABLE IF NOT EXISTS "system_tenant" ( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "name" varchar(63) NOT NULL, + "contact_name" varchar(255) NOT NULL, + "contact_mobile" varchar(255), + "status" tinyint NOT NULL, + "creator" varchar(64) DEFAULT '', + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar(64) DEFAULT '', + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + PRIMARY KEY ("id") +) COMMENT '租户';