From e78565ea5ad4b9865c9ddce0200c535448d84d94 Mon Sep 17 00:00:00 2001 From: hongawen <83944980@qq.com> Date: Tue, 31 Mar 2026 19:58:48 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E7=BB=93=E6=9E=84=E5=8C=96=E8=B0=83?= =?UTF-8?q?=E6=95=B4=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logger/ApiAccessLogCommonApi.java | 8 +- .../logger/ApiErrorLogCommonApi.java | 8 +- .../logger/dto/ApiAccessLogCreateReqDTO.java | 3 +- .../logger/dto/ApiErrorLogCreateReqDTO.java | 2 +- .../factory/ProviderFactorySupport.java | 27 ++ .../push/client/sender/SendOutcome.java | 21 + .../module/push/client/sender/SendResult.java | 109 +++++ .../fallback/AbstractFixedResultSender.java | 30 ++ .../fallback/FixedResultAppPushSender.java | 21 + .../fallback/FixedResultEmailSender.java | 23 + .../sender/fallback/FixedResultSmsSender.java | 39 ++ .../impl/apppush/UniPushAppPushSender.java | 101 +++++ .../sender/impl/email/AliyunEmailSender.java | 110 +++++ .../sender/impl/sms/AliyunSmsSender.java | 156 +++++++ .../sender/impl/sms/TelecomSmsSender.java | 225 ++++++++++ .../module/system}/api/config/ConfigApi.java | 6 +- .../module/system/api/user/AdminUserApi.java | 15 +- .../api/websocket/WebSocketSenderApi.java | 42 ++ .../dto/WebSocketSendToUsersReqDTO.java | 27 ++ .../system}/enums/config/ConfigTypeEnum.java | 2 +- .../system/enums/dept/DeptOrgTypeEnum.java | 33 ++ .../system/enums/dept/PostTypeEnum.java | 28 ++ .../logger/ApiErrorLogProcessStatusEnum.java | 2 +- .../enums/permission/MenuRouteKindEnum.java | 38 ++ .../msgpush-module-system-boot}/pom.xml | 64 +-- .../system/SystemServerApplication.java | 1 - .../system}/api/config/ConfigApiImpl.java | 8 +- .../module/system/api/dept/DeptApiImpl.java | 2 + .../module/system/api/dept/PostApiImpl.java | 2 + .../system/api/dict/DictDataApiImpl.java | 2 + .../api/logger/ApiAccessLogApiImpl.java | 13 +- .../api/logger/ApiErrorLogApiImpl.java | 13 +- .../system/api/logger/OperateLogApiImpl.java | 2 + .../system/api/oauth2/OAuth2TokenApiImpl.java | 8 +- .../api/permission/PermissionApiImpl.java | 7 +- .../system/api/user/AdminUserApiImpl.java | 39 +- .../api/websocket/WebSocketSenderApiImpl.java | 35 ++ .../controller/admin/auth/AuthController.java | 85 +++- .../admin/auth/vo/AuthLoginReqVO.java | 24 +- .../admin/auth/vo/AuthLoginRespVO.java | 0 .../admin/auth/vo/AuthMenuRespVO.java | 0 .../auth/vo/AuthPermissionInfoRespVO.java | 0 .../admin/auth/vo/AuthRegisterReqVO.java | 18 +- .../admin/auth/vo/AuthRouteMetaRespVO.java | 46 ++ .../admin/auth/vo/AuthRouteNodeRespVO.java | 42 ++ .../admin/auth/vo/AuthUserInfoRespVO.java | 31 ++ .../admin/auth/vo/AuthUserRouteRespVO.java | 24 ++ .../auth/vo/CaptchaVerificationReqVO.java | 0 .../admin/captcha/CaptchaController.java | 2 + .../admin/config/ConfigController.java | 33 +- .../admin/config/vo/ConfigPageReqVO.java | 2 +- .../admin/config/vo/ConfigRespVO.java | 8 +- .../admin/config/vo/ConfigSaveReqVO.java | 5 +- .../controller/admin/dept/DeptController.java | 0 .../dept/OrgLeaderRelationController.java | 101 +++++ .../controller/admin/dept/PostController.java | 0 .../admin/dept/vo/dept/DeptListReqVO.java | 3 + .../admin/dept/vo/dept/DeptRespVO.java | 27 +- .../admin/dept/vo/dept/DeptSaveReqVO.java | 25 +- .../admin/dept/vo/dept/DeptSimpleRespVO.java | 3 + .../vo/orgleader/OrgLeaderRelationRespVO.java | 39 ++ .../orgleader/OrgLeaderRelationSaveReqVO.java | 35 ++ .../admin/dept/vo/post/PostPageReqVO.java | 6 + .../admin/dept/vo/post/PostRespVO.java | 20 +- .../admin/dept/vo/post/PostSaveReqVO.java | 21 +- .../admin/dept/vo/post/PostSimpleRespVO.java | 12 + .../admin/dict/DictDataController.java | 0 .../admin/dict/DictTypeController.java | 1 + .../admin/dict/vo/data/DictDataPageReqVO.java | 0 .../admin/dict/vo/data/DictDataRespVO.java | 0 .../admin/dict/vo/data/DictDataSaveReqVO.java | 0 .../dict/vo/data/DictDataSimpleRespVO.java | 0 .../admin/dict/vo/type/DictTypePageReqVO.java | 9 + .../admin/dict/vo/type/DictTypeRespVO.java | 0 .../admin/dict/vo/type/DictTypeSaveReqVO.java | 0 .../dict/vo/type/DictTypeSimpleRespVO.java | 0 .../admin/file/FileConfigController.java | 31 +- .../controller/admin/file/FileController.java | 23 +- .../file/vo/config/FileConfigPageReqVO.java | 2 +- .../file/vo/config/FileConfigRespVO.java | 4 +- .../file/vo/config/FileConfigSaveReqVO.java | 4 +- .../admin/file/vo/file/FileCreateReqVO.java | 4 +- .../admin/file/vo/file/FilePageReqVO.java | 2 +- .../file/vo/file/FilePresignedUrlRespVO.java | 2 +- .../admin/file/vo/file/FileRespVO.java | 4 +- .../admin/file/vo/file/FileUploadReqVO.java | 2 +- .../controller/admin/ip/AreaController.java | 0 .../admin/ip/vo/AreaNodeRespVO.java | 0 .../admin/logger/ApiAccessLogController.java | 19 +- .../admin/logger/ApiErrorLogController.java | 21 +- .../admin/logger/LoginLogController.java | 0 .../admin/logger/OperateLogController.java | 0 .../apiaccesslog/ApiAccessLogPageReqVO.java | 2 +- .../vo/apiaccesslog/ApiAccessLogRespVO.java | 12 +- .../vo/apierrorlog/ApiErrorLogPageReqVO.java | 2 +- .../vo/apierrorlog/ApiErrorLogRespVO.java | 8 +- .../logger/vo/loginlog/LoginLogPageReqVO.java | 0 .../logger/vo/loginlog/LoginLogRespVO.java | 0 .../vo/operatelog/OperateLogPageReqVO.java | 0 .../vo/operatelog/OperateLogRespVO.java | 2 +- .../admin/notice/NoticeController.java | 8 +- .../admin/notice/vo/NoticePageReqVO.java | 0 .../admin/notice/vo/NoticeRespVO.java | 0 .../admin/notice/vo/NoticeSaveReqVO.java | 0 .../admin/notify/NotifyMessageController.java | 0 .../notify/NotifyTemplateController.java | 0 .../vo/message/NotifyMessageMyPageReqVO.java | 0 .../vo/message/NotifyMessagePageReqVO.java | 0 .../vo/message/NotifyMessageRespVO.java | 2 +- .../vo/template/NotifyTemplatePageReqVO.java | 0 .../vo/template/NotifyTemplateRespVO.java | 0 .../vo/template/NotifyTemplateSaveReqVO.java | 0 .../vo/template/NotifyTemplateSendReqVO.java | 0 .../admin/oauth2/OAuth2ClientController.java | 0 .../admin/oauth2/OAuth2OpenController.java | 0 .../admin/oauth2/OAuth2TokenController.java | 0 .../admin/oauth2/OAuth2UserController.java | 29 +- .../vo/client/OAuth2ClientPageReqVO.java | 0 .../oauth2/vo/client/OAuth2ClientRespVO.java | 0 .../vo/client/OAuth2ClientSaveReqVO.java | 0 .../vo/open/OAuth2OpenAccessTokenRespVO.java | 0 .../open/OAuth2OpenAuthorizeInfoRespVO.java | 0 .../vo/open/OAuth2OpenCheckTokenRespVO.java | 39 ++ .../vo/token/OAuth2AccessTokenPageReqVO.java | 0 .../vo/token/OAuth2AccessTokenRespVO.java | 0 .../oauth2/vo/user/OAuth2UserInfoRespVO.java | 9 +- .../oauth2/vo/user/OAuth2UserUpdateReqVO.java | 2 +- .../admin/permission/MenuController.java | 20 +- .../permission/PermissionController.java | 13 +- .../admin/permission/RoleController.java | 3 +- .../permission/vo/menu/MenuListReqVO.java | 0 .../admin/permission/vo/menu/MenuRespVO.java | 6 + .../admin/permission/vo/menu/MenuSaveVO.java | 7 + .../permission/vo/menu/MenuSimpleRespVO.java | 0 .../PermissionAssignRoleMenuReqVO.java | 0 .../PermissionAssignUserRoleReqVO.java | 0 .../permission/vo/role/RolePageReqVO.java | 0 .../admin/permission/vo/role/RoleRespVO.java | 9 - .../permission/vo/role/RoleSaveReqVO.java | 0 .../permission/vo/role/RoleSimpleRespVO.java | 0 .../admin/redis/RedisController.java | 13 +- .../admin/redis/vo/RedisMonitorRespVO.java | 2 +- .../controller/admin/user/UserController.java | 55 ++- .../admin/user/UserProfileController.java | 20 +- .../user/vo/profile/UserProfileRespVO.java | 8 +- .../UserProfileUpdatePasswordReqVO.java | 0 .../vo/profile/UserProfileUpdateReqVO.java | 2 +- .../admin/user/vo/user/UserImportExcelVO.java | 5 +- .../admin/user/vo/user/UserImportRespVO.java | 0 .../admin/user/vo/user/UserPageReqVO.java | 0 .../admin/user/vo/user/UserRespVO.java | 23 +- .../admin/user/vo/user/UserSaveReqVO.java | 35 +- .../admin/user/vo/user/UserSimpleRespVO.java | 0 .../user/vo/user/UserUpdatePasswordReqVO.java | 0 .../user/vo/user/UserUpdateStatusReqVO.java | 0 .../app/dict/AppDictDataController.java | 0 .../app/dict/vo/AppDictDataRespVO.java | 0 .../app/file/AppFileController.java | 13 +- .../app/file/vo/AppFileUploadReqVO.java | 4 +- .../controller/app/ip/AppAreaController.java | 0 .../app/ip/vo/AppAreaNodeRespVO.java | 0 .../system/controller/app/package-info.java | 0 .../system/controller/package-info.java | 0 .../system/convert/auth/AuthConvert.java | 395 ++++++++++++++++++ .../system}/convert/config/ConfigConvert.java | 8 +- .../convert/file/FileConfigConvert.java | 6 +- .../convert/oauth2/OAuth2OpenConvert.java | 0 .../module/system/convert/package-info.java | 0 .../system}/convert/redis/RedisConvert.java | 4 +- .../system/convert/user/UserConvert.java | 14 +- .../dal/dataobject/config/ConfigDO.java | 10 +- .../system/dal/dataobject/dept/DeptDO.java | 44 +- .../dataobject/dept/OrgLeaderRelationDO.java | 47 +++ .../system/dal/dataobject/dept/PostDO.java | 26 +- .../dal/dataobject/dict/DictDataDO.java | 4 +- .../dal/dataobject/dict/DictTypeDO.java | 6 +- .../dal/dataobject/file/FileConfigDO.java | 26 +- .../dal/dataobject/file/FileContentDO.java | 10 +- .../system}/dal/dataobject/file/FileDO.java | 12 +- .../dal/dataobject/logger/ApiAccessLogDO.java | 8 +- .../dal/dataobject/logger/ApiErrorLogDO.java | 10 +- .../dal/dataobject/logger/LoginLogDO.java | 4 +- .../dal/dataobject/logger/OperateLogDO.java | 2 - .../dal/dataobject/notice/NoticeDO.java | 6 +- .../dataobject/notify/NotifyMessageDO.java | 4 +- .../dataobject/notify/NotifyTemplateDO.java | 5 +- .../oauth2/OAuth2AccessTokenDO.java | 4 +- .../dataobject/oauth2/OAuth2ApproveDO.java | 2 - .../dal/dataobject/oauth2/OAuth2ClientDO.java | 3 +- .../dal/dataobject/oauth2/OAuth2CodeDO.java | 4 +- .../oauth2/OAuth2RefreshTokenDO.java | 6 +- .../dal/dataobject/permission/MenuDO.java | 13 +- .../dal/dataobject/permission/RoleDO.java | 23 +- .../dal/dataobject/permission/RoleMenuDO.java | 6 +- .../dal/dataobject/permission/UserRoleDO.java | 4 +- .../dal/dataobject/user/AdminUserDO.java | 45 +- .../dal/mysql/config/ConfigMapper.java | 6 +- .../system/dal/mysql/dept/DeptMapper.java | 9 +- .../mysql/dept/OrgLeaderRelationMapper.java | 26 ++ .../system/dal/mysql/dept/PostMapper.java | 2 + .../system/dal/mysql/dict/DictDataMapper.java | 0 .../system/dal/mysql/dict/DictTypeMapper.java | 21 +- .../dal/mysql/file/FileConfigMapper.java | 6 +- .../dal/mysql/file/FileContentMapper.java | 4 +- .../system}/dal/mysql/file/FileMapper.java | 6 +- .../dal/mysql/logger/ApiAccessLogMapper.java | 6 +- .../dal/mysql/logger/ApiErrorLogMapper.java | 6 +- .../dal/mysql/logger/LoginLogMapper.java | 0 .../dal/mysql/logger/OperateLogMapper.java | 0 .../system/dal/mysql/notice/NoticeMapper.java | 0 .../dal/mysql/notify/NotifyMessageMapper.java | 0 .../mysql/notify/NotifyTemplateMapper.java | 0 .../mysql/oauth2/OAuth2AccessTokenMapper.java | 0 .../dal/mysql/oauth2/OAuth2ApproveMapper.java | 0 .../dal/mysql/oauth2/OAuth2ClientMapper.java | 0 .../dal/mysql/oauth2/OAuth2CodeMapper.java | 0 .../oauth2/OAuth2RefreshTokenMapper.java | 0 .../module/system/dal/mysql/package-info.java | 0 .../dal/mysql/permission/MenuMapper.java | 0 .../dal/mysql/permission/RoleMapper.java | 20 +- .../dal/mysql/permission/RoleMenuMapper.java | 0 .../dal/mysql/permission/UserRoleMapper.java | 0 .../dal/mysql/user/AdminUserMapper.java | 4 + .../system/dal/redis/RedisKeyConstants.java | 30 ++ .../oauth2/OAuth2AccessTokenRedisDAO.java | 0 .../config/MsgpushCaptchaConfiguration.java | 0 .../core/PictureWordCaptchaServiceImpl.java | 0 .../captcha/core/RedisCaptchaServiceImpl.java | 0 .../framework/captcha/package-info.java | 0 .../config/MsgpushFileAutoConfiguration.java | 6 +- .../file/core/client/AbstractFileClient.java | 5 +- .../file/core/client/FileClient.java | 2 +- .../file/core/client/FileClientConfig.java | 2 +- .../file/core/client/FileClientFactory.java | 4 +- .../core/client/FileClientFactoryImpl.java | 4 +- .../file/core/client/db/DBFileClient.java | 8 +- .../core/client/db/DBFileClientConfig.java | 4 +- .../file/core/client/ftp/FtpFileClient.java | 4 +- .../core/client/ftp/FtpFileClientConfig.java | 4 +- .../core/client/local/LocalFileClient.java | 4 +- .../client/local/LocalFileClientConfig.java | 4 +- .../file/core/client/s3/S3FileClient.java | 4 +- .../core/client/s3/S3FileClientConfig.java | 9 +- .../file/core/client/sftp/SftpFileClient.java | 6 +- .../client/sftp/SftpFileClientConfig.java | 4 +- .../file/core/enums/FileStorageEnum.java | 55 +++ .../file/core/utils/FileTypeUtils.java | 3 +- .../system}/framework/file/package-info.java | 2 +- .../config/AdminServerConfiguration.java | 2 +- .../framework/monitor/package-info.java | 2 +- .../core/AdminUserParseFunction.java | 2 +- .../operatelog/core/AreaParseFunction.java | 2 +- .../operatelog/core/BooleanParseFunction.java | 4 +- .../operatelog/core/DeptParseFunction.java | 2 +- .../operatelog/core/PostParseFunction.java | 2 +- .../operatelog/core/SexParseFunction.java | 2 +- .../framework/operatelog/package-info.java | 0 .../module/system/framework/package-info.java | 0 .../rpc/config/RpcConfiguration.java | 7 +- .../system/framework/rpc/package-info.java | 0 .../config/SecurityConfiguration.java | 2 +- .../framework/security/core/package-info.java | 0 .../system/job/logger/AccessLogCleanJob.java | 35 ++ .../system/job/logger/ErrorLogCleanJob.java | 35 ++ .../module/system/job/package-info.java | 4 + .../system/service/auth/AdminAuthService.java | 15 +- .../service/auth/AdminAuthServiceImpl.java | 57 +-- .../system}/service/config/ConfigService.java | 8 +- .../service/config/ConfigServiceImpl.java | 18 +- .../system/service/dept/DeptService.java | 22 +- .../system/service/dept/DeptServiceImpl.java | 124 +++++- .../dept/OrgLeaderRelationService.java | 52 +++ .../dept/OrgLeaderRelationServiceImpl.java | 160 +++++++ .../system/service/dept/PostService.java | 26 +- .../system/service/dept/PostServiceImpl.java | 27 +- .../system/service/dict/DictDataService.java | 2 +- .../service/dict/DictDataServiceImpl.java | 2 +- .../system/service/dict/DictTypeService.java | 0 .../service/dict/DictTypeServiceImpl.java | 0 .../service/file/FileConfigService.java | 10 +- .../service/file/FileConfigServiceImpl.java | 28 +- .../system}/service/file/FileService.java | 10 +- .../system}/service/file/FileServiceImpl.java | 22 +- .../service/logger/ApiAccessLogService.java | 8 +- .../logger/ApiAccessLogServiceImpl.java | 15 +- .../service/logger/ApiErrorLogService.java | 8 +- .../logger/ApiErrorLogServiceImpl.java | 19 +- .../service/logger/LoginLogService.java | 2 +- .../service/logger/LoginLogServiceImpl.java | 2 +- .../service/logger/OperateLogService.java | 0 .../service/logger/OperateLogServiceImpl.java | 0 .../logger/dto/LoginLogCreateReqDTO.java | 12 +- .../system/service/member/MemberService.java | 0 .../service/member/MemberServiceImpl.java | 0 .../system/service/member/package-info.java | 0 .../system/service/notice/NoticeService.java | 0 .../service/notice/NoticeServiceImpl.java | 0 .../service/notify/NotifyMessageService.java | 2 +- .../notify/NotifyMessageServiceImpl.java | 2 +- .../service/notify/NotifySendService.java | 6 +- .../service/notify/NotifySendServiceImpl.java | 2 +- .../service/notify/NotifyTemplateService.java | 2 +- .../notify/NotifyTemplateServiceImpl.java | 2 +- .../service/oauth2/OAuth2ApproveService.java | 0 .../oauth2/OAuth2ApproveServiceImpl.java | 0 .../service/oauth2/OAuth2ClientService.java | 0 .../oauth2/OAuth2ClientServiceImpl.java | 0 .../service/oauth2/OAuth2CodeService.java | 0 .../service/oauth2/OAuth2CodeServiceImpl.java | 0 .../service/oauth2/OAuth2GrantService.java | 0 .../oauth2/OAuth2GrantServiceImpl.java | 0 .../service/oauth2/OAuth2TokenService.java | 0 .../oauth2/OAuth2TokenServiceImpl.java | 13 +- .../service/permission/MenuService.java | 41 ++ .../service/permission/MenuServiceImpl.java | 75 +++- .../service/permission/PermissionService.java | 23 +- .../permission/PermissionServiceImpl.java | 145 +++---- .../service/permission/RoleService.java | 10 - .../service/permission/RoleServiceImpl.java | 140 +++---- .../system/service/user/AdminUserService.java | 33 +- .../service/user/AdminUserServiceImpl.java | 230 +++++----- .../system/util/oauth2/OAuth2Utils.java | 0 .../module/system/util/package-info.java | 0 .../DemoWebSocketMessageListener.java | 6 +- .../websocket/message/DemoReceiveMessage.java | 2 +- .../websocket/message/DemoSendMessage.java | 2 +- .../src/main/resources/application-dev.yaml | 23 +- .../src/main/resources/application-local.yaml | 28 +- .../src/main/resources/application.yaml | 26 +- .../src/main/resources/file/erweima.jpg | Bin .../resources/images/jigsaw/original/bg1.png | Bin .../resources/images/jigsaw/original/bg2.png | Bin .../resources/images/jigsaw/original/bg3.png | Bin .../resources/images/jigsaw/original/bg4.png | Bin .../resources/images/jigsaw/original/bg5.png | Bin .../resources/images/jigsaw/original/bg6.png | Bin .../resources/images/jigsaw/original/bg7.png | Bin .../resources/images/jigsaw/original/bg8.png | Bin .../resources/images/jigsaw/original/bg9.png | Bin .../images/jigsaw/slidingBlock/1.png | Bin .../images/jigsaw/slidingBlock/11/10.png | Bin .../images/jigsaw/slidingBlock/11/11.png | Bin .../images/jigsaw/slidingBlock/11/12.png | Bin .../images/jigsaw/slidingBlock/11/13.png | Bin .../images/jigsaw/slidingBlock/11/14.png | Bin .../images/jigsaw/slidingBlock/11/15.png | Bin .../images/jigsaw/slidingBlock/11/16.png | Bin .../images/jigsaw/slidingBlock/11/17.png | Bin .../images/jigsaw/slidingBlock/11/18.png | Bin .../images/jigsaw/slidingBlock/11/19.png | Bin .../images/jigsaw/slidingBlock/11/8.png | Bin .../images/jigsaw/slidingBlock/11/9.png | Bin .../images/jigsaw/slidingBlock/2.png | Bin .../images/jigsaw/slidingBlock/3.png | Bin .../images/jigsaw/slidingBlock/4.png | Bin .../main/resources/images/pic-click/bg1.png | Bin .../main/resources/images/pic-click/bg10.png | Bin .../main/resources/images/pic-click/bg2.png | Bin .../main/resources/images/pic-click/bg3.png | Bin .../main/resources/images/pic-click/bg4.png | Bin .../main/resources/images/pic-click/bg5.png | Bin .../main/resources/images/pic-click/bg6.png | Bin .../main/resources/images/pic-click/bg7.png | Bin .../main/resources/images/pic-click/bg8.png | Bin .../main/resources/images/pic-click/bg9.png | Bin .../src/main/resources/logback-spring.xml | 10 - ...m.anji.captcha.service.CaptchaCacheService | 0 .../com.anji.captcha.service.CaptchaService | 0 msgpush-module-system/pom.xml | 6 - 369 files changed, 3790 insertions(+), 1195 deletions(-) rename msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/{infra => system}/logger/ApiAccessLogCommonApi.java (77%) rename msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/{infra => system}/logger/ApiErrorLogCommonApi.java (77%) rename msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/{infra => system}/logger/dto/ApiAccessLogCreateReqDTO.java (95%) rename msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/{infra => system}/logger/dto/ApiErrorLogCreateReqDTO.java (98%) create mode 100644 msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/factory/ProviderFactorySupport.java create mode 100644 msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/SendOutcome.java create mode 100644 msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/SendResult.java create mode 100644 msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/fallback/AbstractFixedResultSender.java create mode 100644 msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/fallback/FixedResultAppPushSender.java create mode 100644 msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/fallback/FixedResultEmailSender.java create mode 100644 msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/fallback/FixedResultSmsSender.java create mode 100644 msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/impl/apppush/UniPushAppPushSender.java create mode 100644 msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/impl/email/AliyunEmailSender.java create mode 100644 msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/impl/sms/AliyunSmsSender.java create mode 100644 msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/impl/sms/TelecomSmsSender.java rename {msgpush-module-infra/msgpush-module-infra-api/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system}/api/config/ConfigApi.java (78%) create mode 100644 msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/api/websocket/WebSocketSenderApi.java create mode 100644 msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/api/websocket/dto/WebSocketSendToUsersReqDTO.java rename {msgpush-module-infra/msgpush-module-infra-api/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system}/enums/config/ConfigTypeEnum.java (82%) create mode 100644 msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/enums/dept/DeptOrgTypeEnum.java create mode 100644 msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/enums/dept/PostTypeEnum.java rename {msgpush-module-infra/msgpush-module-infra-api/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system}/enums/logger/ApiErrorLogProcessStatusEnum.java (88%) create mode 100644 msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/enums/permission/MenuRouteKindEnum.java rename {msgpush-module-infra/msgpush-module-infra-server => msgpush-module-system/msgpush-module-system-boot}/pom.xml (78%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/SystemServerApplication.java (86%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/api/config/ConfigApiImpl.java (74%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/api/dept/DeptApiImpl.java (96%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/api/dept/PostApiImpl.java (95%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/api/dict/DictDataApiImpl.java (96%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/api/logger/ApiAccessLogApiImpl.java (67%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/api/logger/ApiErrorLogApiImpl.java (67%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/api/logger/OperateLogApiImpl.java (96%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/api/oauth2/OAuth2TokenApiImpl.java (97%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/api/permission/PermissionApiImpl.java (83%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/api/user/AdminUserApiImpl.java (55%) create mode 100644 msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/websocket/WebSocketSenderApiImpl.java rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/AuthController.java (64%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthLoginReqVO.java (57%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthLoginRespVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthMenuRespVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthPermissionInfoRespVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthRegisterReqVO.java (69%) create mode 100644 msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthRouteMetaRespVO.java create mode 100644 msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthRouteNodeRespVO.java create mode 100644 msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthUserInfoRespVO.java create mode 100644 msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthUserRouteRespVO.java rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/CaptchaVerificationReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/captcha/CaptchaController.java (99%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/controller/admin/config/ConfigController.java (80%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/controller/admin/config/vo/ConfigPageReqVO.java (93%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/controller/admin/config/vo/ConfigRespVO.java (94%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/controller/admin/config/vo/ConfigSaveReqVO.java (96%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/DeptController.java (100%) create mode 100644 msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/OrgLeaderRelationController.java rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/PostController.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptListReqVO.java (83%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptRespVO.java (58%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptSaveReqVO.java (64%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptSimpleRespVO.java (88%) create mode 100644 msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/orgleader/OrgLeaderRelationRespVO.java create mode 100644 msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/orgleader/OrgLeaderRelationSaveReqVO.java rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostPageReqVO.java (79%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostRespVO.java (77%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostSaveReqVO.java (66%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostSimpleRespVO.java (64%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/DictDataController.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/DictTypeController.java (98%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/data/DictDataPageReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/data/DictDataRespVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/data/DictDataSaveReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/data/DictDataSimpleRespVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/type/DictTypePageReqVO.java (77%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/type/DictTypeRespVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/type/DictTypeSaveReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/type/DictTypeSimpleRespVO.java (100%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/controller/admin/file/FileConfigController.java (76%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/controller/admin/file/FileController.java (89%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/controller/admin/file/vo/config/FileConfigPageReqVO.java (92%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/controller/admin/file/vo/config/FileConfigRespVO.java (87%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/controller/admin/file/vo/config/FileConfigSaveReqVO.java (93%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/controller/admin/file/vo/file/FileCreateReqVO.java (92%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/controller/admin/file/vo/file/FilePageReqVO.java (92%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/controller/admin/file/vo/file/FilePresignedUrlRespVO.java (95%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/controller/admin/file/vo/file/FileRespVO.java (93%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/controller/admin/file/vo/file/FileUploadReqVO.java (94%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/ip/AreaController.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/ip/vo/AreaNodeRespVO.java (100%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/controller/admin/logger/ApiAccessLogController.java (81%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/controller/admin/logger/ApiErrorLogController.java (82%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/LoginLogController.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/OperateLogController.java (100%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/controller/admin/logger/vo/apiaccesslog/ApiAccessLogPageReqVO.java (94%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/controller/admin/logger/vo/apiaccesslog/ApiAccessLogRespVO.java (92%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/controller/admin/logger/vo/apierrorlog/ApiErrorLogPageReqVO.java (93%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/controller/admin/logger/vo/apierrorlog/ApiErrorLogRespVO.java (97%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/loginlog/LoginLogPageReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/loginlog/LoginLogRespVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/operatelog/OperateLogPageReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/operatelog/OperateLogRespVO.java (98%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/notice/NoticeController.java (94%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/notice/vo/NoticePageReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/notice/vo/NoticeRespVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/notice/vo/NoticeSaveReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/NotifyMessageController.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/NotifyTemplateController.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/message/NotifyMessageMyPageReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/message/NotifyMessagePageReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/message/NotifyMessageRespVO.java (97%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/template/NotifyTemplatePageReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/template/NotifyTemplateRespVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/template/NotifyTemplateSaveReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/template/NotifyTemplateSendReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/OAuth2ClientController.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/OAuth2OpenController.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/OAuth2TokenController.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/OAuth2UserController.java (79%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/client/OAuth2ClientPageReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/client/OAuth2ClientRespVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/client/OAuth2ClientSaveReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/open/OAuth2OpenAccessTokenRespVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/open/OAuth2OpenAuthorizeInfoRespVO.java (100%) create mode 100644 msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/open/OAuth2OpenCheckTokenRespVO.java rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/token/OAuth2AccessTokenPageReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/token/OAuth2AccessTokenRespVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/user/OAuth2UserInfoRespVO.java (94%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/user/OAuth2UserUpdateReqVO.java (96%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/MenuController.java (76%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/PermissionController.java (81%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/RoleController.java (98%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/menu/MenuListReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/menu/MenuRespVO.java (91%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/menu/MenuSaveVO.java (88%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/menu/MenuSimpleRespVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/permission/PermissionAssignRoleMenuReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/permission/PermissionAssignUserRoleReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/role/RolePageReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/role/RoleRespVO.java (82%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/role/RoleSaveReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/role/RoleSimpleRespVO.java (100%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/controller/admin/redis/RedisController.java (83%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/controller/admin/redis/vo/RedisMonitorRespVO.java (95%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/UserController.java (73%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/UserProfileController.java (78%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/profile/UserProfileRespVO.java (94%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/profile/UserProfileUpdatePasswordReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/profile/UserProfileUpdateReqVO.java (95%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserImportExcelVO.java (94%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserImportRespVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserPageReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserRespVO.java (85%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserSaveReqVO.java (69%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserSimpleRespVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserUpdatePasswordReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserUpdateStatusReqVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/app/dict/AppDictDataController.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/app/dict/vo/AppDictDataRespVO.java (100%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/controller/app/file/AppFileController.java (85%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/controller/app/file/vo/AppFileUploadReqVO.java (84%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/app/ip/AppAreaController.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/app/ip/vo/AppAreaNodeRespVO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/app/package-info.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/controller/package-info.java (100%) create mode 100644 msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/convert/auth/AuthConvert.java rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/convert/config/ConfigConvert.java (68%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/convert/file/FileConfigConvert.java (63%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/convert/oauth2/OAuth2OpenConvert.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/convert/package-info.java (100%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/convert/redis/RedisConvert.java (87%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/convert/user/UserConvert.java (84%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/dal/dataobject/config/ConfigDO.java (78%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dept/DeptDO.java (62%) create mode 100644 msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dept/OrgLeaderRelationDO.java rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dept/PostDO.java (78%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dict/DictDataDO.java (87%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dict/DictTypeDO.java (81%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/dal/dataobject/file/FileConfigDO.java (77%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/dal/dataobject/file/FileContentDO.java (69%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/dal/dataobject/file/FileDO.java (76%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/dal/dataobject/logger/ApiAccessLogDO.java (94%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/dal/dataobject/logger/ApiErrorLogDO.java (93%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/logger/LoginLogDO.java (87%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/logger/OperateLogDO.java (89%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/notice/NoticeDO.java (79%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/notify/NotifyMessageDO.java (90%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/notify/NotifyTemplateDO.java (85%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2AccessTokenDO.java (88%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2ApproveDO.java (85%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2ClientDO.java (92%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2CodeDO.java (86%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2RefreshTokenDO.java (85%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/MenuDO.java (92%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/RoleDO.java (58%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/RoleMenuDO.java (73%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/UserRoleDO.java (73%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/user/AdminUserDO.java (79%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/dal/mysql/config/ConfigMapper.java (81%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dept/DeptMapper.java (77%) create mode 100644 msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dept/OrgLeaderRelationMapper.java rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dept/PostMapper.java (90%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dict/DictDataMapper.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dict/DictTypeMapper.java (58%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/dal/mysql/file/FileConfigMapper.java (80%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/dal/mysql/file/FileContentMapper.java (86%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/dal/mysql/file/FileMapper.java (78%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/dal/mysql/logger/ApiAccessLogMapper.java (88%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/dal/mysql/logger/ApiErrorLogMapper.java (87%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/mysql/logger/LoginLogMapper.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/mysql/logger/OperateLogMapper.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/mysql/notice/NoticeMapper.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/mysql/notify/NotifyMessageMapper.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/mysql/notify/NotifyTemplateMapper.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2AccessTokenMapper.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2ApproveMapper.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2ClientMapper.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2CodeMapper.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2RefreshTokenMapper.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/mysql/package-info.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/mysql/permission/MenuMapper.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/mysql/permission/RoleMapper.java (60%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/mysql/permission/RoleMenuMapper.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/mysql/permission/UserRoleMapper.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/mysql/user/AdminUserMapper.java (92%) create mode 100644 msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/redis/RedisKeyConstants.java rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/dal/redis/oauth2/OAuth2AccessTokenRedisDAO.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/framework/captcha/config/MsgpushCaptchaConfiguration.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/framework/captcha/core/PictureWordCaptchaServiceImpl.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/framework/captcha/core/RedisCaptchaServiceImpl.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/framework/captcha/package-info.java (100%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/framework/file/config/MsgpushFileAutoConfiguration.java (60%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/framework/file/core/client/AbstractFileClient.java (91%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/framework/file/core/client/FileClient.java (95%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/framework/file/core/client/FileClientConfig.java (87%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/framework/file/core/client/FileClientFactory.java (77%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/framework/file/core/client/FileClientFactoryImpl.java (92%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/framework/file/core/client/db/DBFileClient.java (82%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/framework/file/core/client/db/DBFileClientConfig.java (73%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/framework/file/core/client/ftp/FtpFileClient.java (94%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/framework/file/core/client/ftp/FtpFileClientConfig.java (88%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/framework/file/core/client/local/LocalFileClient.java (89%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/framework/file/core/client/local/LocalFileClientConfig.java (77%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/framework/file/core/client/s3/S3FileClient.java (98%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/framework/file/core/client/s3/S3FileClientConfig.java (96%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/framework/file/core/client/sftp/SftpFileClient.java (94%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/framework/file/core/client/sftp/SftpFileClientConfig.java (86%) create mode 100644 msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/enums/FileStorageEnum.java rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/framework/file/core/utils/FileTypeUtils.java (96%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/framework/file/package-info.java (84%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/framework/monitor/config/AdminServerConfiguration.java (98%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/framework/monitor/package-info.java (52%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/AdminUserParseFunction.java (98%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/AreaParseFunction.java (97%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/BooleanParseFunction.java (91%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/DeptParseFunction.java (98%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/PostParseFunction.java (98%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/SexParseFunction.java (97%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/package-info.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/framework/package-info.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/framework/rpc/config/RpcConfiguration.java (51%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/framework/rpc/package-info.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/framework/security/config/SecurityConfiguration.java (94%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/framework/security/core/package-info.java (100%) create mode 100644 msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/job/logger/AccessLogCleanJob.java create mode 100644 msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/job/logger/ErrorLogCleanJob.java create mode 100644 msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/job/package-info.java rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/auth/AdminAuthService.java (77%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/auth/AdminAuthServiceImpl.java (87%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/service/config/ConfigService.java (81%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/service/config/ConfigServiceImpl.java (85%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/dept/DeptService.java (86%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/dept/DeptServiceImpl.java (64%) create mode 100644 msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dept/OrgLeaderRelationService.java create mode 100644 msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dept/OrgLeaderRelationServiceImpl.java rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/dept/PostService.java (73%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/dept/PostServiceImpl.java (85%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/dict/DictDataService.java (99%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/dict/DictDataServiceImpl.java (99%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/dict/DictTypeService.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/dict/DictTypeServiceImpl.java (100%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/service/file/FileConfigService.java (82%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/service/file/FileConfigServiceImpl.java (86%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/service/file/FileService.java (84%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/service/file/FileServiceImpl.java (89%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/service/logger/ApiAccessLogService.java (74%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/service/logger/ApiAccessLogServiceImpl.java (76%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/service/logger/ApiErrorLogService.java (79%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/service/logger/ApiErrorLogServiceImpl.java (76%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/logger/LoginLogService.java (91%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/logger/LoginLogServiceImpl.java (93%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/logger/OperateLogService.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/logger/OperateLogServiceImpl.java (100%) rename msgpush-module-system/{msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/api => msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service}/logger/dto/LoginLogCreateReqDTO.java (85%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/member/MemberService.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/member/MemberServiceImpl.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/member/package-info.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/notice/NoticeService.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/notice/NoticeServiceImpl.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyMessageService.java (99%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyMessageServiceImpl.java (99%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifySendService.java (93%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifySendServiceImpl.java (99%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyTemplateService.java (99%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyTemplateServiceImpl.java (99%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2ApproveService.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2ApproveServiceImpl.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2ClientService.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2ClientServiceImpl.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2CodeService.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2CodeServiceImpl.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2GrantService.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2GrantServiceImpl.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2TokenService.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2TokenServiceImpl.java (95%) create mode 100644 msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/permission/MenuService.java rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/permission/MenuServiceImpl.java (79%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/permission/PermissionService.java (80%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/permission/PermissionServiceImpl.java (73%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/permission/RoleService.java (90%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/permission/RoleServiceImpl.java (70%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/user/AdminUserService.java (88%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/service/user/AdminUserServiceImpl.java (72%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/util/oauth2/OAuth2Utils.java (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/java/com/njcn/msgpush/module/system/util/package-info.java (100%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/websocket/DemoWebSocketMessageListener.java (90%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/websocket/message/DemoReceiveMessage.java (85%) rename {msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra => msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system}/websocket/message/DemoSendMessage.java (84%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/application-dev.yaml (83%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/application-local.yaml (81%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/application.yaml (62%) rename {msgpush-module-infra/msgpush-module-infra-server => msgpush-module-system/msgpush-module-system-boot}/src/main/resources/file/erweima.jpg (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/original/bg1.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/original/bg2.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/original/bg3.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/original/bg4.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/original/bg5.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/original/bg6.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/original/bg7.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/original/bg8.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/original/bg9.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/slidingBlock/1.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/slidingBlock/11/10.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/slidingBlock/11/11.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/slidingBlock/11/12.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/slidingBlock/11/13.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/slidingBlock/11/14.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/slidingBlock/11/15.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/slidingBlock/11/16.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/slidingBlock/11/17.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/slidingBlock/11/18.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/slidingBlock/11/19.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/slidingBlock/11/8.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/slidingBlock/11/9.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/slidingBlock/2.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/slidingBlock/3.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/jigsaw/slidingBlock/4.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/pic-click/bg1.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/pic-click/bg10.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/pic-click/bg2.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/pic-click/bg3.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/pic-click/bg4.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/pic-click/bg5.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/pic-click/bg6.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/pic-click/bg7.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/pic-click/bg8.png (100%) rename msgpush-module-system/{msgpush-module-system-server => msgpush-module-system-boot}/src/main/resources/images/pic-click/bg9.png (100%) rename {msgpush-module-infra/msgpush-module-infra-server => msgpush-module-system/msgpush-module-system-boot}/src/main/resources/logback-spring.xml (83%) rename msgpush-module-system/{msgpush-module-system-server/src/main/resources/META-INF => msgpush-module-system-boot/src/main/resources}/services/com.anji.captcha.service.CaptchaCacheService (100%) rename msgpush-module-system/{msgpush-module-system-server/src/main/resources/META-INF => msgpush-module-system-boot/src/main/resources}/services/com.anji.captcha.service.CaptchaService (100%) diff --git a/msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/infra/logger/ApiAccessLogCommonApi.java b/msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/system/logger/ApiAccessLogCommonApi.java similarity index 77% rename from msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/infra/logger/ApiAccessLogCommonApi.java rename to msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/system/logger/ApiAccessLogCommonApi.java index 3acf1df..fe04282 100644 --- a/msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/infra/logger/ApiAccessLogCommonApi.java +++ b/msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/system/logger/ApiAccessLogCommonApi.java @@ -1,6 +1,6 @@ -package com.njcn.msgpush.framework.common.biz.infra.logger; +package com.njcn.msgpush.framework.common.biz.system.logger; -import com.njcn.msgpush.framework.common.biz.infra.logger.dto.ApiAccessLogCreateReqDTO; +import com.njcn.msgpush.framework.common.biz.system.logger.dto.ApiAccessLogCreateReqDTO; import com.njcn.msgpush.framework.common.enums.RpcConstants; import com.njcn.msgpush.framework.common.pojo.CommonResult; import io.swagger.v3.oas.annotations.Operation; @@ -11,11 +11,11 @@ import org.springframework.scheduling.annotation.Async; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; -@FeignClient(name = RpcConstants.INFRA_NAME) // TODO 芋艿:fallbackFactory = +@FeignClient(name = RpcConstants.SYSTEM_NAME) @Tag(name = "RPC 服务 - API 访问日志") public interface ApiAccessLogCommonApi { - String PREFIX = RpcConstants.INFRA_PREFIX + "/api-access-log"; + String PREFIX = RpcConstants.SYSTEM_PREFIX + "/api-access-log"; @PostMapping(PREFIX + "/create") @Operation(summary = "创建 API 访问日志") diff --git a/msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/infra/logger/ApiErrorLogCommonApi.java b/msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/system/logger/ApiErrorLogCommonApi.java similarity index 77% rename from msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/infra/logger/ApiErrorLogCommonApi.java rename to msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/system/logger/ApiErrorLogCommonApi.java index 742b0db..7fef050 100644 --- a/msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/infra/logger/ApiErrorLogCommonApi.java +++ b/msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/system/logger/ApiErrorLogCommonApi.java @@ -1,6 +1,6 @@ -package com.njcn.msgpush.framework.common.biz.infra.logger; +package com.njcn.msgpush.framework.common.biz.system.logger; -import com.njcn.msgpush.framework.common.biz.infra.logger.dto.ApiErrorLogCreateReqDTO; +import com.njcn.msgpush.framework.common.biz.system.logger.dto.ApiErrorLogCreateReqDTO; import com.njcn.msgpush.framework.common.enums.RpcConstants; import com.njcn.msgpush.framework.common.pojo.CommonResult; import io.swagger.v3.oas.annotations.Operation; @@ -11,11 +11,11 @@ import org.springframework.scheduling.annotation.Async; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; -@FeignClient(name = RpcConstants.INFRA_NAME) // TODO 芋艿:fallbackFactory = +@FeignClient(name = RpcConstants.SYSTEM_NAME) @Tag(name = "RPC 服务 - API 异常日志") public interface ApiErrorLogCommonApi { - String PREFIX = RpcConstants.INFRA_PREFIX + "/api-error-log"; + String PREFIX = RpcConstants.SYSTEM_PREFIX + "/api-error-log"; @PostMapping(PREFIX + "/create") @Operation(summary = "创建 API 异常日志") diff --git a/msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/infra/logger/dto/ApiAccessLogCreateReqDTO.java b/msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/system/logger/dto/ApiAccessLogCreateReqDTO.java similarity index 95% rename from msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/infra/logger/dto/ApiAccessLogCreateReqDTO.java rename to msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/system/logger/dto/ApiAccessLogCreateReqDTO.java index 37511ed..33377a0 100644 --- a/msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/infra/logger/dto/ApiAccessLogCreateReqDTO.java +++ b/msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/system/logger/dto/ApiAccessLogCreateReqDTO.java @@ -1,7 +1,8 @@ -package com.njcn.msgpush.framework.common.biz.infra.logger.dto; +package com.njcn.msgpush.framework.common.biz.system.logger.dto; import jakarta.validation.constraints.NotNull; import lombok.Data; +import lombok.experimental.Accessors; import java.time.LocalDateTime; diff --git a/msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/infra/logger/dto/ApiErrorLogCreateReqDTO.java b/msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/system/logger/dto/ApiErrorLogCreateReqDTO.java similarity index 98% rename from msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/infra/logger/dto/ApiErrorLogCreateReqDTO.java rename to msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/system/logger/dto/ApiErrorLogCreateReqDTO.java index 5c45aea..8fd15ac 100644 --- a/msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/infra/logger/dto/ApiErrorLogCreateReqDTO.java +++ b/msgpush-framework/msgpush-common/src/main/java/com/njcn/msgpush/framework/common/biz/system/logger/dto/ApiErrorLogCreateReqDTO.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.framework.common.biz.infra.logger.dto; +package com.njcn.msgpush.framework.common.biz.system.logger.dto; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; diff --git a/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/factory/ProviderFactorySupport.java b/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/factory/ProviderFactorySupport.java new file mode 100644 index 0000000..8f506ad --- /dev/null +++ b/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/factory/ProviderFactorySupport.java @@ -0,0 +1,27 @@ +package com.njcn.msgpush.module.push.client.factory; + +import cn.hutool.core.util.StrUtil; + +/** + * 工厂侧通用辅助方法。 + */ +public final class ProviderFactorySupport { + + private ProviderFactorySupport() { + } + + /** + * 只要任一配置值为空白,就认为当前渠道配置不完整。 + */ + public static boolean hasBlank(String... values) { + if (values == null || values.length == 0) { + return true; + } + for (String value : values) { + if (StrUtil.isBlank(value)) { + return true; + } + } + return false; + } +} diff --git a/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/SendOutcome.java b/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/SendOutcome.java new file mode 100644 index 0000000..c471ef8 --- /dev/null +++ b/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/SendOutcome.java @@ -0,0 +1,21 @@ +package com.njcn.msgpush.module.push.client.sender; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 发送结果大类。 + * 这里只描述“主流程该怎么走”,不承载第三方原始错误细节。 + */ +@Getter +@AllArgsConstructor +public enum SendOutcome { + SUCCESS("发送成功"), + ACCEPTED("第三方已受理"), + FAILED("发送失败"), + RETRYABLE_FAILED("发送失败,可重试"), + UNSUPPORTED_CHANNEL("当前服务商不支持该发送渠道"), + CONFIG_INVALID("当前服务商渠道配置不完整"); + + private final String desc; +} diff --git a/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/SendResult.java b/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/SendResult.java new file mode 100644 index 0000000..5217b5d --- /dev/null +++ b/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/SendResult.java @@ -0,0 +1,109 @@ +package com.njcn.msgpush.module.push.client.sender; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; + +/** + * 统一发送结果。 + * outcome 负责主流程分支判断; + * errorCode/message 负责平台内部归类和中文展示; + * retryable 负责决定是否进入重试队列。 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SendResult { + + /** + * 结果分类,供主流程分支判断使用。 + */ + private SendOutcome outcome; + + /** + * 平台统一错误码。 + */ + private String errorCode; + + /** + * 中文错误说明。 + */ + private String message; + + /** + * 服务商原始错误码。 + */ + private String providerRawCode; + + /** + * 是否允许进入重试队列。 + */ + private boolean retryable; + + /** + * 第三方消息 ID。 + */ + private String thirdPartyId; + + /** + * 发送时间。 + */ + private LocalDateTime sendTime; + + /** + * 耗时,单位毫秒。 + */ + private Integer costTime; + + /** + * 第三方已明确返回成功。 + */ + public static SendResult success(LocalDateTime sendTime, Integer costTime, String thirdPartyId) { + return SendResult.builder() + .outcome(SendOutcome.SUCCESS) + .sendTime(sendTime) + .costTime(costTime) + .thirdPartyId(thirdPartyId) + .build(); + } + + /** + * 第三方已受理,请等待异步回执或延迟查询更新最终状态。 + */ + public static SendResult accepted(LocalDateTime sendTime, Integer costTime, String thirdPartyId) { + return SendResult.builder() + .outcome(SendOutcome.ACCEPTED) + .sendTime(sendTime) + .costTime(costTime) + .thirdPartyId(thirdPartyId) + .build(); + } + + /** + * 服务商不支持该渠道能力。 + */ + public static SendResult unsupported(String message) { + return SendResult.builder() + .outcome(SendOutcome.UNSUPPORTED_CHANNEL) + .errorCode("UNSUPPORTED_CHANNEL") + .message(message) + .retryable(false) + .build(); + } + + /** + * 服务商理论支持该能力,但当前配置不完整或初始化失败。 + */ + public static SendResult configInvalid(String message) { + return SendResult.builder() + .outcome(SendOutcome.CONFIG_INVALID) + .errorCode("CONFIG_INVALID") + .message(message) + .retryable(false) + .build(); + } +} diff --git a/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/fallback/AbstractFixedResultSender.java b/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/fallback/AbstractFixedResultSender.java new file mode 100644 index 0000000..55e3308 --- /dev/null +++ b/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/fallback/AbstractFixedResultSender.java @@ -0,0 +1,30 @@ +package com.njcn.msgpush.module.push.client.sender.fallback; + +import com.njcn.msgpush.module.push.client.sender.SendOutcome; +import com.njcn.msgpush.module.push.client.sender.SendResult; + +/** + * 用于承载“发送前即可确定”的固定结果。 + * 例如:当前服务商不支持该渠道,或当前渠道配置不完整。 + */ +public abstract class AbstractFixedResultSender { + + private final SendOutcome outcome; + + private final String message; + + protected AbstractFixedResultSender(SendOutcome outcome, String message) { + if (!SendOutcome.UNSUPPORTED_CHANNEL.equals(outcome) && !SendOutcome.CONFIG_INVALID.equals(outcome)) { + throw new IllegalArgumentException("固定结果 sender 仅支持不支持渠道或配置无效场景"); + } + this.outcome = outcome; + this.message = message; + } + + protected SendResult buildResult() { + if (SendOutcome.UNSUPPORTED_CHANNEL.equals(outcome)) { + return SendResult.unsupported(message); + } + return SendResult.configInvalid(message); + } +} diff --git a/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/fallback/FixedResultAppPushSender.java b/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/fallback/FixedResultAppPushSender.java new file mode 100644 index 0000000..9bba2b8 --- /dev/null +++ b/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/fallback/FixedResultAppPushSender.java @@ -0,0 +1,21 @@ +package com.njcn.msgpush.module.push.client.sender.fallback; + +import com.njcn.msgpush.module.push.client.sender.AppPushSender; +import com.njcn.msgpush.module.push.client.sender.SendOutcome; +import com.njcn.msgpush.module.push.client.sender.SendResult; +import com.njcn.msgpush.module.push.dal.dataobject.message.MessageRecordDO; + +/** + * APP 推送渠道固定结果 sender。 + */ +public class FixedResultAppPushSender extends AbstractFixedResultSender implements AppPushSender { + + public FixedResultAppPushSender(SendOutcome outcome, String message) { + super(outcome, message); + } + + @Override + public SendResult appPush(MessageRecordDO messageRecord) { + return this.buildResult(); + } +} diff --git a/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/fallback/FixedResultEmailSender.java b/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/fallback/FixedResultEmailSender.java new file mode 100644 index 0000000..a127191 --- /dev/null +++ b/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/fallback/FixedResultEmailSender.java @@ -0,0 +1,23 @@ +package com.njcn.msgpush.module.push.client.sender.fallback; + +import com.njcn.msgpush.module.push.client.sender.EmailSender; +import com.njcn.msgpush.module.push.client.sender.SendOutcome; +import com.njcn.msgpush.module.push.client.sender.SendResult; +import com.njcn.msgpush.module.push.dal.dataobject.message.MessageRecordDO; + +import java.util.Map; + +/** + * 邮件渠道固定结果 sender。 + */ +public class FixedResultEmailSender extends AbstractFixedResultSender implements EmailSender { + + public FixedResultEmailSender(SendOutcome outcome, String message) { + super(outcome, message); + } + + @Override + public SendResult sendEmail(MessageRecordDO messageRecord, Map params) { + return this.buildResult(); + } +} diff --git a/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/fallback/FixedResultSmsSender.java b/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/fallback/FixedResultSmsSender.java new file mode 100644 index 0000000..c2a1c4e --- /dev/null +++ b/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/fallback/FixedResultSmsSender.java @@ -0,0 +1,39 @@ +package com.njcn.msgpush.module.push.client.sender.fallback; + +import com.njcn.msgpush.module.push.client.sender.SendOutcome; +import com.njcn.msgpush.module.push.client.sender.SendResult; +import com.njcn.msgpush.module.push.client.sender.SmsSender; +import com.njcn.msgpush.module.push.dal.dataobject.message.MessageRecordDO; + +import java.util.ArrayList; +import java.util.List; + +/** + * 短信渠道固定结果 sender。 + * 用于替代返回 null,让主流程始终拿到可执行对象。 + */ +public class FixedResultSmsSender extends AbstractFixedResultSender implements SmsSender { + + public FixedResultSmsSender(SendOutcome outcome, String message) { + super(outcome, message); + } + + @Override + public SendResult sendSms(MessageRecordDO messageRecord) { + return this.buildResult(); + } + + @Override + public List sendBatchSms(List messageList) { + List results = new ArrayList<>(messageList.size()); + for (int i = 0; i < messageList.size(); i++) { + results.add(this.buildResult()); + } + return results; + } + + @Override + public void queryTemplate(String templateIdentifier) { + // 固定结果 sender 不触达第三方,无需查询模板。 + } +} diff --git a/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/impl/apppush/UniPushAppPushSender.java b/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/impl/apppush/UniPushAppPushSender.java new file mode 100644 index 0000000..4585edb --- /dev/null +++ b/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/impl/apppush/UniPushAppPushSender.java @@ -0,0 +1,101 @@ +package com.njcn.msgpush.module.push.client.sender.impl.apppush; + +import com.getui.push.v2.sdk.ApiHelper; +import com.getui.push.v2.sdk.GtApiConfiguration; +import com.getui.push.v2.sdk.api.PushApi; +import com.getui.push.v2.sdk.common.ApiResult; +import com.getui.push.v2.sdk.dto.req.Audience; +import com.getui.push.v2.sdk.dto.req.Settings; +import com.getui.push.v2.sdk.dto.req.message.PushDTO; +import com.getui.push.v2.sdk.dto.req.message.PushMessage; +import com.getui.push.v2.sdk.dto.req.message.android.GTNotification; +import com.njcn.msgpush.module.push.client.sender.AppPushSender; +import com.njcn.msgpush.module.push.client.sender.SendResult; +import com.njcn.msgpush.module.push.client.sender.Sender; +import com.njcn.msgpush.module.push.client.setting.impl.UniPushAppPushSetting; +import com.njcn.msgpush.module.push.dal.dataobject.message.MessageRecordDO; +import lombok.extern.slf4j.Slf4j; + +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.Map; + +@Slf4j +public class UniPushAppPushSender implements AppPushSender { + + private final Sender sender; + + private PushApi pushApi; + + public UniPushAppPushSender(UniPushAppPushSetting uniPushAppPushSetting, Sender sender) { + this.sender = sender; + try { + GtApiConfiguration gtApiConfiguration = new GtApiConfiguration(); + gtApiConfiguration.setAppId(uniPushAppPushSetting.getAppId()); + gtApiConfiguration.setAppKey(uniPushAppPushSetting.getAppKey()); + gtApiConfiguration.setMasterSecret(uniPushAppPushSetting.getMasterSecret()); + gtApiConfiguration.setDomain("https://restapi.getui.com/v2/"); + ApiHelper apiHelper = ApiHelper.build(gtApiConfiguration); + this.pushApi = apiHelper.creatApi(PushApi.class); + } catch (Exception e) { + log.error("UniPush 客户端初始化失败", e); + this.pushApi = null; + } + } + + @Override + public SendResult appPush(MessageRecordDO message) { + if (pushApi == null) { + return SendResult.configInvalid("当前服务商 APP 推送渠道初始化失败"); + } + try { + LocalDateTime now = LocalDateTime.now(); + long start = now.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli(); + PushDTO pushDTO = this.buildPushDTO(message.getTitle(), message.getContent()); + Audience audience = new Audience(); + audience.addCid(message.getReceiver()); + pushDTO.setAudience(audience); + + ApiResult>> apiResult = pushApi.pushToSingleByCid(pushDTO); + LocalDateTime end = LocalDateTime.now(); + int costTime = (int) (end.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli() - start); + message.setSendTime(now); + message.setCostTime(costTime); + + if (apiResult.isSuccess()) { + // UniPush 同步接口返回成功时,当前平台将其视为已受理。 + return SendResult.accepted(now, costTime, null); + } + // 个推原始错误码在这里统一映射为平台错误码和中文错误信息。 + return this.sender.buildFailureResult( + message, + String.valueOf(apiResult.getCode()), + apiResult.getMsg(), + "THIRD_PARTY_CALL_FAILED", + "第三方服务调用失败", + false + ); + } catch (Exception e) { + log.error("UniPush 推送失败", e); + return this.sender.buildCallFailedResult("第三方服务调用失败"); + } + } + + private PushDTO buildPushDTO(String title, String content) { + PushDTO pushDTO = new PushDTO<>(); + pushDTO.setRequestId(String.valueOf(System.currentTimeMillis())); + + Settings settings = new Settings(); + settings.setTtl(3600000); + pushDTO.setSettings(settings); + + PushMessage pushMessage = new PushMessage(); + GTNotification notification = new GTNotification(); + notification.setTitle(title); + notification.setBody(content); + notification.setClickType("startapp"); + pushMessage.setNotification(notification); + pushDTO.setPushMessage(pushMessage); + return pushDTO; + } +} diff --git a/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/impl/email/AliyunEmailSender.java b/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/impl/email/AliyunEmailSender.java new file mode 100644 index 0000000..8f631d8 --- /dev/null +++ b/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/impl/email/AliyunEmailSender.java @@ -0,0 +1,110 @@ +package com.njcn.msgpush.module.push.client.sender.impl.email; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.aliyun.dm20151123.Client; +import com.aliyun.dm20151123.models.SingleSendMailRequest; +import com.aliyun.dm20151123.models.SingleSendMailResponse; +import com.aliyun.teaopenapi.models.Config; +import com.aliyun.teautil.models.RuntimeOptions; +import com.njcn.msgpush.module.push.client.sender.EmailSender; +import com.njcn.msgpush.module.push.client.sender.SendResult; +import com.njcn.msgpush.module.push.client.sender.Sender; +import com.njcn.msgpush.module.push.client.setting.impl.AliYunMailSetting; +import com.njcn.msgpush.module.push.dal.dataobject.message.MessageRecordDO; +import lombok.extern.slf4j.Slf4j; +import org.springframework.http.HttpStatus; + +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.Map; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; + +@Slf4j +public class AliyunEmailSender implements EmailSender { + + private static final String ACCOUNT_NAME = "accountName"; + private static final String REPLY_TO_ADDRESS = "replyToAddress"; + private static final String FROM_ALIAS = "fromAlias"; + + private final Sender sender; + + private Client emailClient; + + public AliyunEmailSender(AliYunMailSetting aliYunMailSetting, Sender sender) { + this.sender = sender; + if (ObjectUtil.isNotNull(aliYunMailSetting)) { + Config config = new Config() + .setAccessKeyId(aliYunMailSetting.getAccessKeyId()) + .setAccessKeySecret(aliYunMailSetting.getAccessKeySecret()) + .setRegionId(aliYunMailSetting.getRegionId()) + .setEndpoint(aliYunMailSetting.getEndpoint()); + + try { + this.emailClient = new Client(config); + } catch (Exception e) { + log.error("阿里云邮件客户端初始化失败", e); + this.emailClient = null; + } + } + } + + @Override + public SendResult sendEmail(MessageRecordDO message, Map params) { + if (emailClient == null) { + return SendResult.configInvalid("当前服务商邮件渠道初始化失败"); + } + Future future = this.sender.MSG_PUSH_THREAD_POOL_EXECUTOR.submit(() -> { + RuntimeOptions runtimeOptions = new RuntimeOptions(); + runtimeOptions.autoretry = true; + + JSONObject jsonObject = JSON.parseObject(message.getExtraInfo()); + SingleSendMailRequest request = new SingleSendMailRequest() + .setAccountName(jsonObject.getString(ACCOUNT_NAME)) + .setAddressType(1) + .setReplyToAddress(jsonObject.getBooleanValue(REPLY_TO_ADDRESS)) + .setToAddress(message.getReceiver()) + .setSubject(message.getTitle()) + .setHtmlBody(message.getContent()) + .setTextBody("") + .setFromAlias(jsonObject.getString(FROM_ALIAS)); + + try { + LocalDateTime now = LocalDateTime.now(); + long start = now.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli(); + SingleSendMailResponse response = this.emailClient.singleSendMailWithOptions(request, runtimeOptions); + LocalDateTime end = LocalDateTime.now(); + int costTime = (int) (end.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli() - start); + message.setSendTime(now); + message.setCostTime(costTime); + + if (HttpStatus.OK.value() == response.getStatusCode()) { + // 邮件接口同步返回成功时,当前平台直接认定本次发送成功。 + return SendResult.success(now, costTime, null); + } + + // 邮件服务失败同样统一转换为平台错误码和中文错误信息。 + return this.sender.buildFailureResult( + message, + String.valueOf(response.getStatusCode()), + null, + "THIRD_PARTY_CALL_FAILED", + "第三方服务调用失败", + false + ); + } catch (Exception e) { + log.error("阿里云邮件发送失败", e); + return this.sender.buildCallFailedResult("第三方服务调用失败"); + } + }); + + try { + return future.get(3, TimeUnit.SECONDS); + } catch (Exception e) { + log.error("阿里云邮件发送超时或执行异常", e); + return this.sender.buildTimeoutResult(); + } + } +} diff --git a/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/impl/sms/AliyunSmsSender.java b/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/impl/sms/AliyunSmsSender.java new file mode 100644 index 0000000..6784916 --- /dev/null +++ b/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/impl/sms/AliyunSmsSender.java @@ -0,0 +1,156 @@ +package com.njcn.msgpush.module.push.client.sender.impl.sms; + +import cn.hutool.core.util.ObjectUtil; +import com.aliyun.dysmsapi20170525.Client; +import com.aliyun.dysmsapi20170525.models.QuerySendDetailsRequest; +import com.aliyun.dysmsapi20170525.models.QuerySendDetailsResponse; +import com.aliyun.dysmsapi20170525.models.SendSmsRequest; +import com.aliyun.dysmsapi20170525.models.SendSmsResponse; +import com.aliyun.teaopenapi.models.Config; +import com.aliyun.teautil.models.RuntimeOptions; +import com.njcn.msgpush.module.push.client.sender.SendResult; +import com.njcn.msgpush.module.push.client.sender.Sender; +import com.njcn.msgpush.module.push.client.sender.SmsSender; +import com.njcn.msgpush.module.push.client.setting.impl.AliYunMailSetting; +import com.njcn.msgpush.module.push.dal.dataobject.message.MessageRecordDO; +import lombok.extern.slf4j.Slf4j; +import org.springframework.http.HttpStatus; + +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; + +@Slf4j +public class AliyunSmsSender implements SmsSender { + + public static final String OK = "OK"; + + private final Sender sender; + + private Client smsClient; + + public AliyunSmsSender(AliYunMailSetting aliYunSmsSetting, Sender sender) { + this.sender = sender; + if (ObjectUtil.isNotNull(aliYunSmsSetting)) { + Config config = new Config() + .setAccessKeyId(aliYunSmsSetting.getAccessKeyId()) + .setAccessKeySecret(aliYunSmsSetting.getAccessKeySecret()) + .setRegionId(aliYunSmsSetting.getRegionId()) + .setEndpoint(aliYunSmsSetting.getEndpoint()); + try { + this.smsClient = new Client(config); + } catch (Exception e) { + log.error("阿里云短信客户端初始化失败", e); + this.smsClient = null; + } + } + } + + @Override + public SendResult sendSms(MessageRecordDO message) { + if (smsClient == null) { + return SendResult.configInvalid("当前服务商短信渠道初始化失败"); + } + Future future = this.sender.MSG_PUSH_THREAD_POOL_EXECUTOR.submit(() -> { + RuntimeOptions runtimeOptions = new RuntimeOptions(); + runtimeOptions.autoretry = true; + SendSmsRequest request = new SendSmsRequest() + .setPhoneNumbers(message.getReceiver()) + .setSignName(message.getTitle()) + .setTemplateCode(message.getTemplateCode()) + .setTemplateParam(message.getTemplateParams()); + try { + LocalDateTime now = LocalDateTime.now(); + long start = now.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli(); + SendSmsResponse response = this.smsClient.sendSmsWithOptions(request, runtimeOptions); + LocalDateTime end = LocalDateTime.now(); + int costTime = (int) (end.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli() - start); + message.setSendTime(now); + message.setCostTime(costTime); + if (HttpStatus.OK.value() == response.getStatusCode() && response.getBody() != null && OK.equals(response.getBody().getCode())) { + String bizId = response.getBody().getBizId(); + message.setThirdPartyId(bizId); + // 阿里云短信同步接口只表示“已受理”,最终是否送达依赖后续回执查询。 + this.getDownInfo(bizId, message); + return SendResult.accepted(now, costTime, bizId); + } + String providerRawCode = response.getBody() == null ? null : response.getBody().getCode(); + String providerRawMessage = response.getBody() == null ? null : response.getBody().getMessage(); + // 第三方失败统一在这里映射为平台错误码和中文错误信息。 + return this.sender.buildFailureResult( + message, + providerRawCode, + providerRawMessage, + "THIRD_PARTY_CALL_FAILED", + "第三方服务调用失败", + false + ); + } catch (Exception e) { + log.error("阿里云短信发送失败", e); + return this.sender.buildCallFailedResult("第三方服务调用失败"); + } + }); + try { + return future.get(3, TimeUnit.SECONDS); + } catch (Exception e) { + log.error("阿里云短信发送超时或执行异常", e); + return this.sender.buildTimeoutResult(); + } + } + + @Override + public List sendBatchSms(List messageList) { + List results = new ArrayList<>(); + for (MessageRecordDO message : messageList) { + results.add(this.sendSms(message)); + } + return results; + } + + @Override + public void queryTemplate(String templateIdentifier) { + } + + private void getDownInfo(String bizId, MessageRecordDO message) { + // 回执存在延迟,这里延后查询,避免刚发送完就拿不到最终状态。 + this.sender.MSG_CALLBACK_THREAD_POOL_SCHEDULER.schedule(() -> { + QuerySendDetailsRequest request = new QuerySendDetailsRequest() + .setPhoneNumber(message.getReceiver()) + .setBizId(bizId) + .setSendDate(message.getSendTime().format(DateTimeFormatter.ofPattern("yyyyMMdd"))) + .setCurrentPage(1L) + .setPageSize(10L); + try { + QuerySendDetailsResponse response = this.smsClient.querySendDetails(request); + if (response.getBody() == null || response.getBody().getSmsSendDetailDTOs() == null || response.getBody().getSmsSendDetailDTOs().getSmsSendDetailDTO() == null) { + return; + } + response.getBody().getSmsSendDetailDTOs().getSmsSendDetailDTO().forEach(detail -> { + if (!"DELIVERED".equals(detail.getErrCode())) { + SendResult failedResult = this.sender.buildFailureResult( + message, + detail.getErrCode(), + null, + "THIRD_PARTY_CALLBACK_FAILED", + "短信回执返回失败", + false + ); + this.sender.applyCallbackResult(message, failedResult); + } else { + // 送达成功后,统一复用主流程成功状态更新逻辑。 + this.sender.applyCallbackResult( + message, + SendResult.success(message.getSendTime(), message.getCostTime(), message.getThirdPartyId()) + ); + } + }); + } catch (Exception e) { + log.error("阿里云短信回执查询失败", e); + } + }, 20, TimeUnit.SECONDS); + } +} diff --git a/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/impl/sms/TelecomSmsSender.java b/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/impl/sms/TelecomSmsSender.java new file mode 100644 index 0000000..571eefe --- /dev/null +++ b/msgpush-module-push/msgpush-module-push-server/src/main/java/com/njcn/msgpush/module/push/client/sender/impl/sms/TelecomSmsSender.java @@ -0,0 +1,225 @@ +package com.njcn.msgpush.module.push.client.sender.impl.sms; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.njcn.msgpush.module.push.client.sender.SendResult; +import com.njcn.msgpush.module.push.client.sender.Sender; +import com.njcn.msgpush.module.push.client.sender.SmsSender; +import com.njcn.msgpush.module.push.client.setting.impl.TelecomSmsSetting; +import com.njcn.msgpush.module.push.dal.dataobject.message.MessageRecordDO; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; + +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; + +import static com.alibaba.fastjson.JSON.toJSON; + +@Data +@Slf4j +public class TelecomSmsSender implements SmsSender { + + private static final String CONTENT_TYPE = "application/json;charset=utf-8"; + + private final TelecomSmsSetting telecomSmsSetting; + private final Sender sender; + + @Data + private static class TelecomSmsSendResponse { + private String status; + private Double balance; + private List list; + } + + @Data + private static class TelecomSmsSendDetailRes { + private String mid; + private String mobile; + private Integer result; + } + + @Data + private static class TelecomSmsSelectResponse { + private String status; + private Double balance; + private List list; + } + + @Data + private static class TelecomSmsSelectDetailRes { + private String apmid; + private String apSubmitTime; + private String mobile; + private Integer status; + private String stat; + private String deliverTime; + } + + public TelecomSmsSender(TelecomSmsSetting telecomSmsSetting, Sender sender) { + this.telecomSmsSetting = telecomSmsSetting; + this.sender = sender; + } + + @Override + public SendResult sendSms(MessageRecordDO message) { + Future future = this.sender.MSG_PUSH_THREAD_POOL_EXECUTOR.submit(() -> { + Map request = new HashMap<>(); + boolean isTemplateSend = StrUtil.isNotBlank(message.getTemplateCode()); + request.put("account", telecomSmsSetting.getAccount()); + request.put("password", telecomSmsSetting.getPassword()); + request.put("extno", telecomSmsSetting.getExtno()); + if (isTemplateSend) { + request.put("action", "templatep2p"); + Map templateJsonMap = new HashMap<>(); + templateJsonMap.put("templateID", message.getTemplateCode()); + JSONObject jsonObject = JSON.parseObject(message.getTemplateParams()); + Map variable = new HashMap<>(); + variable.put("mobile", message.getReceiver()); + jsonObject.forEach((key, value) -> variable.put(key, value.toString())); + templateJsonMap.put("variable", "[" + toJSON(variable) + "]"); + request.put("templateJson", toJSON(templateJsonMap)); + } else { + request.put("action", "send"); + request.put("mobile", message.getReceiver()); + request.put("content", message.getContent()); + } + + HttpHeaders headers = new HttpHeaders(); + headers.set("Content-Type", CONTENT_TYPE); + + try { + LocalDateTime now = LocalDateTime.now(); + long start = now.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli(); + ResponseEntity response = this.sender.restTemplateUtil.post( + telecomSmsSetting.getApiUrl(), + request, + headers, + String.class + ); + LocalDateTime end = LocalDateTime.now(); + int costTime = (int) (end.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli() - start); + message.setSendTime(now); + message.setCostTime(costTime); + TelecomSmsSendResponse sendResponse = JSON.parseObject(response.getBody(), TelecomSmsSendResponse.class); + TelecomSmsSendDetailRes detailRes = sendResponse == null || sendResponse.getList() == null || sendResponse.getList().isEmpty() + ? null + : sendResponse.getList().get(0); + + if (response.getStatusCode() == HttpStatus.OK && detailRes != null && detailRes.getResult() != null && detailRes.getResult() == 0) { + message.setThirdPartyId(detailRes.getMid()); + // 电信短信同步返回成功同样只代表已受理,最终状态以后续回执为准。 + this.getDownInfo(detailRes.getMid(), message); + return SendResult.accepted(now, costTime, detailRes.getMid()); + } + + String providerRawCode = detailRes == null || detailRes.getResult() == null ? null : String.valueOf(detailRes.getResult()); + // 电信原始结果码在这里统一映射为平台错误码和中文错误信息。 + return this.sender.buildFailureResult( + message, + providerRawCode, + null, + "THIRD_PARTY_CALL_FAILED", + "第三方服务调用失败", + false + ); + } catch (Exception e) { + log.error("电信短信发送失败", e); + return this.sender.buildCallFailedResult("第三方服务调用失败"); + } + }); + + try { + return future.get(3, TimeUnit.SECONDS); + } catch (Exception e) { + log.error("电信短信发送超时或执行异常", e); + return this.sender.buildTimeoutResult(); + } + } + + @Override + public List sendBatchSms(List messageList) { + List results = new ArrayList<>(); + for (MessageRecordDO message : messageList) { + results.add(this.sendSms(message)); + } + return results; + } + + @Override + public void queryTemplate(String templateIdentifier) { + Map request = new HashMap<>(); + request.put("action", "templateSelect"); + request.put("account", telecomSmsSetting.getAccount()); + request.put("password", telecomSmsSetting.getPassword()); + request.put("templateJson", StrUtil.isBlank(templateIdentifier) ? 0 : templateIdentifier); + + HttpHeaders headers = new HttpHeaders(); + headers.set("Content-Type", CONTENT_TYPE); + this.sender.restTemplateUtil.post( + telecomSmsSetting.getApiUrl(), + request, + headers, + String.class + ); + } + + private void getDownInfo(String mid, MessageRecordDO message) { + // 回执查询延后执行,给第三方落库和状态变更留出时间。 + this.sender.MSG_CALLBACK_THREAD_POOL_SCHEDULER.schedule(() -> { + Map request = new HashMap<>(); + request.put("action", "select"); + request.put("account", telecomSmsSetting.getAccount()); + request.put("password", telecomSmsSetting.getPassword()); + request.put("date", message.getSendTime().format(DateTimeFormatter.ofPattern("yyyyMMdd"))); + request.put("condition", "APMID"); + request.put("valueList", mid); + + HttpHeaders headers = new HttpHeaders(); + headers.set("Content-Type", CONTENT_TYPE); + try { + ResponseEntity response = this.sender.restTemplateUtil.post( + telecomSmsSetting.getApiUrl(), + request, + headers, + String.class + ); + + TelecomSmsSelectResponse selectResponse = JSON.parseObject(response.getBody(), TelecomSmsSelectResponse.class); + if (selectResponse == null || selectResponse.getList() == null || selectResponse.getList().isEmpty()) { + return; + } + TelecomSmsSelectDetailRes detailRes = selectResponse.getList().get(0); + if (detailRes.getStatus() == 5) { + SendResult failedResult = this.sender.buildFailureResult( + message, + detailRes.getStat(), + null, + "THIRD_PARTY_CALLBACK_FAILED", + "短信回执返回失败", + false + ); + this.sender.applyCallbackResult(message, failedResult); + } else if (detailRes.getStatus() == 4) { + // 回执确认成功后,复用统一成功落库逻辑。 + this.sender.applyCallbackResult( + message, + SendResult.success(message.getSendTime(), message.getCostTime(), message.getThirdPartyId()) + ); + } + } catch (Exception e) { + log.error("电信短信回执查询失败", e); + } + }, 20, TimeUnit.SECONDS); + } +} diff --git a/msgpush-module-infra/msgpush-module-infra-api/src/main/java/com/njcn/msgpush/module/infra/api/config/ConfigApi.java b/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/api/config/ConfigApi.java similarity index 78% rename from msgpush-module-infra/msgpush-module-infra-api/src/main/java/com/njcn/msgpush/module/infra/api/config/ConfigApi.java rename to msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/api/config/ConfigApi.java index 672365d..b090d82 100644 --- a/msgpush-module-infra/msgpush-module-infra-api/src/main/java/com/njcn/msgpush/module/infra/api/config/ConfigApi.java +++ b/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/api/config/ConfigApi.java @@ -1,14 +1,14 @@ -package com.njcn.msgpush.module.infra.api.config; +package com.njcn.msgpush.module.system.api.config; import com.njcn.msgpush.framework.common.pojo.CommonResult; -import com.njcn.msgpush.module.infra.enums.ApiConstants; +import com.njcn.msgpush.module.system.enums.ApiConstants; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; -@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory = +@FeignClient(name = ApiConstants.NAME) @Tag(name = "RPC 服务 - 参数配置") public interface ConfigApi { diff --git a/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/api/user/AdminUserApi.java b/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/api/user/AdminUserApi.java index b7e6fee..8e01761 100644 --- a/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/api/user/AdminUserApi.java +++ b/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/api/user/AdminUserApi.java @@ -1,12 +1,12 @@ package com.njcn.msgpush.module.system.api.user; import cn.hutool.core.convert.Convert; +import com.fhs.core.trans.anno.AutoTrans; +import com.fhs.trans.service.AutoTransable; import com.njcn.msgpush.framework.common.pojo.CommonResult; import com.njcn.msgpush.framework.common.util.collection.CollectionUtils; import com.njcn.msgpush.module.system.api.user.dto.AdminUserRespDTO; import com.njcn.msgpush.module.system.enums.ApiConstants; -import com.fhs.core.trans.anno.AutoTrans; -import com.fhs.trans.service.AutoTransable; import feign.FeignIgnore; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -22,7 +22,7 @@ import java.util.Map; import static com.njcn.msgpush.module.system.api.user.AdminUserApi.PREFIX; -@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory = +@FeignClient(name = ApiConstants.NAME) @Tag(name = "RPC 服务 - 管理员用户") @AutoTrans(namespace = PREFIX, fields = {"nickname"}) public interface AdminUserApi extends AutoTransable { @@ -34,11 +34,6 @@ public interface AdminUserApi extends AutoTransable { @Parameter(name = "id", description = "用户编号", example = "1", required = true) CommonResult getUser(@RequestParam("id") Long id); - @GetMapping(PREFIX + "/list-by-subordinate") - @Operation(summary = "通过用户 ID 查询用户下属") - @Parameter(name = "id", description = "用户编号", example = "1", required = true) - CommonResult> getUserListBySubordinate(@RequestParam("id") Long id); - @GetMapping(PREFIX + "/list") @Operation(summary = "通过用户 ID 查询用户们") @Parameter(name = "ids", description = "部门编号数组", example = "1,2", required = true) @@ -66,9 +61,7 @@ public interface AdminUserApi extends AutoTransable { } /** - * 校验用户是否有效。如下情况,视为无效: - * 1. 用户编号不存在 - * 2. 用户被禁用 + * 校验用户是否有效 * * @param id 用户编号 */ diff --git a/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/api/websocket/WebSocketSenderApi.java b/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/api/websocket/WebSocketSenderApi.java new file mode 100644 index 0000000..e0121a9 --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/api/websocket/WebSocketSenderApi.java @@ -0,0 +1,42 @@ +package com.njcn.msgpush.module.system.api.websocket; + +import com.njcn.msgpush.framework.common.pojo.CommonResult; +import com.njcn.msgpush.framework.common.util.json.JsonUtils; +import com.njcn.msgpush.module.system.api.websocket.dto.WebSocketSendToUsersReqDTO; +import com.njcn.msgpush.module.system.enums.ApiConstants; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.Collection; + +@FeignClient(name = ApiConstants.NAME) +@Tag(name = "RPC 服务 - WebSocket 发送器的") // 对 WebSocketMessageSender 进行封装,提供给其它模块使用 +public interface WebSocketSenderApi { + + String PREFIX = ApiConstants.PREFIX + "/websocket"; + + @PostMapping(PREFIX + "/send-to-users") + @Operation(summary = "按用户编号集合发送 WebSocket 消息") + CommonResult sendToUsers(@Valid @RequestBody WebSocketSendToUsersReqDTO message); + + /** + * 发送消息给指定用户集合 + * + * @param userIds 用户编号集合 + * @param messageType 消息类型 + * @param messageContent 消息内容,JSON 格式 + */ + default void send(Collection userIds, String messageType, String messageContent) { + sendToUsers(new WebSocketSendToUsersReqDTO().setUserIds(userIds) + .setMessageType(messageType).setMessageContent(messageContent)).checkError(); + } + + default void sendObject(Collection userIds, String messageType, Object messageContent) { + send(userIds, messageType, JsonUtils.toJsonString(messageContent)); + } + +} diff --git a/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/api/websocket/dto/WebSocketSendToUsersReqDTO.java b/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/api/websocket/dto/WebSocketSendToUsersReqDTO.java new file mode 100644 index 0000000..c084392 --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/api/websocket/dto/WebSocketSendToUsersReqDTO.java @@ -0,0 +1,27 @@ +package com.njcn.msgpush.module.system.api.websocket.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotEmpty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.Collection; + +@Schema(description = "RPC 服务 - 按用户编号集合发送 WebSocket 消息 Request DTO") +@Data +@Accessors(chain = true) +public class WebSocketSendToUsersReqDTO { + + @Schema(description = "用户编号集合", requiredMode = Schema.RequiredMode.REQUIRED, example = "[1,2,3]") + @NotEmpty(message = "用户编号集合不能为空") + private Collection userIds; + + @Schema(description = "消息类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "notice-push") + @NotEmpty(message = "消息类型不能为空") + private String messageType; + + @Schema(description = "消息内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "{\"name\":\"李四\"}") + @NotEmpty(message = "消息内容不能为空") + private String messageContent; + +} diff --git a/msgpush-module-infra/msgpush-module-infra-api/src/main/java/com/njcn/msgpush/module/infra/enums/config/ConfigTypeEnum.java b/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/enums/config/ConfigTypeEnum.java similarity index 82% rename from msgpush-module-infra/msgpush-module-infra-api/src/main/java/com/njcn/msgpush/module/infra/enums/config/ConfigTypeEnum.java rename to msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/enums/config/ConfigTypeEnum.java index d9be895..d31014a 100644 --- a/msgpush-module-infra/msgpush-module-infra-api/src/main/java/com/njcn/msgpush/module/infra/enums/config/ConfigTypeEnum.java +++ b/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/enums/config/ConfigTypeEnum.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.infra.enums.config; +package com.njcn.msgpush.module.system.enums.config; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/enums/dept/DeptOrgTypeEnum.java b/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/enums/dept/DeptOrgTypeEnum.java new file mode 100644 index 0000000..c928af5 --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/enums/dept/DeptOrgTypeEnum.java @@ -0,0 +1,33 @@ +package com.njcn.msgpush.module.system.enums.dept; + +import java.util.Arrays; + +/** + * 组织节点类型枚举 + */ +public enum DeptOrgTypeEnum { + + COMPANY("company"), + DEPT("dept"), + DIRECTION("direction"), + TEAM("team"); + + private final String type; + + DeptOrgTypeEnum(String type) { + this.type = type; + } + + public String getType() { + return type; + } + + public static boolean isValid(String type) { + return Arrays.stream(values()).anyMatch(item -> item.type.equals(type)); + } + + public static String defaultType() { + return DEPT.type; + } + +} diff --git a/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/enums/dept/PostTypeEnum.java b/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/enums/dept/PostTypeEnum.java new file mode 100644 index 0000000..0018527 --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/enums/dept/PostTypeEnum.java @@ -0,0 +1,28 @@ +package com.njcn.msgpush.module.system.enums.dept; + +import java.util.Arrays; + +/** + * 岗位类型枚举 + */ +public enum PostTypeEnum { + + MANAGEMENT("management"), + TECHNICAL("technical"), + BUSINESS("business"); + + private final String type; + + PostTypeEnum(String type) { + this.type = type; + } + + public String getType() { + return type; + } + + public static boolean isValid(String type) { + return Arrays.stream(values()).anyMatch(item -> item.type.equals(type)); + } + +} diff --git a/msgpush-module-infra/msgpush-module-infra-api/src/main/java/com/njcn/msgpush/module/infra/enums/logger/ApiErrorLogProcessStatusEnum.java b/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/enums/logger/ApiErrorLogProcessStatusEnum.java similarity index 88% rename from msgpush-module-infra/msgpush-module-infra-api/src/main/java/com/njcn/msgpush/module/infra/enums/logger/ApiErrorLogProcessStatusEnum.java rename to msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/enums/logger/ApiErrorLogProcessStatusEnum.java index 9c72905..1ea51e3 100644 --- a/msgpush-module-infra/msgpush-module-infra-api/src/main/java/com/njcn/msgpush/module/infra/enums/logger/ApiErrorLogProcessStatusEnum.java +++ b/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/enums/logger/ApiErrorLogProcessStatusEnum.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.infra.enums.logger; +package com.njcn.msgpush.module.system.enums.logger; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/enums/permission/MenuRouteKindEnum.java b/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/enums/permission/MenuRouteKindEnum.java new file mode 100644 index 0000000..0851e9d --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/enums/permission/MenuRouteKindEnum.java @@ -0,0 +1,38 @@ +package com.njcn.msgpush.module.system.enums.permission; + +import cn.hutool.core.util.StrUtil; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 菜单路由类型枚举 + */ +@Getter +@AllArgsConstructor +public enum MenuRouteKindEnum { + + DIR("dir"), // 目录路由 + VIEW("view"), // 普通页面 + SINGLE("single"), // 顶级单页 + IFRAME("iframe"), // iframe 页面 + EXTERNAL("external"), // 外链页面 + REDIRECT("redirect"); // 重定向路由 + + /** + * 路由类型值 + */ + private final String kind; + + public static MenuRouteKindEnum valueOfKind(String kind) { + if (StrUtil.isBlank(kind)) { + return null; + } + for (MenuRouteKindEnum value : values()) { + if (StrUtil.equalsIgnoreCase(value.getKind(), StrUtil.trim(kind))) { + return value; + } + } + return null; + } + +} diff --git a/msgpush-module-infra/msgpush-module-infra-server/pom.xml b/msgpush-module-system/msgpush-module-system-boot/pom.xml similarity index 78% rename from msgpush-module-infra/msgpush-module-infra-server/pom.xml rename to msgpush-module-system/msgpush-module-system-boot/pom.xml index 2bb7f00..de6632d 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/pom.xml +++ b/msgpush-module-system/msgpush-module-system-boot/pom.xml @@ -2,21 +2,20 @@ + 4.0.0 com.njcn - msgpush-module-infra + msgpush-module-system ${revision} - 4.0.0 - msgpush-module-infra-server - jar - ${project.artifactId} - - infra 模块,主要提供两块能力: - 1. 我们放基础设施的运维与管理,支撑上层的通用与核心业务。 例如说:定时任务的管理、服务器的信息等等 - 2. 研发工具,提升研发效率与质量。 例如说:代码生成器、接口文档等等 - + msgpush-module-system-boot + 系统模块功能服务模块 + + 17 + 17 + UTF-8 + @@ -28,31 +27,28 @@ com.njcn - msgpush-module-infra-api + msgpush-system-api ${revision} + + + com.njcn + msgpush-spring-boot-starter-biz-ip + + com.njcn msgpush-spring-boot-starter-security - - com.njcn - msgpush-spring-boot-starter-websocket - - com.njcn msgpush-spring-boot-starter-mybatis - - com.baomidou - mybatis-plus-generator - com.njcn @@ -77,6 +73,14 @@ spring-cloud-starter-alibaba-nacos-config + + + com.njcn + msgpush-spring-boot-starter-websocket + + + + com.njcn @@ -96,15 +100,16 @@ msgpush-spring-boot-starter-excel + - org.apache.velocity - velocity-engine-core + com.anji-plus + captcha-spring-boot-starter - - - - + + org.apache.tika + tika-core + @@ -120,12 +125,8 @@ s3 - - org.apache.tika - tika-core - - + ${project.artifactId} @@ -145,5 +146,4 @@ - diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/SystemServerApplication.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/SystemServerApplication.java similarity index 86% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/SystemServerApplication.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/SystemServerApplication.java index 34c72a0..f3390be 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/SystemServerApplication.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/SystemServerApplication.java @@ -2,7 +2,6 @@ package com.njcn.msgpush.module.system; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.openfeign.EnableFeignClients; /** * 项目的启动类 diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/api/config/ConfigApiImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/config/ConfigApiImpl.java similarity index 74% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/api/config/ConfigApiImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/config/ConfigApiImpl.java index 57636de..850de3f 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/api/config/ConfigApiImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/config/ConfigApiImpl.java @@ -1,8 +1,9 @@ -package com.njcn.msgpush.module.infra.api.config; +package com.njcn.msgpush.module.system.api.config; import com.njcn.msgpush.framework.common.pojo.CommonResult; -import com.njcn.msgpush.module.infra.dal.dataobject.config.ConfigDO; -import com.njcn.msgpush.module.infra.service.config.ConfigService; +import com.njcn.msgpush.module.system.dal.dataobject.config.ConfigDO; +import com.njcn.msgpush.module.system.service.config.ConfigService; +import io.swagger.v3.oas.annotations.Hidden; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RestController; @@ -11,6 +12,7 @@ import static com.njcn.msgpush.framework.common.pojo.CommonResult.success; @RestController // 提供 RESTful API 接口,给 Feign 调用 @Validated +@Hidden public class ConfigApiImpl implements ConfigApi { @Resource diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/api/dept/DeptApiImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/dept/DeptApiImpl.java similarity index 96% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/api/dept/DeptApiImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/dept/DeptApiImpl.java index 287031e..a9256e2 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/api/dept/DeptApiImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/dept/DeptApiImpl.java @@ -5,6 +5,7 @@ import com.njcn.msgpush.framework.common.util.object.BeanUtils; import com.njcn.msgpush.module.system.api.dept.dto.DeptRespDTO; import com.njcn.msgpush.module.system.dal.dataobject.dept.DeptDO; import com.njcn.msgpush.module.system.service.dept.DeptService; +import io.swagger.v3.oas.annotations.Hidden; import org.springframework.context.annotation.Bean; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RestController; @@ -17,6 +18,7 @@ import static com.njcn.msgpush.framework.common.pojo.CommonResult.success; @RestController // 提供 RESTful API 接口,给 Feign 调用 @Validated +@Hidden public class DeptApiImpl implements DeptApi { @Resource diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/api/dept/PostApiImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/dept/PostApiImpl.java similarity index 95% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/api/dept/PostApiImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/dept/PostApiImpl.java index 5fb5a11..4e764b9 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/api/dept/PostApiImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/dept/PostApiImpl.java @@ -5,6 +5,7 @@ import com.njcn.msgpush.framework.common.util.object.BeanUtils; import com.njcn.msgpush.module.system.api.dept.dto.PostRespDTO; import com.njcn.msgpush.module.system.dal.dataobject.dept.PostDO; import com.njcn.msgpush.module.system.service.dept.PostService; +import io.swagger.v3.oas.annotations.Hidden; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RestController; @@ -16,6 +17,7 @@ import static com.njcn.msgpush.framework.common.pojo.CommonResult.success; @RestController // 提供 RESTful API 接口,给 Feign 调用 @Validated +@Hidden public class PostApiImpl implements PostApi { @Resource diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/api/dict/DictDataApiImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/dict/DictDataApiImpl.java similarity index 96% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/api/dict/DictDataApiImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/dict/DictDataApiImpl.java index 268d5b9..f497c65 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/api/dict/DictDataApiImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/dict/DictDataApiImpl.java @@ -5,6 +5,7 @@ import com.njcn.msgpush.framework.common.util.object.BeanUtils; import com.njcn.msgpush.framework.common.biz.system.dict.dto.DictDataRespDTO; import com.njcn.msgpush.module.system.dal.dataobject.dict.DictDataDO; import com.njcn.msgpush.module.system.service.dict.DictDataService; +import io.swagger.v3.oas.annotations.Hidden; import org.springframework.context.annotation.Primary; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RestController; @@ -18,6 +19,7 @@ import static com.njcn.msgpush.framework.common.pojo.CommonResult.success; @RestController // 提供 RESTful API 接口,给 Feign 调用 @Validated @Primary // 由于 DictDataCommonApi 的存在,必须声明为 @Primary Bean +@Hidden public class DictDataApiImpl implements DictDataApi { @Resource diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/api/logger/ApiAccessLogApiImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/logger/ApiAccessLogApiImpl.java similarity index 67% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/api/logger/ApiAccessLogApiImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/logger/ApiAccessLogApiImpl.java index da5c4fa..f76f8e9 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/api/logger/ApiAccessLogApiImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/logger/ApiAccessLogApiImpl.java @@ -1,18 +1,19 @@ -package com.njcn.msgpush.module.infra.api.logger; +package com.njcn.msgpush.module.system.api.logger; -import com.njcn.msgpush.framework.common.biz.infra.logger.ApiAccessLogCommonApi; -import com.njcn.msgpush.framework.common.biz.infra.logger.dto.ApiAccessLogCreateReqDTO; +import com.njcn.msgpush.framework.common.biz.system.logger.ApiAccessLogCommonApi; +import com.njcn.msgpush.framework.common.biz.system.logger.dto.ApiAccessLogCreateReqDTO; import com.njcn.msgpush.framework.common.pojo.CommonResult; -import com.njcn.msgpush.module.infra.service.logger.ApiAccessLogService; +import com.njcn.msgpush.module.system.service.logger.ApiAccessLogService; +import io.swagger.v3.oas.annotations.Hidden; +import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RestController; -import jakarta.annotation.Resource; - import static com.njcn.msgpush.framework.common.pojo.CommonResult.success; @RestController // 提供 RESTful API 接口,给 Feign 调用 @Validated +@Hidden public class ApiAccessLogApiImpl implements ApiAccessLogCommonApi { @Resource diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/api/logger/ApiErrorLogApiImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/logger/ApiErrorLogApiImpl.java similarity index 67% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/api/logger/ApiErrorLogApiImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/logger/ApiErrorLogApiImpl.java index d3f7e4b..92ad52f 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/api/logger/ApiErrorLogApiImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/logger/ApiErrorLogApiImpl.java @@ -1,18 +1,19 @@ -package com.njcn.msgpush.module.infra.api.logger; +package com.njcn.msgpush.module.system.api.logger; -import com.njcn.msgpush.framework.common.biz.infra.logger.ApiErrorLogCommonApi; -import com.njcn.msgpush.framework.common.biz.infra.logger.dto.ApiErrorLogCreateReqDTO; +import com.njcn.msgpush.framework.common.biz.system.logger.ApiErrorLogCommonApi; +import com.njcn.msgpush.framework.common.biz.system.logger.dto.ApiErrorLogCreateReqDTO; import com.njcn.msgpush.framework.common.pojo.CommonResult; -import com.njcn.msgpush.module.infra.service.logger.ApiErrorLogService; +import com.njcn.msgpush.module.system.service.logger.ApiErrorLogService; +import io.swagger.v3.oas.annotations.Hidden; +import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RestController; -import jakarta.annotation.Resource; - import static com.njcn.msgpush.framework.common.pojo.CommonResult.success; @RestController // 提供 RESTful API 接口,给 Feign 调用 @Validated +@Hidden public class ApiErrorLogApiImpl implements ApiErrorLogCommonApi { @Resource diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/api/logger/OperateLogApiImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/logger/OperateLogApiImpl.java similarity index 96% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/api/logger/OperateLogApiImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/logger/OperateLogApiImpl.java index 854c741..577061b 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/api/logger/OperateLogApiImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/logger/OperateLogApiImpl.java @@ -8,6 +8,7 @@ import com.njcn.msgpush.module.system.api.logger.dto.OperateLogPageReqDTO; import com.njcn.msgpush.module.system.api.logger.dto.OperateLogRespDTO; import com.njcn.msgpush.module.system.dal.dataobject.logger.OperateLogDO; import com.njcn.msgpush.module.system.service.logger.OperateLogService; +import io.swagger.v3.oas.annotations.Hidden; import jakarta.annotation.Resource; import org.springframework.context.annotation.Primary; import org.springframework.validation.annotation.Validated; @@ -18,6 +19,7 @@ import static com.njcn.msgpush.framework.common.pojo.CommonResult.success; @RestController // 提供 RESTful API 接口,给 Feign 调用 @Validated @Primary // 由于 OperateLogCommonApi 的存在,必须声明为 @Primary Bean +@Hidden public class OperateLogApiImpl implements OperateLogApi { @Resource diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/api/oauth2/OAuth2TokenApiImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/oauth2/OAuth2TokenApiImpl.java similarity index 97% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/api/oauth2/OAuth2TokenApiImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/oauth2/OAuth2TokenApiImpl.java index d2971c3..7ce007b 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/api/oauth2/OAuth2TokenApiImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/oauth2/OAuth2TokenApiImpl.java @@ -1,21 +1,23 @@ package com.njcn.msgpush.module.system.api.oauth2; import com.njcn.msgpush.framework.common.biz.system.oauth2.OAuth2TokenCommonApi; -import com.njcn.msgpush.framework.common.pojo.CommonResult; -import com.njcn.msgpush.framework.common.util.object.BeanUtils; import com.njcn.msgpush.framework.common.biz.system.oauth2.dto.OAuth2AccessTokenCheckRespDTO; import com.njcn.msgpush.framework.common.biz.system.oauth2.dto.OAuth2AccessTokenCreateReqDTO; import com.njcn.msgpush.framework.common.biz.system.oauth2.dto.OAuth2AccessTokenRespDTO; +import com.njcn.msgpush.framework.common.pojo.CommonResult; +import com.njcn.msgpush.framework.common.util.object.BeanUtils; import com.njcn.msgpush.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO; import com.njcn.msgpush.module.system.service.oauth2.OAuth2TokenService; +import io.swagger.v3.oas.annotations.Hidden; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RestController; import static com.njcn.msgpush.framework.common.pojo.CommonResult.success; -@RestController // 提供 RESTful API 接口,给 Feign 调用 +@RestController @Validated +@Hidden public class OAuth2TokenApiImpl implements OAuth2TokenCommonApi { @Resource diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/api/permission/PermissionApiImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/permission/PermissionApiImpl.java similarity index 83% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/api/permission/PermissionApiImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/permission/PermissionApiImpl.java index 917870b..17f01bd 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/api/permission/PermissionApiImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/permission/PermissionApiImpl.java @@ -1,8 +1,8 @@ package com.njcn.msgpush.module.system.api.permission; import com.njcn.msgpush.framework.common.pojo.CommonResult; -import com.njcn.msgpush.framework.common.biz.system.permission.dto.DeptDataPermissionRespDTO; import com.njcn.msgpush.module.system.service.permission.PermissionService; +import io.swagger.v3.oas.annotations.Hidden; import org.springframework.context.annotation.Primary; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RestController; @@ -16,6 +16,7 @@ import static com.njcn.msgpush.framework.common.pojo.CommonResult.success; @RestController // 提供 RESTful API 接口,给 Feign 调用 @Validated @Primary // 由于 PermissionCommonApi 的存在,必须声明为 @Primary Bean +@Hidden public class PermissionApiImpl implements PermissionApi { @Resource @@ -36,9 +37,5 @@ public class PermissionApiImpl implements PermissionApi { return success(permissionService.hasAnyRoles(userId, roles)); } - @Override - public CommonResult getDeptDataPermission(Long userId) { - return success(permissionService.getDeptDataPermission(userId)); - } } diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/api/user/AdminUserApiImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/user/AdminUserApiImpl.java similarity index 55% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/api/user/AdminUserApiImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/user/AdminUserApiImpl.java index f869cc6..86a4e90 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/api/user/AdminUserApiImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/user/AdminUserApiImpl.java @@ -1,34 +1,27 @@ package com.njcn.msgpush.module.system.api.user; -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.util.ObjUtil; import com.njcn.msgpush.framework.common.pojo.CommonResult; import com.njcn.msgpush.framework.common.util.object.BeanUtils; import com.njcn.msgpush.module.system.api.user.dto.AdminUserRespDTO; -import com.njcn.msgpush.module.system.dal.dataobject.dept.DeptDO; import com.njcn.msgpush.module.system.dal.dataobject.user.AdminUserDO; -import com.njcn.msgpush.module.system.service.dept.DeptService; import com.njcn.msgpush.module.system.service.user.AdminUserService; +import io.swagger.v3.oas.annotations.Hidden; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RestController; -import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.List; import static com.njcn.msgpush.framework.common.pojo.CommonResult.success; -import static com.njcn.msgpush.framework.common.util.collection.CollectionUtils.convertSet; @RestController // 提供 RESTful API 接口,给 Feign 调用 @Validated +@Hidden public class AdminUserApiImpl implements AdminUserApi { @Resource private AdminUserService userService; - @Resource - private DeptService deptService; @Override public CommonResult getUser(Long id) { @@ -36,34 +29,6 @@ public class AdminUserApiImpl implements AdminUserApi { return success(BeanUtils.toBean(user, AdminUserRespDTO.class)); } - @Override - public CommonResult> getUserListBySubordinate(Long id) { - // 1.1 获取用户负责的部门 - AdminUserDO user = userService.getUser(id); - if (user == null) { - return success(Collections.emptyList()); - } - ArrayList deptIds = new ArrayList<>(); - DeptDO dept = deptService.getDept(user.getDeptId()); - if (dept == null) { - return success(Collections.emptyList()); - } - if (ObjUtil.notEqual(dept.getLeaderUserId(), id)) { // 校验为负责人 - return success(Collections.emptyList()); - } - deptIds.add(dept.getId()); - // 1.2 获取所有子部门 - List childDeptList = deptService.getChildDeptList(dept.getId()); - if (CollUtil.isNotEmpty(childDeptList)) { - deptIds.addAll(convertSet(childDeptList, DeptDO::getId)); - } - - // 2. 获取部门对应的用户信息 - List users = userService.getUserListByDeptIds(deptIds); - users.removeIf(item -> ObjUtil.equal(item.getId(), id)); // 排除自己 - return success(BeanUtils.toBean(users, AdminUserRespDTO.class)); - } - @Override public CommonResult> getUserList(Collection ids) { List users = userService.getUserList(ids); diff --git a/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/websocket/WebSocketSenderApiImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/websocket/WebSocketSenderApiImpl.java new file mode 100644 index 0000000..0f22e0a --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/api/websocket/WebSocketSenderApiImpl.java @@ -0,0 +1,35 @@ +package com.njcn.msgpush.module.system.api.websocket; + +import cn.hutool.core.collection.CollUtil; +import com.njcn.msgpush.framework.common.pojo.CommonResult; +import com.njcn.msgpush.framework.common.enums.UserTypeEnum; +import com.njcn.msgpush.framework.websocket.core.sender.WebSocketMessageSender; +import com.njcn.msgpush.module.system.api.websocket.dto.WebSocketSendToUsersReqDTO; +import io.swagger.v3.oas.annotations.Hidden; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RestController; + +import static com.njcn.msgpush.framework.common.pojo.CommonResult.success; + +@RestController // 提供 RESTful API 接口,给 Feign 调用 +@Validated +@Hidden +public class WebSocketSenderApiImpl implements WebSocketSenderApi { + + private static final Integer SYSTEM_USER_TYPE = UserTypeEnum.ADMIN.getValue(); + + @Resource + private WebSocketMessageSender webSocketMessageSender; + + @Override + public CommonResult sendToUsers(WebSocketSendToUsersReqDTO message) { + if (CollUtil.isNotEmpty(message.getUserIds())) { + message.getUserIds().stream().distinct().forEach(userId -> + webSocketMessageSender.send(SYSTEM_USER_TYPE, userId, + message.getMessageType(), message.getMessageContent())); + } + return success(true); + } + +} diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/AuthController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/AuthController.java similarity index 64% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/AuthController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/AuthController.java index 1ddd7d2..a14eb41 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/AuthController.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/AuthController.java @@ -4,9 +4,15 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; import com.njcn.msgpush.framework.common.pojo.CommonResult; +import com.njcn.msgpush.framework.encrypt.core.annotation.ApiEncrypt; import com.njcn.msgpush.framework.security.config.SecurityProperties; import com.njcn.msgpush.framework.security.core.util.SecurityFrameworkUtils; -import com.njcn.msgpush.module.system.controller.admin.auth.vo.*; +import com.njcn.msgpush.module.system.controller.admin.auth.vo.AuthLoginReqVO; +import com.njcn.msgpush.module.system.controller.admin.auth.vo.AuthLoginRespVO; +import com.njcn.msgpush.module.system.controller.admin.auth.vo.AuthPermissionInfoRespVO; +import com.njcn.msgpush.module.system.controller.admin.auth.vo.AuthRegisterReqVO; +import com.njcn.msgpush.module.system.controller.admin.auth.vo.AuthUserRouteRespVO; +import com.njcn.msgpush.module.system.controller.admin.auth.vo.AuthUserInfoRespVO; import com.njcn.msgpush.module.system.convert.auth.AuthConvert; import com.njcn.msgpush.module.system.dal.dataobject.permission.MenuDO; import com.njcn.msgpush.module.system.dal.dataobject.permission.RoleDO; @@ -26,7 +32,12 @@ import jakarta.servlet.http.HttpServletRequest; import jakarta.validation.Valid; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; import java.util.Collections; import java.util.List; @@ -53,13 +64,13 @@ public class AuthController { private MenuService menuService; @Resource private PermissionService permissionService; - @Resource private SecurityProperties securityProperties; @PostMapping("/login") @PermitAll @Operation(summary = "使用账号密码登录") + @ApiEncrypt(response = false, requestFields = {"password"}) public CommonResult login(@RequestBody @Valid AuthLoginReqVO reqVO) { return success(authService.login(reqVO)); } @@ -84,38 +95,78 @@ public class AuthController { return success(authService.refreshToken(refreshToken)); } - @GetMapping("/get-permission-info") - @Operation(summary = "获取登录用户的权限信息") - public CommonResult getPermissionInfo() { + @GetMapping("/get-user-info") + @Operation(summary = "获取登录用户信息") + public CommonResult getUserInfo() { // 1.1 获得用户信息 AdminUserDO user = userService.getUser(getLoginUserId()); if (user == null) { return success(null); } - // 1.2 获得角色列表 - Set roleIds = permissionService.getUserRoleIdListByUserId(getLoginUserId()); - if (CollUtil.isEmpty(roleIds)) { + // 1.2 获得角色和按钮权限 + List roles = getCurrentUserRoles(); + List menuList = getCurrentUserMenus(roles); + return success(AuthConvert.INSTANCE.convertUserInfo(user, roles, menuList)); + } + + @GetMapping("/get-user-routes") + @Operation(summary = "获取登录用户路由信息") + public CommonResult getUserRoutes() { + AdminUserDO user = userService.getUser(getLoginUserId()); + if (user == null) { + return success(null); + } + + List roles = getCurrentUserRoles(); + List menuList = getCurrentUserMenus(roles); + return success(AuthConvert.INSTANCE.convertUserRoutes(menuList)); + } + + @GetMapping("/get-permission-info") + @Operation(summary = "获取登录用户的权限信息") + public CommonResult getPermissionInfo() { + AdminUserDO user = userService.getUser(getLoginUserId()); + if (user == null) { + return success(null); + } + + List roles = getCurrentUserRoles(); + if (CollUtil.isEmpty(roles)) { return success(AuthConvert.INSTANCE.convert(user, Collections.emptyList(), Collections.emptyList())); } - List roles = roleService.getRoleList(roleIds); - roles.removeIf(role -> !CommonStatusEnum.ENABLE.getStatus().equals(role.getStatus())); // 移除禁用的角色 - // 1.3 获得菜单列表 - Set menuIds = permissionService.getRoleMenuListByRoleId(convertSet(roles, RoleDO::getId)); - List menuList = menuService.getMenuList(menuIds); - menuList = menuService.filterDisableMenus(menuList); - - // 2. 拼接结果返回 + List menuList = getCurrentUserMenus(roles); return success(AuthConvert.INSTANCE.convert(user, roles, menuList)); } @PostMapping("/register") @PermitAll @Operation(summary = "注册用户") + @ApiEncrypt(response = false, requestFields = {"password"}) public CommonResult register(@RequestBody @Valid AuthRegisterReqVO registerReqVO) { return success(authService.register(registerReqVO)); } + private List getCurrentUserRoles() { + Set roleIds = permissionService.getUserRoleIdListByUserId(getLoginUserId()); + if (CollUtil.isEmpty(roleIds)) { + return Collections.emptyList(); + } + + List roles = roleService.getRoleList(roleIds); + roles.removeIf(role -> !CommonStatusEnum.ENABLE.getStatus().equals(role.getStatus())); + return roles; + } + + private List getCurrentUserMenus(List roles) { + if (CollUtil.isEmpty(roles)) { + return Collections.emptyList(); + } + + Set menuIds = permissionService.getRoleMenuListByRoleId(convertSet(roles, RoleDO::getId)); + List menuList = menuService.getMenuList(menuIds); + return menuService.filterDisableMenus(menuList); + } } diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthLoginReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthLoginReqVO.java similarity index 57% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthLoginReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthLoginReqVO.java index 3622d33..8ddf61a 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthLoginReqVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthLoginReqVO.java @@ -1,18 +1,16 @@ package com.njcn.msgpush.module.system.controller.admin.auth.vo; -import cn.hutool.core.util.StrUtil; -import com.njcn.msgpush.framework.common.validation.InEnum; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.AssertTrue; -import jakarta.validation.constraints.NotEmpty; -import jakarta.validation.constraints.Pattern; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import org.hibernate.validator.constraints.Length; -@Schema(description = "管理后台 - 账号密码登录 Request VO,如果登录并绑定社交用户,需要传递 social 开头的参数") +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.Pattern; + +@Schema(description = "管理后台 - 账号密码登录 Request VO") @Data @NoArgsConstructor @AllArgsConstructor @@ -21,8 +19,8 @@ public class AuthLoginReqVO extends CaptchaVerificationReqVO { @Schema(description = "账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "msgpushyuanma") @NotEmpty(message = "登录账号不能为空") - @Length(min = 4, max = 16, message = "账号长度为 4-16 位") - @Pattern(regexp = "^[A-Za-z0-9]+$", message = "账号格式为数字以及字母") + @Length(min = 4, max = 30, message = "账号长度为 4-30 位") + @Pattern(regexp = "^[a-zA-Z0-9]{4,30}$", message = "账号格式为数字以及字母") private String username; @Schema(description = "密码", requiredMode = Schema.RequiredMode.REQUIRED, example = "buzhidao") @@ -30,12 +28,4 @@ public class AuthLoginReqVO extends CaptchaVerificationReqVO { @Length(min = 4, max = 16, message = "密码长度为 4-16 位") private String password; - // ========== 绑定社交登录时,需要传递如下参数 ========== - - @Schema(description = "授权码", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") - private String socialCode; - - @Schema(description = "state", requiredMode = Schema.RequiredMode.REQUIRED, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62") - private String socialState; - -} \ No newline at end of file +} diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthLoginRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthLoginRespVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthLoginRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthLoginRespVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthMenuRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthMenuRespVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthMenuRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthMenuRespVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthPermissionInfoRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthPermissionInfoRespVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthPermissionInfoRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthPermissionInfoRespVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthRegisterReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthRegisterReqVO.java similarity index 69% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthRegisterReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthRegisterReqVO.java index 97ddc5a..72da6a1 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthRegisterReqVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthRegisterReqVO.java @@ -1,31 +1,39 @@ package com.njcn.msgpush.module.system.controller.admin.auth.vo; - import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Pattern; import jakarta.validation.constraints.Size; import lombok.Data; import org.hibernate.validator.constraints.Length; -@Schema(description = "管理后台 - Register Request VO") +@Schema(description = "管理后台 - 注册 Request VO") @Data public class AuthRegisterReqVO extends CaptchaVerificationReqVO { @Schema(description = "用户账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "msgpush") @NotBlank(message = "用户账号不能为空") - @Pattern(regexp = "^[a-zA-Z0-9]{4,30}$", message = "用户账号由 数字、字母 组成") + @Pattern(regexp = "^[a-zA-Z0-9]{4,30}$", message = "用户账号由数字、字母组成") @Size(min = 4, max = 30, message = "用户账号长度为 4-30 个字符") private String username; - @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "awen") @NotBlank(message = "用户昵称不能为空") @Size(max = 30, message = "用户昵称长度不能超过 30 个字符") private String nickname; + @Schema(description = "所属部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotNull(message = "所属部门不能为空") + private Long deptId; + + @Schema(description = "主岗位编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotNull(message = "主岗位不能为空") + private Long positionId; + @Schema(description = "密码", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456") @NotEmpty(message = "密码不能为空") @Length(min = 4, max = 16, message = "密码长度为 4-16 位") private String password; -} \ No newline at end of file +} diff --git a/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthRouteMetaRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthRouteMetaRespVO.java new file mode 100644 index 0000000..340163d --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthRouteMetaRespVO.java @@ -0,0 +1,46 @@ +package com.njcn.msgpush.module.system.controller.admin.auth.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Schema(description = "管理后台 - 用户路由 Meta Response VO") +@Data +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class AuthRouteMetaRespVO { + + @Schema(description = "菜单或页面标题", requiredMode = Schema.RequiredMode.REQUIRED) + private String title; + + @Schema(description = "国际化 key") + private String i18nKey; + + @Schema(description = "图标名") + private String icon; + + @Schema(description = "本地图标名") + private String localIcon; + + @Schema(description = "排序值") + private Integer order; + + @Schema(description = "是否缓存") + private Boolean keepAlive; + + @Schema(description = "是否在菜单中隐藏") + private Boolean hideInMenu; + + @Schema(description = "当前页面高亮的菜单路由名") + private String activeMenu; + + @Schema(description = "是否支持多标签页") + private Boolean multiTab; + + @Schema(description = "标签页固定位置") + private Integer fixedIndexInTab; + +} diff --git a/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthRouteNodeRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthRouteNodeRespVO.java new file mode 100644 index 0000000..e7633ba --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthRouteNodeRespVO.java @@ -0,0 +1,42 @@ +package com.njcn.msgpush.module.system.controller.admin.auth.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +@Schema(description = "管理后台 - 用户路由节点 Response VO") +@Data +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class AuthRouteNodeRespVO { + + @Schema(description = "路由节点 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000") + private String id; + + @Schema(description = "路由名", requiredMode = Schema.RequiredMode.REQUIRED, example = "system_user") + private String name; + + @Schema(description = "完整路由路径", requiredMode = Schema.RequiredMode.REQUIRED, example = "/system/user") + private String path; + + @Schema(description = "前端组件白名单 key", example = "view.system_user") + private String component; + + @Schema(description = "重定向路径") + private String redirect; + + @Schema(description = "路由 props") + private Object props; + + @Schema(description = "路由 meta", requiredMode = Schema.RequiredMode.REQUIRED) + private AuthRouteMetaRespVO meta; + + @Schema(description = "子路由列表") + private List children; + +} diff --git a/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthUserInfoRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthUserInfoRespVO.java new file mode 100644 index 0000000..b271edb --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthUserInfoRespVO.java @@ -0,0 +1,31 @@ +package com.njcn.msgpush.module.system.controller.admin.auth.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +@Schema(description = "管理后台 - 登录用户信息 Response VO") +@Data +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class AuthUserInfoRespVO { + + @Schema(description = "用户 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + private String userId; + + @Schema(description = "用户账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "admin") + private String userName; + + @Schema(description = "角色编码列表", example = "[\"SUPER_ADMIN\"]") + private List roles; + + @Schema(description = "按钮权限码列表", requiredMode = Schema.RequiredMode.REQUIRED, + example = "[\"system:user:add\", \"system:user:update\"]") + private List buttons; + +} diff --git a/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthUserRouteRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthUserRouteRespVO.java new file mode 100644 index 0000000..fee0e02 --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/AuthUserRouteRespVO.java @@ -0,0 +1,24 @@ +package com.njcn.msgpush.module.system.controller.admin.auth.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +@Schema(description = "管理后台 - 用户路由 Response VO") +@Data +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class AuthUserRouteRespVO { + + @Schema(description = "用户可访问路由树", requiredMode = Schema.RequiredMode.REQUIRED) + private List routes; + + @Schema(description = "默认首页路由名", requiredMode = Schema.RequiredMode.REQUIRED, example = "system_user") + private String home; + +} diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/CaptchaVerificationReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/CaptchaVerificationReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/CaptchaVerificationReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/auth/vo/CaptchaVerificationReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/captcha/CaptchaController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/captcha/CaptchaController.java similarity index 99% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/captcha/CaptchaController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/captcha/CaptchaController.java index 54dd382..e4a8c02 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/captcha/CaptchaController.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/captcha/CaptchaController.java @@ -27,6 +27,7 @@ public class CaptchaController { @PostMapping({"/get"}) @Operation(summary = "获得验证码") @PermitAll + public ResponseModel get(@RequestBody CaptchaVO data, HttpServletRequest request) { assert request.getRemoteHost() != null; data.setBrowserInfo(getRemoteId(request)); @@ -36,6 +37,7 @@ public class CaptchaController { @PostMapping("/check") @Operation(summary = "校验验证码") @PermitAll + public ResponseModel check(@RequestBody CaptchaVO data, HttpServletRequest request) { data.setBrowserInfo(getRemoteId(request)); return captchaService.check(data); diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/config/ConfigController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/config/ConfigController.java similarity index 80% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/config/ConfigController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/config/ConfigController.java index 29277a7..f63f3c2 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/config/ConfigController.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/config/ConfigController.java @@ -1,17 +1,17 @@ -package com.njcn.msgpush.module.infra.controller.admin.config; +package com.njcn.msgpush.module.system.controller.admin.config; import com.njcn.msgpush.framework.apilog.core.annotation.ApiAccessLog; import com.njcn.msgpush.framework.common.pojo.CommonResult; import com.njcn.msgpush.framework.common.pojo.PageParam; import com.njcn.msgpush.framework.common.pojo.PageResult; import com.njcn.msgpush.framework.excel.core.util.ExcelUtils; -import com.njcn.msgpush.module.infra.controller.admin.config.vo.ConfigPageReqVO; -import com.njcn.msgpush.module.infra.controller.admin.config.vo.ConfigRespVO; -import com.njcn.msgpush.module.infra.controller.admin.config.vo.ConfigSaveReqVO; -import com.njcn.msgpush.module.infra.convert.config.ConfigConvert; -import com.njcn.msgpush.module.infra.dal.dataobject.config.ConfigDO; -import com.njcn.msgpush.module.infra.enums.ErrorCodeConstants; -import com.njcn.msgpush.module.infra.service.config.ConfigService; +import com.njcn.msgpush.module.system.controller.admin.config.vo.ConfigPageReqVO; +import com.njcn.msgpush.module.system.controller.admin.config.vo.ConfigRespVO; +import com.njcn.msgpush.module.system.controller.admin.config.vo.ConfigSaveReqVO; +import com.njcn.msgpush.module.system.convert.config.ConfigConvert; +import com.njcn.msgpush.module.system.dal.dataobject.config.ConfigDO; +import com.njcn.msgpush.module.system.enums.ErrorCodeConstants; +import com.njcn.msgpush.module.system.service.config.ConfigService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -31,7 +31,7 @@ import static com.njcn.msgpush.framework.common.pojo.CommonResult.success; @Tag(name = "管理后台 - 参数配置") @RestController -@RequestMapping("/infra/config") +@RequestMapping("/system/config") @Validated public class ConfigController { @@ -40,14 +40,14 @@ public class ConfigController { @PostMapping("/create") @Operation(summary = "创建参数配置") - @PreAuthorize("@ss.hasPermission('infra:config:create')") + @PreAuthorize("@ss.hasPermission('system:config:create')") public CommonResult createConfig(@Valid @RequestBody ConfigSaveReqVO createReqVO) { return success(configService.createConfig(createReqVO)); } @PutMapping("/update") @Operation(summary = "修改参数配置") - @PreAuthorize("@ss.hasPermission('infra:config:update')") + @PreAuthorize("@ss.hasPermission('system:config:update')") public CommonResult updateConfig(@Valid @RequestBody ConfigSaveReqVO updateReqVO) { configService.updateConfig(updateReqVO); return success(true); @@ -56,7 +56,7 @@ public class ConfigController { @DeleteMapping("/delete") @Operation(summary = "删除参数配置") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('infra:config:delete')") + @PreAuthorize("@ss.hasPermission('system:config:delete')") public CommonResult deleteConfig(@RequestParam("id") Long id) { configService.deleteConfig(id); return success(true); @@ -65,7 +65,7 @@ public class ConfigController { @DeleteMapping("/delete-list") @Operation(summary = "批量删除参数配置") @Parameter(name = "ids", description = "编号列表", required = true) - @PreAuthorize("@ss.hasPermission('infra:config:delete')") + @PreAuthorize("@ss.hasPermission('system:config:delete')") public CommonResult deleteConfigList(@RequestParam("ids") List ids) { configService.deleteConfigList(ids); return success(true); @@ -74,7 +74,7 @@ public class ConfigController { @GetMapping(value = "/get") @Operation(summary = "获得参数配置") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('infra:config:query')") + @PreAuthorize("@ss.hasPermission('system:config:query')") public CommonResult getConfig(@RequestParam("id") Long id) { return success(ConfigConvert.INSTANCE.convert(configService.getConfig(id))); } @@ -95,7 +95,7 @@ public class ConfigController { @GetMapping("/page") @Operation(summary = "获取参数配置分页") - @PreAuthorize("@ss.hasPermission('infra:config:query')") + @PreAuthorize("@ss.hasPermission('system:config:query')") public CommonResult> getConfigPage(@Valid ConfigPageReqVO pageReqVO) { PageResult page = configService.getConfigPage(pageReqVO); return success(ConfigConvert.INSTANCE.convertPage(page)); @@ -103,7 +103,7 @@ public class ConfigController { @GetMapping("/export-excel") @Operation(summary = "导出参数配置") - @PreAuthorize("@ss.hasPermission('infra:config:export')") + @PreAuthorize("@ss.hasPermission('system:config:export')") @ApiAccessLog(operateType = EXPORT) public void exportConfig(ConfigPageReqVO exportReqVO, HttpServletResponse response) throws IOException { @@ -115,3 +115,4 @@ public class ConfigController { } } + diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/config/vo/ConfigPageReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/config/vo/ConfigPageReqVO.java similarity index 93% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/config/vo/ConfigPageReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/config/vo/ConfigPageReqVO.java index 691ccd5..b6073d3 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/config/vo/ConfigPageReqVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/config/vo/ConfigPageReqVO.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.infra.controller.admin.config.vo; +package com.njcn.msgpush.module.system.controller.admin.config.vo; import com.njcn.msgpush.framework.common.pojo.PageParam; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/config/vo/ConfigRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/config/vo/ConfigRespVO.java similarity index 94% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/config/vo/ConfigRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/config/vo/ConfigRespVO.java index c952a12..aca4a42 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/config/vo/ConfigRespVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/config/vo/ConfigRespVO.java @@ -1,10 +1,10 @@ -package com.njcn.msgpush.module.infra.controller.admin.config.vo; +package com.njcn.msgpush.module.system.controller.admin.config.vo; -import com.njcn.msgpush.framework.excel.core.annotations.DictFormat; -import com.njcn.msgpush.framework.excel.core.convert.DictConvert; -import com.njcn.msgpush.module.infra.enums.DictTypeConstants; import cn.idev.excel.annotation.ExcelIgnoreUnannotated; import cn.idev.excel.annotation.ExcelProperty; +import com.njcn.msgpush.framework.excel.core.annotations.DictFormat; +import com.njcn.msgpush.framework.excel.core.convert.DictConvert; +import com.njcn.msgpush.module.system.enums.DictTypeConstants; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/config/vo/ConfigSaveReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/config/vo/ConfigSaveReqVO.java similarity index 96% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/config/vo/ConfigSaveReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/config/vo/ConfigSaveReqVO.java index 04e01c3..81b13c8 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/config/vo/ConfigSaveReqVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/config/vo/ConfigSaveReqVO.java @@ -1,12 +1,11 @@ -package com.njcn.msgpush.module.infra.controller.admin.config.vo; +package com.njcn.msgpush.module.system.controller.admin.config.vo; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; +import lombok.Data; @Schema(description = "管理后台 - 参数配置创建/修改 Request VO") @Data diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/DeptController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/DeptController.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/DeptController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/DeptController.java diff --git a/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/OrgLeaderRelationController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/OrgLeaderRelationController.java new file mode 100644 index 0000000..1ff9be5 --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/OrgLeaderRelationController.java @@ -0,0 +1,101 @@ +package com.njcn.msgpush.module.system.controller.admin.dept; + +import com.njcn.msgpush.framework.common.pojo.CommonResult; +import com.njcn.msgpush.framework.common.util.object.BeanUtils; +import com.njcn.msgpush.module.system.controller.admin.dept.vo.orgleader.OrgLeaderRelationRespVO; +import com.njcn.msgpush.module.system.controller.admin.dept.vo.orgleader.OrgLeaderRelationSaveReqVO; +import com.njcn.msgpush.module.system.controller.admin.user.vo.user.UserSimpleRespVO; +import com.njcn.msgpush.module.system.convert.user.UserConvert; +import com.njcn.msgpush.module.system.dal.dataobject.dept.DeptDO; +import com.njcn.msgpush.module.system.dal.dataobject.dept.OrgLeaderRelationDO; +import com.njcn.msgpush.module.system.dal.dataobject.user.AdminUserDO; +import com.njcn.msgpush.module.system.service.dept.DeptService; +import com.njcn.msgpush.module.system.service.dept.OrgLeaderRelationService; +import com.njcn.msgpush.module.system.service.user.AdminUserService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import jakarta.validation.Valid; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; +import java.util.Map; + +import static com.njcn.msgpush.framework.common.pojo.CommonResult.success; +import static com.njcn.msgpush.framework.common.util.collection.CollectionUtils.convertList; + +@Tag(name = "管理后台 - 组织负责人关系") +@RestController +@RequestMapping("/system/org-leader") +@Validated +public class OrgLeaderRelationController { + + @Resource + private OrgLeaderRelationService orgLeaderRelationService; + @Resource + private DeptService deptService; + @Resource + private AdminUserService adminUserService; + + @PostMapping("/create") + @Operation(summary = "创建组织负责人关系") + @PreAuthorize("@ss.hasPermission('system:org-leader:create')") + public CommonResult createOrgLeaderRelation(@Valid @RequestBody OrgLeaderRelationSaveReqVO createReqVO) { + return success(orgLeaderRelationService.createOrgLeaderRelation(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "修改组织负责人关系") + @PreAuthorize("@ss.hasPermission('system:org-leader:update')") + public CommonResult updateOrgLeaderRelation(@Valid @RequestBody OrgLeaderRelationSaveReqVO updateReqVO) { + orgLeaderRelationService.updateOrgLeaderRelation(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除组织负责人关系") + @Parameter(name = "id", description = "负责人关系编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('system:org-leader:delete')") + public CommonResult deleteOrgLeaderRelation(@RequestParam("id") Long id) { + orgLeaderRelationService.deleteOrgLeaderRelation(id); + return success(true); + } + + @GetMapping("/list-by-dept") + @Operation(summary = "查询组织下的负责人关系列表") + @Parameter(name = "deptId", description = "组织节点 ID", required = true, example = "100") + @PreAuthorize("@ss.hasPermission('system:org-leader:query')") + public CommonResult> getOrgLeaderRelationListByDept(@RequestParam("deptId") Long deptId) { + List relations = orgLeaderRelationService.getOrgLeaderRelationListByDeptId(deptId); + List respList = BeanUtils.toBean(relations, OrgLeaderRelationRespVO.class); + Map userMap = adminUserService.getUserMap(convertList(relations, OrgLeaderRelationDO::getUserId)); + respList.forEach(respVO -> { + AdminUserDO user = userMap.get(respVO.getUserId()); + if (user != null) { + respVO.setUserNickname(user.getNickname()); + } + }); + return success(respList); + } + + @GetMapping("/candidate-users") + @Operation(summary = "查询组织负责人候选用户列表") + @Parameter(name = "deptId", description = "组织节点 ID", required = true, example = "100") + @PreAuthorize("@ss.hasPermission('system:org-leader:query')") + public CommonResult> getCandidateUsers(@RequestParam("deptId") Long deptId) { + List users = orgLeaderRelationService.getCandidateUsersByDeptId(deptId); + Map deptMap = deptService.getDeptMap(convertList(users, AdminUserDO::getDeptId)); + return success(UserConvert.INSTANCE.convertSimpleList(users, deptMap)); + } + +} diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/PostController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/PostController.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/PostController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/PostController.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptListReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptListReqVO.java similarity index 83% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptListReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptListReqVO.java index 3600740..cec2ce9 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptListReqVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptListReqVO.java @@ -10,6 +10,9 @@ public class DeptListReqVO { @Schema(description = "部门名称,模糊匹配", example = "灿能") private String name; + @Schema(description = "组织节点类型", example = "dept") + private String orgType; + @Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1") private Integer status; diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptRespVO.java similarity index 58% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptRespVO.java index e79e796..f301a6c 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptRespVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptRespVO.java @@ -12,28 +12,31 @@ public class DeptRespVO { @Schema(description = "部门编号", example = "1024") private Long id; - @Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "灿能") + @Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "研发中心") private String name; @Schema(description = "父部门 ID", example = "1024") private Long parentId; + @Schema(description = "组织节点类型", example = "dept") + private String orgType; + + @Schema(description = "组织物化路径", example = "/100/101/103/") + private String path; + + @Schema(description = "组织层级", example = "3") + private Integer level; + + @Schema(description = "组织编码", example = "RD_CENTER") + private String code; + @Schema(description = "显示顺序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") private Integer sort; - @Schema(description = "负责人的用户编号", example = "2048") - private Long leaderUserId; - - @Schema(description = "联系电话", example = "15601691000") - private String phone; - - @Schema(description = "邮箱", example = "msgpush@iocoder.cn") - private String email; - - @Schema(description = "状态,见 CommonStatusEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @Schema(description = "状态,参见 CommonStatusEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") private Integer status; - @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "时间戳格式") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) private LocalDateTime createTime; } diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptSaveReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptSaveReqVO.java similarity index 64% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptSaveReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptSaveReqVO.java index 0cf7797..8288ae5 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptSaveReqVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptSaveReqVO.java @@ -3,7 +3,6 @@ package com.njcn.msgpush.module.system.controller.admin.dept.vo.dept; import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; import com.njcn.msgpush.framework.common.validation.InEnum; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.Email; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; @@ -16,7 +15,7 @@ public class DeptSaveReqVO { @Schema(description = "部门编号", example = "1024") private Long id; - @Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "灿能") + @Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "研发中心") @NotBlank(message = "部门名称不能为空") @Size(max = 30, message = "部门名称长度不能超过 30 个字符") private String name; @@ -24,23 +23,19 @@ public class DeptSaveReqVO { @Schema(description = "父部门 ID", example = "1024") private Long parentId; + @Schema(description = "组织节点类型", example = "dept") + @Size(max = 20, message = "组织节点类型长度不能超过 20 个字符") + private String orgType; + + @Schema(description = "组织编码", example = "RD_CENTER") + @Size(max = 64, message = "组织编码长度不能超过 64 个字符") + private String code; + @Schema(description = "显示顺序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") @NotNull(message = "显示顺序不能为空") private Integer sort; - @Schema(description = "负责人的用户编号", example = "2048") - private Long leaderUserId; - - @Schema(description = "联系电话", example = "15601691000") - @Size(max = 11, message = "联系电话长度不能超过11个字符") - private String phone; - - @Schema(description = "邮箱", example = "msgpush@iocoder.cn") - @Email(message = "邮箱格式不正确") - @Size(max = 50, message = "邮箱长度不能超过 50 个字符") - private String email; - - @Schema(description = "状态,见 CommonStatusEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @Schema(description = "状态,参见 CommonStatusEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotNull(message = "状态不能为空") @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") private Integer status; diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptSimpleRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptSimpleRespVO.java similarity index 88% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptSimpleRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptSimpleRespVO.java index 0657965..b756377 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptSimpleRespVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/dept/DeptSimpleRespVO.java @@ -20,4 +20,7 @@ public class DeptSimpleRespVO { @Schema(description = "父部门 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") private Long parentId; + @Schema(description = "组织节点类型", example = "dept") + private String orgType; + } diff --git a/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/orgleader/OrgLeaderRelationRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/orgleader/OrgLeaderRelationRespVO.java new file mode 100644 index 0000000..12e6d99 --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/orgleader/OrgLeaderRelationRespVO.java @@ -0,0 +1,39 @@ +package com.njcn.msgpush.module.system.controller.admin.dept.vo.orgleader; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 组织负责人关系 Response VO") +@Data +public class OrgLeaderRelationRespVO { + + @Schema(description = "负责人关系编号", example = "1024") + private Long id; + + @Schema(description = "组织节点 ID", example = "100") + private Long deptId; + + @Schema(description = "负责人用户 ID", example = "1") + private Long userId; + + @Schema(description = "负责人用户昵称", example = "管理员") + private String userNickname; + + @Schema(description = "生效开始时间") + private LocalDateTime effectiveFrom; + + @Schema(description = "生效结束时间") + private LocalDateTime effectiveUntil; + + @Schema(description = "备注", example = "部门负责人") + private String remark; + + @Schema(description = "创建时间") + private LocalDateTime createTime; + + @Schema(description = "更新时间") + private LocalDateTime updateTime; + +} diff --git a/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/orgleader/OrgLeaderRelationSaveReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/orgleader/OrgLeaderRelationSaveReqVO.java new file mode 100644 index 0000000..d31a04b --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/orgleader/OrgLeaderRelationSaveReqVO.java @@ -0,0 +1,35 @@ +package com.njcn.msgpush.module.system.controller.admin.dept.vo.orgleader; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import lombok.Data; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 组织负责人关系创建/修改 Request VO") +@Data +public class OrgLeaderRelationSaveReqVO { + + @Schema(description = "负责人关系编号", example = "1024") + private Long id; + + @Schema(description = "组织节点 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "100") + @NotNull(message = "组织节点不能为空") + private Long deptId; + + @Schema(description = "负责人用户 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotNull(message = "负责人用户不能为空") + private Long userId; + + @Schema(description = "生效开始时间") + private LocalDateTime effectiveFrom; + + @Schema(description = "生效结束时间") + private LocalDateTime effectiveUntil; + + @Schema(description = "备注", example = "部门负责人") + @Size(max = 500, message = "备注长度不能超过 500 个字符") + private String remark; + +} diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostPageReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostPageReqVO.java similarity index 79% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostPageReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostPageReqVO.java index e5522de..9a61f58 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostPageReqVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostPageReqVO.java @@ -16,6 +16,12 @@ public class PostPageReqVO extends PageParam { @Schema(description = "岗位名称,模糊匹配", example = "灿能") private String name; + @Schema(description = "岗位类型", example = "technical") + private String postType; + + @Schema(description = "岗位级别", example = "8") + private Integer levelRank; + @Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1") private Integer status; diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostRespVO.java similarity index 77% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostRespVO.java index d2df035..197aeb9 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostRespVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostRespVO.java @@ -1,10 +1,10 @@ package com.njcn.msgpush.module.system.controller.admin.dept.vo.post; +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; +import cn.idev.excel.annotation.ExcelProperty; import com.njcn.msgpush.framework.excel.core.annotations.DictFormat; import com.njcn.msgpush.framework.excel.core.convert.DictConvert; import com.njcn.msgpush.module.system.enums.DictTypeConstants; -import cn.idev.excel.annotation.ExcelIgnoreUnannotated; -import cn.idev.excel.annotation.ExcelProperty; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -19,15 +19,23 @@ public class PostRespVO { @ExcelProperty("岗位序号") private Long id; - @Schema(description = "岗位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "小土豆") + @Schema(description = "岗位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "后端开发工程师") @ExcelProperty("岗位名称") private String name; - @Schema(description = "岗位编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "msgpush") + @Schema(description = "岗位编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "backend") @ExcelProperty("岗位编码") private String code; - @Schema(description = "显示顺序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") + @Schema(description = "岗位类型", example = "technical") + @ExcelProperty("岗位类型") + private String postType; + + @Schema(description = "岗位级别", example = "8") + @ExcelProperty("岗位级别") + private Integer levelRank; + + @Schema(description = "显示顺序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @ExcelProperty("岗位排序") private Integer sort; @@ -36,7 +44,7 @@ public class PostRespVO { @DictFormat(DictTypeConstants.COMMON_STATUS) private Integer status; - @Schema(description = "备注", example = "快乐的备注") + @Schema(description = "备注", example = "技术序列岗位") private String remark; @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostSaveReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostSaveReqVO.java similarity index 66% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostSaveReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostSaveReqVO.java index c696cdd..30020ba 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostSaveReqVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostSaveReqVO.java @@ -3,6 +3,7 @@ package com.njcn.msgpush.module.system.controller.admin.dept.vo.post; import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; import com.njcn.msgpush.framework.common.validation.InEnum; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.Min; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; @@ -15,17 +16,25 @@ public class PostSaveReqVO { @Schema(description = "岗位编号", example = "1024") private Long id; - @Schema(description = "岗位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "小土豆") + @Schema(description = "岗位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "后端开发工程师") @NotBlank(message = "岗位名称不能为空") @Size(max = 50, message = "岗位名称长度不能超过 50 个字符") private String name; - @Schema(description = "岗位编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "msgpush") + @Schema(description = "岗位编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "backend") @NotBlank(message = "岗位编码不能为空") - @Size(max = 64, message = "岗位编码长度不能超过64个字符") + @Size(max = 64, message = "岗位编码长度不能超过 64 个字符") private String code; - @Schema(description = "显示顺序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") + @Schema(description = "岗位类型", example = "technical") + @Size(max = 20, message = "岗位类型长度不能超过 20 个字符") + private String postType; + + @Schema(description = "岗位级别", example = "8") + @Min(value = 0, message = "岗位级别不能小于 0") + private Integer levelRank; + + @Schema(description = "显示顺序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotNull(message = "显示顺序不能为空") private Integer sort; @@ -33,7 +42,7 @@ public class PostSaveReqVO { @InEnum(CommonStatusEnum.class) private Integer status; - @Schema(description = "备注", example = "快乐的备注") + @Schema(description = "备注", example = "技术序列岗位") private String remark; -} \ No newline at end of file +} diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostSimpleRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostSimpleRespVO.java similarity index 64% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostSimpleRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostSimpleRespVO.java index cf8779e..de88ea4 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostSimpleRespVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dept/vo/post/PostSimpleRespVO.java @@ -16,4 +16,16 @@ public class PostSimpleRespVO { @ExcelProperty("岗位名称") private String name; + @Schema(description = "岗位编码", example = "backend") + private String code; + + @Schema(description = "岗位类型", example = "technical") + private String postType; + + @Schema(description = "岗位级别", example = "8") + private Integer levelRank; + + @Schema(description = "岗位排序", example = "1") + private Integer sort; + } diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/DictDataController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/DictDataController.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/DictDataController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/DictDataController.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/DictTypeController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/DictTypeController.java similarity index 98% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/DictTypeController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/DictTypeController.java index 927a51b..a8da971 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/DictTypeController.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/DictTypeController.java @@ -75,6 +75,7 @@ public class DictTypeController { @Operation(summary = "获得字典类型的分页列表") @PreAuthorize("@ss.hasPermission('system:dict:query')") public CommonResult> pageDictTypes(@Valid DictTypePageReqVO pageReqVO) { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); PageResult pageResult = dictTypeService.getDictTypePage(pageReqVO); return success(BeanUtils.toBean(pageResult, DictTypeRespVO.class)); } diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/data/DictDataPageReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/data/DictDataPageReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/data/DictDataPageReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/data/DictDataPageReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/data/DictDataRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/data/DictDataRespVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/data/DictDataRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/data/DictDataRespVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/data/DictDataSaveReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/data/DictDataSaveReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/data/DictDataSaveReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/data/DictDataSaveReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/data/DictDataSimpleRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/data/DictDataSimpleRespVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/data/DictDataSimpleRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/data/DictDataSimpleRespVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/type/DictTypePageReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/type/DictTypePageReqVO.java similarity index 77% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/type/DictTypePageReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/type/DictTypePageReqVO.java index 0f3f303..61b6cf0 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/type/DictTypePageReqVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/type/DictTypePageReqVO.java @@ -5,6 +5,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.util.StringUtils; import jakarta.validation.constraints.Size; import java.time.LocalDateTime; @@ -23,6 +24,10 @@ public class DictTypePageReqVO extends PageParam { @Size(max = 100, message = "字典类型类型长度不能超过100个字符") private String type; + @Schema(description = "字典类型编码,兼容前端 code 查询参数", example = "sys_common_sex") + @Size(max = 100, message = "字典类型编码长度不能超过100个字符") + private String code; + @Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1") private Integer status; @@ -30,4 +35,8 @@ public class DictTypePageReqVO extends PageParam { @Schema(description = "创建时间") private LocalDateTime[] createTime; + public String getTypeKeyword() { + return StringUtils.hasText(code) ? code : type; + } + } diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/type/DictTypeRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/type/DictTypeRespVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/type/DictTypeRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/type/DictTypeRespVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/type/DictTypeSaveReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/type/DictTypeSaveReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/type/DictTypeSaveReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/type/DictTypeSaveReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/type/DictTypeSimpleRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/type/DictTypeSimpleRespVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/type/DictTypeSimpleRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/dict/vo/type/DictTypeSimpleRespVO.java diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/FileConfigController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/FileConfigController.java similarity index 76% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/FileConfigController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/FileConfigController.java index 8fc87bd..b5c67d5 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/FileConfigController.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/FileConfigController.java @@ -1,13 +1,13 @@ -package com.njcn.msgpush.module.infra.controller.admin.file; +package com.njcn.msgpush.module.system.controller.admin.file; import com.njcn.msgpush.framework.common.pojo.CommonResult; import com.njcn.msgpush.framework.common.pojo.PageResult; import com.njcn.msgpush.framework.common.util.object.BeanUtils; -import com.njcn.msgpush.module.infra.controller.admin.file.vo.config.FileConfigPageReqVO; -import com.njcn.msgpush.module.infra.controller.admin.file.vo.config.FileConfigRespVO; -import com.njcn.msgpush.module.infra.controller.admin.file.vo.config.FileConfigSaveReqVO; -import com.njcn.msgpush.module.infra.dal.dataobject.file.FileConfigDO; -import com.njcn.msgpush.module.infra.service.file.FileConfigService; +import com.njcn.msgpush.module.system.controller.admin.file.vo.config.FileConfigPageReqVO; +import com.njcn.msgpush.module.system.controller.admin.file.vo.config.FileConfigRespVO; +import com.njcn.msgpush.module.system.controller.admin.file.vo.config.FileConfigSaveReqVO; +import com.njcn.msgpush.module.system.dal.dataobject.file.FileConfigDO; +import com.njcn.msgpush.module.system.service.file.FileConfigService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -23,7 +23,7 @@ import static com.njcn.msgpush.framework.common.pojo.CommonResult.success; @Tag(name = "管理后台 - 文件配置") @RestController -@RequestMapping("/infra/file-config") +@RequestMapping("/system/file-config") @Validated public class FileConfigController { @@ -32,14 +32,14 @@ public class FileConfigController { @PostMapping("/create") @Operation(summary = "创建文件配置") - @PreAuthorize("@ss.hasPermission('infra:file-config:create')") + @PreAuthorize("@ss.hasPermission('system:file-config:create')") public CommonResult createFileConfig(@Valid @RequestBody FileConfigSaveReqVO createReqVO) { return success(fileConfigService.createFileConfig(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新文件配置") - @PreAuthorize("@ss.hasPermission('infra:file-config:update')") + @PreAuthorize("@ss.hasPermission('system:file-config:update')") public CommonResult updateFileConfig(@Valid @RequestBody FileConfigSaveReqVO updateReqVO) { fileConfigService.updateFileConfig(updateReqVO); return success(true); @@ -47,7 +47,7 @@ public class FileConfigController { @PutMapping("/update-master") @Operation(summary = "更新文件配置为 Master") - @PreAuthorize("@ss.hasPermission('infra:file-config:update')") + @PreAuthorize("@ss.hasPermission('system:file-config:update')") public CommonResult updateFileConfigMaster(@RequestParam("id") Long id) { fileConfigService.updateFileConfigMaster(id); return success(true); @@ -56,7 +56,7 @@ public class FileConfigController { @DeleteMapping("/delete") @Operation(summary = "删除文件配置") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('infra:file-config:delete')") + @PreAuthorize("@ss.hasPermission('system:file-config:delete')") public CommonResult deleteFileConfig(@RequestParam("id") Long id) { fileConfigService.deleteFileConfig(id); return success(true); @@ -65,7 +65,7 @@ public class FileConfigController { @DeleteMapping("/delete-list") @Operation(summary = "批量删除文件配置") @Parameter(name = "ids", description = "编号列表", required = true) - @PreAuthorize("@ss.hasPermission('infra:file-config:delete')") + @PreAuthorize("@ss.hasPermission('system:file-config:delete')") public CommonResult deleteFileConfigList(@RequestParam("ids") List ids) { fileConfigService.deleteFileConfigList(ids); return success(true); @@ -74,7 +74,7 @@ public class FileConfigController { @GetMapping("/get") @Operation(summary = "获得文件配置") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('infra:file-config:query')") + @PreAuthorize("@ss.hasPermission('system:file-config:query')") public CommonResult getFileConfig(@RequestParam("id") Long id) { FileConfigDO config = fileConfigService.getFileConfig(id); return success(BeanUtils.toBean(config, FileConfigRespVO.class)); @@ -82,7 +82,7 @@ public class FileConfigController { @GetMapping("/page") @Operation(summary = "获得文件配置分页") - @PreAuthorize("@ss.hasPermission('infra:file-config:query')") + @PreAuthorize("@ss.hasPermission('system:file-config:query')") public CommonResult> getFileConfigPage(@Valid FileConfigPageReqVO pageVO) { PageResult pageResult = fileConfigService.getFileConfigPage(pageVO); return success(BeanUtils.toBean(pageResult, FileConfigRespVO.class)); @@ -90,9 +90,10 @@ public class FileConfigController { @GetMapping("/test") @Operation(summary = "测试文件配置是否正确") - @PreAuthorize("@ss.hasPermission('infra:file-config:query')") + @PreAuthorize("@ss.hasPermission('system:file-config:query')") public CommonResult testFileConfig(@RequestParam("id") Long id) throws Exception { String url = fileConfigService.testFileConfig(id); return success(url); } } + diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/FileController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/FileController.java similarity index 89% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/FileController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/FileController.java index 0650d36..95d9c1b 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/FileController.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/FileController.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.infra.controller.admin.file; +package com.njcn.msgpush.module.system.controller.admin.file; import cn.hutool.core.io.IoUtil; import cn.hutool.core.util.StrUtil; @@ -6,10 +6,9 @@ import cn.hutool.core.util.URLUtil; import com.njcn.msgpush.framework.common.pojo.CommonResult; import com.njcn.msgpush.framework.common.pojo.PageResult; import com.njcn.msgpush.framework.common.util.object.BeanUtils; - -import com.njcn.msgpush.module.infra.controller.admin.file.vo.file.*; -import com.njcn.msgpush.module.infra.dal.dataobject.file.FileDO; -import com.njcn.msgpush.module.infra.service.file.FileService; +import com.njcn.msgpush.module.system.controller.admin.file.vo.file.*; +import com.njcn.msgpush.module.system.dal.dataobject.file.FileDO; +import com.njcn.msgpush.module.system.service.file.FileService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameters; @@ -31,11 +30,11 @@ import java.nio.charset.StandardCharsets; import java.util.List; import static com.njcn.msgpush.framework.common.pojo.CommonResult.success; -import static com.njcn.msgpush.module.infra.framework.file.core.utils.FileTypeUtils.writeAttachment; +import static com.njcn.msgpush.module.system.framework.file.core.utils.FileTypeUtils.writeAttachment; @Tag(name = "管理后台 - 文件存储") @RestController -@RequestMapping("/infra/file") +@RequestMapping("/system/file") @Validated @Slf4j public class FileController { @@ -75,7 +74,7 @@ public class FileController { @GetMapping("/get") @Operation(summary = "获得文件") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('infra:file:query')") + @PreAuthorize("@ss.hasPermission('system:file:query')") public CommonResult getFile(@RequestParam("id") Long id) { return success(BeanUtils.toBean(fileService.getFile(id), FileRespVO.class)); } @@ -83,7 +82,7 @@ public class FileController { @DeleteMapping("/delete") @Operation(summary = "删除文件") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('infra:file:delete')") + @PreAuthorize("@ss.hasPermission('system:file:delete')") public CommonResult deleteFile(@RequestParam("id") Long id) throws Exception { fileService.deleteFile(id); return success(true); @@ -92,7 +91,7 @@ public class FileController { @DeleteMapping("/delete-list") @Operation(summary = "批量删除文件") @Parameter(name = "ids", description = "编号列表", required = true) - @PreAuthorize("@ss.hasPermission('infra:file:delete')") + @PreAuthorize("@ss.hasPermission('system:file:delete')") public CommonResult deleteFileList(@RequestParam("ids") List ids) throws Exception { fileService.deleteFileList(ids); return success(true); @@ -100,6 +99,7 @@ public class FileController { @GetMapping("/{configId}/get/**") @PermitAll + @Operation(summary = "下载文件") @Parameter(name = "configId", description = "配置编号", required = true) public void getFileContent(HttpServletRequest request, @@ -127,10 +127,11 @@ public class FileController { @GetMapping("/page") @Operation(summary = "获得文件分页") - @PreAuthorize("@ss.hasPermission('infra:file:query')") + @PreAuthorize("@ss.hasPermission('system:file:query')") public CommonResult> getFilePage(@Valid FilePageReqVO pageVO) { PageResult pageResult = fileService.getFilePage(pageVO); return success(BeanUtils.toBean(pageResult, FileRespVO.class)); } } + diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/vo/config/FileConfigPageReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/vo/config/FileConfigPageReqVO.java similarity index 92% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/vo/config/FileConfigPageReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/vo/config/FileConfigPageReqVO.java index 89a77ce..18667a1 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/vo/config/FileConfigPageReqVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/vo/config/FileConfigPageReqVO.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.infra.controller.admin.file.vo.config; +package com.njcn.msgpush.module.system.controller.admin.file.vo.config; import com.njcn.msgpush.framework.common.pojo.PageParam; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/vo/config/FileConfigRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/vo/config/FileConfigRespVO.java similarity index 87% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/vo/config/FileConfigRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/vo/config/FileConfigRespVO.java index 4b24360..01791db 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/vo/config/FileConfigRespVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/vo/config/FileConfigRespVO.java @@ -1,6 +1,6 @@ -package com.njcn.msgpush.module.infra.controller.admin.file.vo.config; +package com.njcn.msgpush.module.system.controller.admin.file.vo.config; -import com.njcn.msgpush.module.infra.framework.file.core.client.FileClientConfig; +import com.njcn.msgpush.module.system.framework.file.core.client.FileClientConfig; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/vo/config/FileConfigSaveReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/vo/config/FileConfigSaveReqVO.java similarity index 93% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/vo/config/FileConfigSaveReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/vo/config/FileConfigSaveReqVO.java index ccf7398..1bb2774 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/vo/config/FileConfigSaveReqVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/vo/config/FileConfigSaveReqVO.java @@ -1,9 +1,9 @@ -package com.njcn.msgpush.module.infra.controller.admin.file.vo.config; +package com.njcn.msgpush.module.system.controller.admin.file.vo.config; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; import lombok.Data; -import jakarta.validation.constraints.NotNull; import java.util.Map; @Schema(description = "管理后台 - 文件配置创建/修改 Request VO") diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/vo/file/FileCreateReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/vo/file/FileCreateReqVO.java similarity index 92% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/vo/file/FileCreateReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/vo/file/FileCreateReqVO.java index f69aa8c..09c6838 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/vo/file/FileCreateReqVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/vo/file/FileCreateReqVO.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.infra.controller.admin.file.vo.file; +package com.njcn.msgpush.module.system.controller.admin.file.vo.file; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; @@ -28,6 +28,6 @@ public class FileCreateReqVO { private String type; @Schema(description = "文件大小", example = "2048", requiredMode = Schema.RequiredMode.REQUIRED) - private Integer size; + private Long size; } diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/vo/file/FilePageReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/vo/file/FilePageReqVO.java similarity index 92% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/vo/file/FilePageReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/vo/file/FilePageReqVO.java index 6b9ac3e..59856a4 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/vo/file/FilePageReqVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/vo/file/FilePageReqVO.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.infra.controller.admin.file.vo.file; +package com.njcn.msgpush.module.system.controller.admin.file.vo.file; import com.njcn.msgpush.framework.common.pojo.PageParam; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/vo/file/FilePresignedUrlRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/vo/file/FilePresignedUrlRespVO.java similarity index 95% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/vo/file/FilePresignedUrlRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/vo/file/FilePresignedUrlRespVO.java index f0cff36..84d196b 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/vo/file/FilePresignedUrlRespVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/vo/file/FilePresignedUrlRespVO.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.infra.controller.admin.file.vo.file; +package com.njcn.msgpush.module.system.controller.admin.file.vo.file; import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/vo/file/FileRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/vo/file/FileRespVO.java similarity index 93% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/vo/file/FileRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/vo/file/FileRespVO.java index cd786ef..e85695e 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/vo/file/FileRespVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/vo/file/FileRespVO.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.infra.controller.admin.file.vo.file; +package com.njcn.msgpush.module.system.controller.admin.file.vo.file; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -28,7 +28,7 @@ public class FileRespVO { private String type; @Schema(description = "文件大小", example = "2048", requiredMode = Schema.RequiredMode.REQUIRED) - private Integer size; + private Long size; @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) private LocalDateTime createTime; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/vo/file/FileUploadReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/vo/file/FileUploadReqVO.java similarity index 94% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/vo/file/FileUploadReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/vo/file/FileUploadReqVO.java index da5a48a..66ca3ce 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/file/vo/file/FileUploadReqVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/file/vo/file/FileUploadReqVO.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.infra.controller.admin.file.vo.file; +package com.njcn.msgpush.module.system.controller.admin.file.vo.file; import cn.hutool.core.util.StrUtil; import com.fasterxml.jackson.annotation.JsonIgnore; diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/ip/AreaController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/ip/AreaController.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/ip/AreaController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/ip/AreaController.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/ip/vo/AreaNodeRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/ip/vo/AreaNodeRespVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/ip/vo/AreaNodeRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/ip/vo/AreaNodeRespVO.java diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/logger/ApiAccessLogController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/ApiAccessLogController.java similarity index 81% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/logger/ApiAccessLogController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/ApiAccessLogController.java index c86f5bc..12f8d64 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/logger/ApiAccessLogController.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/ApiAccessLogController.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.infra.controller.admin.logger; +package com.njcn.msgpush.module.system.controller.admin.logger; import com.njcn.msgpush.framework.apilog.core.annotation.ApiAccessLog; import com.njcn.msgpush.framework.common.pojo.CommonResult; @@ -6,10 +6,10 @@ import com.njcn.msgpush.framework.common.pojo.PageParam; import com.njcn.msgpush.framework.common.pojo.PageResult; import com.njcn.msgpush.framework.common.util.object.BeanUtils; import com.njcn.msgpush.framework.excel.core.util.ExcelUtils; -import com.njcn.msgpush.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogPageReqVO; -import com.njcn.msgpush.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogRespVO; -import com.njcn.msgpush.module.infra.dal.dataobject.logger.ApiAccessLogDO; -import com.njcn.msgpush.module.infra.service.logger.ApiAccessLogService; +import com.njcn.msgpush.module.system.controller.admin.logger.vo.apiaccesslog.ApiAccessLogPageReqVO; +import com.njcn.msgpush.module.system.controller.admin.logger.vo.apiaccesslog.ApiAccessLogRespVO; +import com.njcn.msgpush.module.system.dal.dataobject.logger.ApiAccessLogDO; +import com.njcn.msgpush.module.system.service.logger.ApiAccessLogService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -31,7 +31,7 @@ import static com.njcn.msgpush.framework.common.pojo.CommonResult.success; @Tag(name = "管理后台 - API 访问日志") @RestController -@RequestMapping("/infra/api-access-log") +@RequestMapping("/system/api-access-log") @Validated public class ApiAccessLogController { @@ -41,7 +41,7 @@ public class ApiAccessLogController { @GetMapping("/get") @Operation(summary = "获得 API 访问日志") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('infra:api-access-log:query')") + @PreAuthorize("@ss.hasPermission('system:api-access-log:query')") public CommonResult getApiAccessLog(@RequestParam("id") Long id) { ApiAccessLogDO apiAccessLog = apiAccessLogService.getApiAccessLog(id); return success(BeanUtils.toBean(apiAccessLog, ApiAccessLogRespVO.class)); @@ -49,7 +49,7 @@ public class ApiAccessLogController { @GetMapping("/page") @Operation(summary = "获得API 访问日志分页") - @PreAuthorize("@ss.hasPermission('infra:api-access-log:query')") + @PreAuthorize("@ss.hasPermission('system:api-access-log:query')") public CommonResult> getApiAccessLogPage(@Valid ApiAccessLogPageReqVO pageReqVO) { PageResult pageResult = apiAccessLogService.getApiAccessLogPage(pageReqVO); return success(BeanUtils.toBean(pageResult, ApiAccessLogRespVO.class)); @@ -57,7 +57,7 @@ public class ApiAccessLogController { @GetMapping("/export-excel") @Operation(summary = "导出API 访问日志 Excel") - @PreAuthorize("@ss.hasPermission('infra:api-access-log:export')") + @PreAuthorize("@ss.hasPermission('system:api-access-log:export')") @ApiAccessLog(operateType = EXPORT) public void exportApiAccessLogExcel(@Valid ApiAccessLogPageReqVO exportReqVO, HttpServletResponse response) throws IOException { @@ -69,3 +69,4 @@ public class ApiAccessLogController { } } + diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/logger/ApiErrorLogController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/ApiErrorLogController.java similarity index 82% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/logger/ApiErrorLogController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/ApiErrorLogController.java index 67d3b6b..9736488 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/logger/ApiErrorLogController.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/ApiErrorLogController.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.infra.controller.admin.logger; +package com.njcn.msgpush.module.system.controller.admin.logger; import com.njcn.msgpush.framework.apilog.core.annotation.ApiAccessLog; import com.njcn.msgpush.framework.common.pojo.CommonResult; @@ -6,10 +6,10 @@ import com.njcn.msgpush.framework.common.pojo.PageParam; import com.njcn.msgpush.framework.common.pojo.PageResult; import com.njcn.msgpush.framework.common.util.object.BeanUtils; import com.njcn.msgpush.framework.excel.core.util.ExcelUtils; -import com.njcn.msgpush.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogPageReqVO; -import com.njcn.msgpush.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogRespVO; -import com.njcn.msgpush.module.infra.dal.dataobject.logger.ApiErrorLogDO; -import com.njcn.msgpush.module.infra.service.logger.ApiErrorLogService; +import com.njcn.msgpush.module.system.controller.admin.logger.vo.apierrorlog.ApiErrorLogPageReqVO; +import com.njcn.msgpush.module.system.controller.admin.logger.vo.apierrorlog.ApiErrorLogRespVO; +import com.njcn.msgpush.module.system.dal.dataobject.logger.ApiErrorLogDO; +import com.njcn.msgpush.module.system.service.logger.ApiErrorLogService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameters; @@ -30,7 +30,7 @@ import static com.njcn.msgpush.framework.security.core.util.SecurityFrameworkUti @Tag(name = "管理后台 - API 错误日志") @RestController -@RequestMapping("/infra/api-error-log") +@RequestMapping("/system/api-error-log") @Validated public class ApiErrorLogController { @@ -43,7 +43,7 @@ public class ApiErrorLogController { @Parameter(name = "id", description = "编号", required = true, example = "1024"), @Parameter(name = "processStatus", description = "处理状态", required = true, example = "1") }) - @PreAuthorize("@ss.hasPermission('infra:api-error-log:update-status')") + @PreAuthorize("@ss.hasPermission('system:api-error-log:update-status')") public CommonResult updateApiErrorLogProcess(@RequestParam("id") Long id, @RequestParam("processStatus") Integer processStatus) { apiErrorLogService.updateApiErrorLogProcess(id, processStatus, getLoginUserId()); @@ -53,7 +53,7 @@ public class ApiErrorLogController { @GetMapping("/get") @Operation(summary = "获得 API 错误日志") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('infra:api-error-log:query')") + @PreAuthorize("@ss.hasPermission('system:api-error-log:query')") public CommonResult getApiErrorLog(@RequestParam("id") Long id) { ApiErrorLogDO apiErrorLog = apiErrorLogService.getApiErrorLog(id); return success(BeanUtils.toBean(apiErrorLog, ApiErrorLogRespVO.class)); @@ -61,7 +61,7 @@ public class ApiErrorLogController { @GetMapping("/page") @Operation(summary = "获得 API 错误日志分页") - @PreAuthorize("@ss.hasPermission('infra:api-error-log:query')") + @PreAuthorize("@ss.hasPermission('system:api-error-log:query')") public CommonResult> getApiErrorLogPage(@Valid ApiErrorLogPageReqVO pageReqVO) { PageResult pageResult = apiErrorLogService.getApiErrorLogPage(pageReqVO); return success(BeanUtils.toBean(pageResult, ApiErrorLogRespVO.class)); @@ -69,7 +69,7 @@ public class ApiErrorLogController { @GetMapping("/export-excel") @Operation(summary = "导出 API 错误日志 Excel") - @PreAuthorize("@ss.hasPermission('infra:api-error-log:export')") + @PreAuthorize("@ss.hasPermission('system:api-error-log:export')") @ApiAccessLog(operateType = EXPORT) public void exportApiErrorLogExcel(@Valid ApiErrorLogPageReqVO exportReqVO, HttpServletResponse response) throws IOException { @@ -81,3 +81,4 @@ public class ApiErrorLogController { } } + diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/LoginLogController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/LoginLogController.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/LoginLogController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/LoginLogController.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/OperateLogController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/OperateLogController.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/OperateLogController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/OperateLogController.java diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogPageReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/apiaccesslog/ApiAccessLogPageReqVO.java similarity index 94% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogPageReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/apiaccesslog/ApiAccessLogPageReqVO.java index 8352aa9..93d6baa 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogPageReqVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/apiaccesslog/ApiAccessLogPageReqVO.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.infra.controller.admin.logger.vo.apiaccesslog; +package com.njcn.msgpush.module.system.controller.admin.logger.vo.apiaccesslog; import com.njcn.msgpush.framework.common.pojo.PageParam; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/apiaccesslog/ApiAccessLogRespVO.java similarity index 92% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/apiaccesslog/ApiAccessLogRespVO.java index 5dc8514..3e9c5e0 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogRespVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/apiaccesslog/ApiAccessLogRespVO.java @@ -1,10 +1,10 @@ -package com.njcn.msgpush.module.infra.controller.admin.logger.vo.apiaccesslog; +package com.njcn.msgpush.module.system.controller.admin.logger.vo.apiaccesslog; -import com.njcn.msgpush.framework.excel.core.annotations.DictFormat; -import com.njcn.msgpush.framework.excel.core.convert.DictConvert; -import com.njcn.msgpush.module.infra.enums.DictTypeConstants; import cn.idev.excel.annotation.ExcelIgnoreUnannotated; import cn.idev.excel.annotation.ExcelProperty; +import com.njcn.msgpush.framework.excel.core.annotations.DictFormat; +import com.njcn.msgpush.framework.excel.core.convert.DictConvert; +import com.njcn.msgpush.module.system.enums.DictTypeConstants; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -70,7 +70,7 @@ public class ApiAccessLogRespVO { @Schema(description = "操作分类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @ExcelProperty(value = "操作分类", converter = DictConvert.class) - @DictFormat(com.njcn.msgpush.module.infra.enums.DictTypeConstants.OPERATE_TYPE) + @DictFormat(DictTypeConstants.OPERATE_TYPE) private Integer operateType; @Schema(description = "开始请求时间", requiredMode = Schema.RequiredMode.REQUIRED) @@ -89,7 +89,7 @@ public class ApiAccessLogRespVO { @ExcelProperty("结果码") private Integer resultCode; - @Schema(description = "结果提示", example = "灿能源码,牛逼!") + @Schema(description = "结果提示", example = "灿能,牛逼!") @ExcelProperty("结果提示") private String resultMsg; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogPageReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/apierrorlog/ApiErrorLogPageReqVO.java similarity index 93% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogPageReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/apierrorlog/ApiErrorLogPageReqVO.java index 299f8f5..87fd59c 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogPageReqVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/apierrorlog/ApiErrorLogPageReqVO.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.infra.controller.admin.logger.vo.apierrorlog; +package com.njcn.msgpush.module.system.controller.admin.logger.vo.apierrorlog; import com.njcn.msgpush.framework.common.pojo.PageParam; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/apierrorlog/ApiErrorLogRespVO.java similarity index 97% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/apierrorlog/ApiErrorLogRespVO.java index 4ecaa70..265685d 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogRespVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/apierrorlog/ApiErrorLogRespVO.java @@ -1,10 +1,10 @@ -package com.njcn.msgpush.module.infra.controller.admin.logger.vo.apierrorlog; +package com.njcn.msgpush.module.system.controller.admin.logger.vo.apierrorlog; -import com.njcn.msgpush.framework.excel.core.annotations.DictFormat; -import com.njcn.msgpush.framework.excel.core.convert.DictConvert; -import com.njcn.msgpush.module.infra.enums.DictTypeConstants; import cn.idev.excel.annotation.ExcelIgnoreUnannotated; import cn.idev.excel.annotation.ExcelProperty; +import com.njcn.msgpush.framework.excel.core.annotations.DictFormat; +import com.njcn.msgpush.framework.excel.core.convert.DictConvert; +import com.njcn.msgpush.module.system.enums.DictTypeConstants; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/loginlog/LoginLogPageReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/loginlog/LoginLogPageReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/loginlog/LoginLogPageReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/loginlog/LoginLogPageReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/loginlog/LoginLogRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/loginlog/LoginLogRespVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/loginlog/LoginLogRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/loginlog/LoginLogRespVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/operatelog/OperateLogPageReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/operatelog/OperateLogPageReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/operatelog/OperateLogPageReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/operatelog/OperateLogPageReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/operatelog/OperateLogRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/operatelog/OperateLogRespVO.java similarity index 98% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/operatelog/OperateLogRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/operatelog/OperateLogRespVO.java index 710589e..7dbd4c5 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/operatelog/OperateLogRespVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/logger/vo/operatelog/OperateLogRespVO.java @@ -29,7 +29,7 @@ public class OperateLogRespVO implements VO { @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") @Trans(type = TransType.SIMPLE, target = AdminUserDO.class, fields = "nickname", ref = "userName") private Long userId; - @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "awen") @ExcelProperty("操作人") private String userName; diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notice/NoticeController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notice/NoticeController.java similarity index 94% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notice/NoticeController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notice/NoticeController.java index 61e279b..f6be009 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notice/NoticeController.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notice/NoticeController.java @@ -1,16 +1,16 @@ package com.njcn.msgpush.module.system.controller.admin.notice; import cn.hutool.core.lang.Assert; -import com.njcn.msgpush.framework.common.enums.UserTypeEnum; import com.njcn.msgpush.framework.common.pojo.CommonResult; import com.njcn.msgpush.framework.common.pojo.PageResult; import com.njcn.msgpush.framework.common.util.object.BeanUtils; -import com.njcn.msgpush.module.infra.api.websocket.WebSocketSenderApi; import com.njcn.msgpush.module.system.controller.admin.notice.vo.NoticePageReqVO; import com.njcn.msgpush.module.system.controller.admin.notice.vo.NoticeRespVO; import com.njcn.msgpush.module.system.controller.admin.notice.vo.NoticeSaveReqVO; import com.njcn.msgpush.module.system.dal.dataobject.notice.NoticeDO; import com.njcn.msgpush.module.system.service.notice.NoticeService; +import com.njcn.msgpush.framework.common.enums.UserTypeEnum; +import com.njcn.msgpush.framework.websocket.core.sender.WebSocketMessageSender; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -34,7 +34,7 @@ public class NoticeController { private NoticeService noticeService; @Resource - private WebSocketSenderApi webSocketSenderApi; + private WebSocketMessageSender webSocketMessageSender; @PostMapping("/create") @Operation(summary = "创建通知公告") @@ -95,7 +95,7 @@ public class NoticeController { NoticeDO notice = noticeService.getNotice(id); Assert.notNull(notice, "公告不能为空"); // 通过 websocket 推送给在线的用户 - webSocketSenderApi.sendObject(UserTypeEnum.ADMIN.getValue(), "notice-push", notice); + webSocketMessageSender.sendObject(UserTypeEnum.ADMIN.getValue(), "notice-push", notice); return success(true); } diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notice/vo/NoticePageReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notice/vo/NoticePageReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notice/vo/NoticePageReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notice/vo/NoticePageReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notice/vo/NoticeRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notice/vo/NoticeRespVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notice/vo/NoticeRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notice/vo/NoticeRespVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notice/vo/NoticeSaveReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notice/vo/NoticeSaveReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notice/vo/NoticeSaveReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notice/vo/NoticeSaveReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/NotifyMessageController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/NotifyMessageController.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/NotifyMessageController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/NotifyMessageController.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/NotifyTemplateController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/NotifyTemplateController.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/NotifyTemplateController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/NotifyTemplateController.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/message/NotifyMessageMyPageReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/message/NotifyMessageMyPageReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/message/NotifyMessageMyPageReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/message/NotifyMessageMyPageReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/message/NotifyMessagePageReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/message/NotifyMessagePageReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/message/NotifyMessagePageReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/message/NotifyMessagePageReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/message/NotifyMessageRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/message/NotifyMessageRespVO.java similarity index 97% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/message/NotifyMessageRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/message/NotifyMessageRespVO.java index e1e5217..e160ad7 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/message/NotifyMessageRespVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/message/NotifyMessageRespVO.java @@ -25,7 +25,7 @@ public class NotifyMessageRespVO { @Schema(description = "模板编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "test_01") private String templateCode; - @Schema(description = "模版发送人名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @Schema(description = "模版发送人名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "awen") private String templateNickname; @Schema(description = "模版内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "测试内容") diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/template/NotifyTemplatePageReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/template/NotifyTemplatePageReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/template/NotifyTemplatePageReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/template/NotifyTemplatePageReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/template/NotifyTemplateRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/template/NotifyTemplateRespVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/template/NotifyTemplateRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/template/NotifyTemplateRespVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/template/NotifyTemplateSaveReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/template/NotifyTemplateSaveReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/template/NotifyTemplateSaveReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/template/NotifyTemplateSaveReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/template/NotifyTemplateSendReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/template/NotifyTemplateSendReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/template/NotifyTemplateSendReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/notify/vo/template/NotifyTemplateSendReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/OAuth2ClientController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/OAuth2ClientController.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/OAuth2ClientController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/OAuth2ClientController.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/OAuth2OpenController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/OAuth2OpenController.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/OAuth2OpenController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/OAuth2OpenController.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/OAuth2TokenController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/OAuth2TokenController.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/OAuth2TokenController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/OAuth2TokenController.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/OAuth2UserController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/OAuth2UserController.java similarity index 79% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/OAuth2UserController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/OAuth2UserController.java index ea76b2a..c631060 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/OAuth2UserController.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/OAuth2UserController.java @@ -1,6 +1,5 @@ package com.njcn.msgpush.module.system.controller.admin.oauth2; -import cn.hutool.core.collection.CollUtil; import com.njcn.msgpush.framework.common.pojo.CommonResult; import com.njcn.msgpush.framework.common.util.object.BeanUtils; import com.njcn.msgpush.module.system.controller.admin.oauth2.vo.user.OAuth2UserInfoRespVO; @@ -14,14 +13,16 @@ import com.njcn.msgpush.module.system.service.dept.PostService; import com.njcn.msgpush.module.system.service.user.AdminUserService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import jakarta.validation.Valid; import lombok.extern.slf4j.Slf4j; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import jakarta.annotation.Resource; -import jakarta.validation.Valid; -import java.util.List; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; import static com.njcn.msgpush.framework.common.pojo.CommonResult.success; import static com.njcn.msgpush.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; @@ -50,20 +51,23 @@ public class OAuth2UserController { @GetMapping("/get") @Operation(summary = "获得用户基本信息") - @PreAuthorize("@ss.hasScope('user.read')") // + @PreAuthorize("@ss.hasScope('user.read')") public CommonResult getUserInfo() { // 获得用户基本信息 AdminUserDO user = userService.getUser(getLoginUserId()); + if (user == null) { + return success(null); + } OAuth2UserInfoRespVO resp = BeanUtils.toBean(user, OAuth2UserInfoRespVO.class); // 获得部门信息 if (user.getDeptId() != null) { DeptDO dept = deptService.getDept(user.getDeptId()); resp.setDept(BeanUtils.toBean(dept, OAuth2UserInfoRespVO.Dept.class)); } - // 获得岗位信息 - if (CollUtil.isNotEmpty(user.getPostIds())) { - List posts = postService.getPostList(user.getPostIds()); - resp.setPosts(BeanUtils.toBean(posts, OAuth2UserInfoRespVO.Post.class)); + // 获得主岗位信息 + if (user.getPositionId() != null) { + PostDO position = postService.getPost(user.getPositionId()); + resp.setPosition(BeanUtils.toBean(position, OAuth2UserInfoRespVO.Post.class)); } return success(resp); } @@ -72,8 +76,7 @@ public class OAuth2UserController { @Operation(summary = "更新用户基本信息") @PreAuthorize("@ss.hasScope('user.write')") public CommonResult updateUserInfo(@Valid @RequestBody OAuth2UserUpdateReqVO reqVO) { - // 这里将 UserProfileUpdateReqVO =》UserProfileUpdateReqVO 对象,实现接口的复用。 - // 主要是,AdminUserService 没有自己的 BO 对象,所以复用只能这么做 + // 这里将 OAuth2UserUpdateReqVO 转成 UserProfileUpdateReqVO,实现接口复用 userService.updateUserProfile(getLoginUserId(), BeanUtils.toBean(reqVO, UserProfileUpdateReqVO.class)); return success(true); } diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/client/OAuth2ClientPageReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/client/OAuth2ClientPageReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/client/OAuth2ClientPageReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/client/OAuth2ClientPageReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/client/OAuth2ClientRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/client/OAuth2ClientRespVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/client/OAuth2ClientRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/client/OAuth2ClientRespVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/client/OAuth2ClientSaveReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/client/OAuth2ClientSaveReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/client/OAuth2ClientSaveReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/client/OAuth2ClientSaveReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/open/OAuth2OpenAccessTokenRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/open/OAuth2OpenAccessTokenRespVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/open/OAuth2OpenAccessTokenRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/open/OAuth2OpenAccessTokenRespVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/open/OAuth2OpenAuthorizeInfoRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/open/OAuth2OpenAuthorizeInfoRespVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/open/OAuth2OpenAuthorizeInfoRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/open/OAuth2OpenAuthorizeInfoRespVO.java diff --git a/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/open/OAuth2OpenCheckTokenRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/open/OAuth2OpenCheckTokenRespVO.java new file mode 100644 index 0000000..5c37ce7 --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/open/OAuth2OpenCheckTokenRespVO.java @@ -0,0 +1,39 @@ +package com.njcn.msgpush.module.system.controller.admin.oauth2.vo.open; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +@Schema(description = "Admin API - open check token response") +@Data +@NoArgsConstructor +@AllArgsConstructor +public class OAuth2OpenCheckTokenRespVO { + + @Schema(description = "User id", requiredMode = Schema.RequiredMode.REQUIRED, example = "666") + @JsonProperty("user_id") + private Long userId; + + @Schema(description = "User type", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @JsonProperty("user_type") + private Integer userType; + + @Schema(description = "Client id", requiredMode = Schema.RequiredMode.REQUIRED, example = "car") + @JsonProperty("client_id") + private String clientId; + + @Schema(description = "Scopes", requiredMode = Schema.RequiredMode.REQUIRED, example = "user_info") + private List scopes; + + @Schema(description = "Access token", requiredMode = Schema.RequiredMode.REQUIRED, example = "tudou") + @JsonProperty("access_token") + private String accessToken; + + @Schema(description = "Expire timestamp in seconds", requiredMode = Schema.RequiredMode.REQUIRED, example = "1593092157") + private Long exp; + +} diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/token/OAuth2AccessTokenPageReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/token/OAuth2AccessTokenPageReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/token/OAuth2AccessTokenPageReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/token/OAuth2AccessTokenPageReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/token/OAuth2AccessTokenRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/token/OAuth2AccessTokenRespVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/token/OAuth2AccessTokenRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/token/OAuth2AccessTokenRespVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/user/OAuth2UserInfoRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/user/OAuth2UserInfoRespVO.java similarity index 94% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/user/OAuth2UserInfoRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/user/OAuth2UserInfoRespVO.java index 2dd2813..3edaca8 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/user/OAuth2UserInfoRespVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/user/OAuth2UserInfoRespVO.java @@ -5,8 +5,6 @@ import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; -import java.util.List; - @Schema(description = "管理后台 - OAuth2 获得用户基本信息 Response VO") @Data @NoArgsConstructor @@ -16,7 +14,7 @@ public class OAuth2UserInfoRespVO { @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") private Long id; - @Schema(description = "用户账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @Schema(description = "用户账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "awen") private String username; @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "灿能") @@ -24,6 +22,7 @@ public class OAuth2UserInfoRespVO { @Schema(description = "用户邮箱", example = "msgpush@iocoder.cn") private String email; + @Schema(description = "手机号码", example = "15601691300") private String mobile; @@ -39,9 +38,9 @@ public class OAuth2UserInfoRespVO { private Dept dept; /** - * 所属岗位数组 + * 主岗位 */ - private List posts; + private Post position; @Schema(description = "部门") @Data diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/user/OAuth2UserUpdateReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/user/OAuth2UserUpdateReqVO.java similarity index 96% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/user/OAuth2UserUpdateReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/user/OAuth2UserUpdateReqVO.java index d9b76e1..5cfd374 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/user/OAuth2UserUpdateReqVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/oauth2/vo/user/OAuth2UserUpdateReqVO.java @@ -15,7 +15,7 @@ import jakarta.validation.constraints.Size; @AllArgsConstructor public class OAuth2UserUpdateReqVO { - @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "awen") @Size(max = 30, message = "用户昵称长度不能超过 30 个字符") private String nickname; diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/MenuController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/MenuController.java similarity index 76% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/MenuController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/MenuController.java index ee180f9..2367a2d 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/MenuController.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/MenuController.java @@ -16,7 +16,14 @@ import jakarta.annotation.Resource; import jakarta.validation.Valid; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; import java.util.Comparator; import java.util.List; @@ -50,7 +57,7 @@ public class MenuController { @DeleteMapping("/delete") @Operation(summary = "删除菜单") - @Parameter(name = "id", description = "菜单编号", required= true, example = "1024") + @Parameter(name = "id", description = "菜单编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:menu:delete')") public CommonResult deleteMenu(@RequestParam("id") Long id) { menuService.deleteMenu(id); @@ -75,6 +82,15 @@ public class MenuController { return success(BeanUtils.toBean(list, MenuRespVO.class)); } + @GetMapping("/simple-list") + @Operation(summary = "获取菜单精简信息列表", description = "只包含已启用的菜单,用于【角色分配菜单】功能的选项") + public CommonResult> getSimpleMenuList() { + List list = menuService.getMenuList(new MenuListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus())); + list = menuService.filterDisableMenus(list); + list.sort(Comparator.comparing(MenuDO::getSort)); + return success(BeanUtils.toBean(list, MenuSimpleRespVO.class)); + } + @GetMapping("/get") @Operation(summary = "获取菜单信息") @PreAuthorize("@ss.hasPermission('system:menu:query')") diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/PermissionController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/PermissionController.java similarity index 81% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/PermissionController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/PermissionController.java index 9a11e88..1a633bb 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/PermissionController.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/PermissionController.java @@ -1,11 +1,10 @@ package com.njcn.msgpush.module.system.controller.admin.permission; -import cn.hutool.core.collection.CollUtil; import com.njcn.msgpush.framework.common.pojo.CommonResult; -import com.njcn.msgpush.module.system.controller.admin.permission.vo.permission.PermissionAssignRoleDataScopeReqVO; import com.njcn.msgpush.module.system.controller.admin.permission.vo.permission.PermissionAssignRoleMenuReqVO; import com.njcn.msgpush.module.system.controller.admin.permission.vo.permission.PermissionAssignUserRoleReqVO; import com.njcn.msgpush.module.system.service.permission.PermissionService; + import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -14,7 +13,6 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; -import jakarta.validation.Valid; import java.util.Set; import static com.njcn.msgpush.framework.common.pojo.CommonResult.success; @@ -32,6 +30,7 @@ public class PermissionController { @Resource private PermissionService permissionService; + @Operation(summary = "获得角色拥有的菜单编号") @Parameter(name = "roleId", description = "角色编号", required = true) @GetMapping("/list-role-menus") @@ -49,14 +48,6 @@ public class PermissionController { return success(true); } - @PostMapping("/assign-role-data-scope") - @Operation(summary = "赋予角色数据权限") - @PreAuthorize("@ss.hasPermission('system:permission:assign-role-data-scope')") - public CommonResult assignRoleDataScope(@Valid @RequestBody PermissionAssignRoleDataScopeReqVO reqVO) { - permissionService.assignRoleDataScope(reqVO.getRoleId(), reqVO.getDataScope(), reqVO.getDataScopeDeptIds()); - return success(true); - } - @Operation(summary = "获得管理员拥有的角色编号列表") @Parameter(name = "userId", description = "用户编号", required = true) @GetMapping("/list-user-roles") diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/RoleController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/RoleController.java similarity index 98% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/RoleController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/RoleController.java index e93629c..ecfef43 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/RoleController.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/RoleController.java @@ -84,11 +84,12 @@ public class RoleController { @Operation(summary = "获得角色分页") @PreAuthorize("@ss.hasPermission('system:role:query')") public CommonResult> getRolePage(RolePageReqVO pageReqVO) { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); PageResult pageResult = roleService.getRolePage(pageReqVO); return success(BeanUtils.toBean(pageResult, RoleRespVO.class)); } - @GetMapping({"/list-all-simple", "/simple-list"}) + @GetMapping("/simple-list") @Operation(summary = "获取角色精简信息列表", description = "只包含被开启的角色,主要用于前端的下拉选项") public CommonResult> getSimpleRoleList() { List list = roleService.getRoleListByStatus(singleton(CommonStatusEnum.ENABLE.getStatus())); diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/menu/MenuListReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/menu/MenuListReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/menu/MenuListReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/menu/MenuListReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/menu/MenuRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/menu/MenuRespVO.java similarity index 91% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/menu/MenuRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/menu/MenuRespVO.java index dc832a7..b6cf204 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/menu/MenuRespVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/menu/MenuRespVO.java @@ -50,6 +50,12 @@ public class MenuRespVO { @Schema(description = "组件名", example = "SystemUser") private String componentName; + @Schema(description = "路由类型,例如 dir/view/single/iframe", example = "view") + private String routeKind; + + @Schema(description = "路由 props JSON 字符串", example = "{\"url\":\"https://cn.vuejs.org/\"}") + private String routePropsJson; + @Schema(description = "状态,见 CommonStatusEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotNull(message = "状态不能为空") private Integer status; diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/menu/MenuSaveVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/menu/MenuSaveVO.java similarity index 88% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/menu/MenuSaveVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/menu/MenuSaveVO.java index 2984b93..fb7a09e 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/menu/MenuSaveVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/menu/MenuSaveVO.java @@ -48,6 +48,13 @@ public class MenuSaveVO { @Schema(description = "组件名", example = "SystemUser") private String componentName; + @Schema(description = "路由类型,例如 dir/view/single/iframe", example = "view") + @Size(max = 32, message = "路由类型长度不能超过32个字符") + private String routeKind; + + @Schema(description = "路由 props JSON 字符串", example = "{\"url\":\"https://cn.vuejs.org/\"}") + private String routePropsJson; + @Schema(description = "状态,见 CommonStatusEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotNull(message = "状态不能为空") private Integer status; diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/menu/MenuSimpleRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/menu/MenuSimpleRespVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/menu/MenuSimpleRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/menu/MenuSimpleRespVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/permission/PermissionAssignRoleMenuReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/permission/PermissionAssignRoleMenuReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/permission/PermissionAssignRoleMenuReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/permission/PermissionAssignRoleMenuReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/permission/PermissionAssignUserRoleReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/permission/PermissionAssignUserRoleReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/permission/PermissionAssignUserRoleReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/permission/PermissionAssignUserRoleReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/role/RolePageReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/role/RolePageReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/role/RolePageReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/role/RolePageReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/role/RoleRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/role/RoleRespVO.java similarity index 82% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/role/RoleRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/role/RoleRespVO.java index 8cdba8c..6bcbe7a 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/role/RoleRespVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/role/RoleRespVO.java @@ -10,7 +10,6 @@ import jakarta.validation.constraints.NotBlank; import lombok.Data; import java.time.LocalDateTime; -import java.util.Set; @Schema(description = "管理后台 - 角色信息 Response VO") @Data @@ -45,14 +44,6 @@ public class RoleRespVO { @Schema(description = "备注", example = "我是一个角色") private String remark; - @Schema(description = "数据范围,参见 DataScopeEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @ExcelProperty(value = "数据范围", converter = DictConvert.class) - @DictFormat(DictTypeConstants.DATA_SCOPE) - private Integer dataScope; - - @Schema(description = "数据范围(指定部门数组)", example = "1") - private Set dataScopeDeptIds; - @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "时间戳格式") private LocalDateTime createTime; diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/role/RoleSaveReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/role/RoleSaveReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/role/RoleSaveReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/role/RoleSaveReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/role/RoleSimpleRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/role/RoleSimpleRespVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/role/RoleSimpleRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/permission/vo/role/RoleSimpleRespVO.java diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/redis/RedisController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/redis/RedisController.java similarity index 83% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/redis/RedisController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/redis/RedisController.java index c3379de..36e4cb2 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/redis/RedisController.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/redis/RedisController.java @@ -1,10 +1,11 @@ -package com.njcn.msgpush.module.infra.controller.admin.redis; +package com.njcn.msgpush.module.system.controller.admin.redis; import com.njcn.msgpush.framework.common.pojo.CommonResult; -import com.njcn.msgpush.module.infra.controller.admin.redis.vo.RedisMonitorRespVO; -import com.njcn.msgpush.module.infra.convert.redis.RedisConvert; +import com.njcn.msgpush.module.system.controller.admin.redis.vo.RedisMonitorRespVO; +import com.njcn.msgpush.module.system.convert.redis.RedisConvert; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; import org.springframework.data.redis.connection.RedisServerCommands; import org.springframework.data.redis.core.RedisCallback; import org.springframework.data.redis.core.StringRedisTemplate; @@ -13,14 +14,13 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import jakarta.annotation.Resource; import java.util.Properties; import static com.njcn.msgpush.framework.common.pojo.CommonResult.success; @Tag(name = "管理后台 - Redis 监控") @RestController -@RequestMapping("/infra/redis") +@RequestMapping("/system/redis") public class RedisController { @Resource @@ -28,7 +28,7 @@ public class RedisController { @GetMapping("/get-monitor-info") @Operation(summary = "获得 Redis 监控信息") - @PreAuthorize("@ss.hasPermission('infra:redis:get-monitor-info')") + @PreAuthorize("@ss.hasPermission('system:redis:get-monitor-info')") public CommonResult getRedisMonitorInfo() { // 获得 Redis 统计信息 Properties info = stringRedisTemplate.execute((RedisCallback) RedisServerCommands::info); @@ -41,3 +41,4 @@ public class RedisController { } } + diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/redis/vo/RedisMonitorRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/redis/vo/RedisMonitorRespVO.java similarity index 95% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/redis/vo/RedisMonitorRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/redis/vo/RedisMonitorRespVO.java index 201d40d..882bc3e 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/admin/redis/vo/RedisMonitorRespVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/redis/vo/RedisMonitorRespVO.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.infra.controller.admin.redis.vo; +package com.njcn.msgpush.module.system.controller.admin.redis.vo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/UserController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/UserController.java similarity index 73% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/UserController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/UserController.java index 22e9550..71705d1 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/UserController.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/UserController.java @@ -6,13 +6,23 @@ import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; import com.njcn.msgpush.framework.common.pojo.CommonResult; import com.njcn.msgpush.framework.common.pojo.PageParam; import com.njcn.msgpush.framework.common.pojo.PageResult; +import com.njcn.msgpush.framework.encrypt.core.annotation.ApiEncrypt; import com.njcn.msgpush.framework.excel.core.util.ExcelUtils; -import com.njcn.msgpush.module.system.controller.admin.user.vo.user.*; +import com.njcn.msgpush.module.system.controller.admin.user.vo.user.UserImportExcelVO; +import com.njcn.msgpush.module.system.controller.admin.user.vo.user.UserImportRespVO; +import com.njcn.msgpush.module.system.controller.admin.user.vo.user.UserPageReqVO; +import com.njcn.msgpush.module.system.controller.admin.user.vo.user.UserRespVO; +import com.njcn.msgpush.module.system.controller.admin.user.vo.user.UserSaveReqVO; +import com.njcn.msgpush.module.system.controller.admin.user.vo.user.UserSimpleRespVO; +import com.njcn.msgpush.module.system.controller.admin.user.vo.user.UserUpdatePasswordReqVO; +import com.njcn.msgpush.module.system.controller.admin.user.vo.user.UserUpdateStatusReqVO; import com.njcn.msgpush.module.system.convert.user.UserConvert; import com.njcn.msgpush.module.system.dal.dataobject.dept.DeptDO; +import com.njcn.msgpush.module.system.dal.dataobject.dept.PostDO; import com.njcn.msgpush.module.system.dal.dataobject.user.AdminUserDO; import com.njcn.msgpush.module.system.enums.common.SexEnum; import com.njcn.msgpush.module.system.service.dept.DeptService; +import com.njcn.msgpush.module.system.service.dept.PostService; import com.njcn.msgpush.module.system.service.user.AdminUserService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -23,7 +33,14 @@ import jakarta.servlet.http.HttpServletResponse; import jakarta.validation.Valid; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; @@ -45,10 +62,13 @@ public class UserController { private AdminUserService userService; @Resource private DeptService deptService; + @Resource + private PostService postService; @PostMapping("/create") @Operation(summary = "新增用户") @PreAuthorize("@ss.hasPermission('system:user:create')") + @ApiEncrypt(response = false, requestFields = {"password"}) public CommonResult createUser(@Valid @RequestBody UserSaveReqVO reqVO) { Long id = userService.createUser(reqVO); return success(id); @@ -83,6 +103,7 @@ public class UserController { @PutMapping("/update-password") @Operation(summary = "重置用户密码") @PreAuthorize("@ss.hasPermission('system:user:update-password')") + @ApiEncrypt(response = false, requestFields = {"password"}) public CommonResult updateUserPassword(@Valid @RequestBody UserUpdatePasswordReqVO reqVO) { userService.updateUserPassword(reqVO.getId(), reqVO.getPassword()); return success(true); @@ -105,11 +126,10 @@ public class UserController { if (CollUtil.isEmpty(pageResult.getList())) { return success(new PageResult<>(pageResult.getTotal())); } - // 拼接数据 - Map deptMap = deptService.getDeptMap( - convertList(pageResult.getList(), AdminUserDO::getDeptId)); - return success(new PageResult<>(UserConvert.INSTANCE.convertList(pageResult.getList(), deptMap), - pageResult.getTotal())); + // 拼接部门、主岗位信息 + Map deptMap = deptService.getDeptMap(convertList(pageResult.getList(), AdminUserDO::getDeptId)); + Map postMap = postService.getPostMap(convertList(pageResult.getList(), AdminUserDO::getPositionId)); + return success(new PageResult<>(UserConvert.INSTANCE.convertList(pageResult.getList(), deptMap, postMap), pageResult.getTotal())); } @GetMapping({"/list-all-simple", "/simple-list"}) @@ -117,8 +137,7 @@ public class UserController { public CommonResult> getSimpleUserList() { List list = userService.getUserListByStatus(CommonStatusEnum.ENABLE.getStatus()); // 拼接数据 - Map deptMap = deptService.getDeptMap( - convertList(list, AdminUserDO::getDeptId)); + Map deptMap = deptService.getDeptMap(convertList(list, AdminUserDO::getDeptId)); return success(UserConvert.INSTANCE.convertSimpleList(list, deptMap)); } @@ -133,22 +152,22 @@ public class UserController { } // 拼接数据 DeptDO dept = deptService.getDept(user.getDeptId()); - return success(UserConvert.INSTANCE.convert(user, dept)); + PostDO position = user.getPositionId() != null ? postService.getPost(user.getPositionId()) : null; + return success(UserConvert.INSTANCE.convert(user, dept, position)); } @GetMapping("/export-excel") @Operation(summary = "导出用户") @PreAuthorize("@ss.hasPermission('system:user:export')") @ApiAccessLog(operateType = EXPORT) - public void exportUserList(@Validated UserPageReqVO exportReqVO, - HttpServletResponse response) throws IOException { + public void exportUserList(@Validated UserPageReqVO exportReqVO, HttpServletResponse response) throws IOException { exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); List list = userService.getUserPage(exportReqVO).getList(); // 输出 Excel - Map deptMap = deptService.getDeptMap( - convertList(list, AdminUserDO::getDeptId)); + Map deptMap = deptService.getDeptMap(convertList(list, AdminUserDO::getDeptId)); + Map postMap = postService.getPostMap(convertList(list, AdminUserDO::getPositionId)); ExcelUtils.write(response, "用户数据.xls", "数据", UserRespVO.class, - UserConvert.INSTANCE.convertList(list, deptMap)); + UserConvert.INSTANCE.convertList(list, deptMap, postMap)); } @GetMapping("/get-import-template") @@ -156,9 +175,9 @@ public class UserController { public void importTemplate(HttpServletResponse response) throws IOException { // 手动创建导出 demo List list = Arrays.asList( - UserImportExcelVO.builder().username("yunai").deptId(1L).email("yunai@iocoder.cn").mobile("15601691300") + UserImportExcelVO.builder().username("yunai").deptId(1L).positionId(1L).email("yunai@iocoder.cn").mobile("15601691300") .nickname("灿能").status(CommonStatusEnum.ENABLE.getStatus()).sex(SexEnum.MALE.getSex()).build(), - UserImportExcelVO.builder().username("yuanma").deptId(2L).email("yuanma@iocoder.cn").mobile("15601701300") + UserImportExcelVO.builder().username("yuanma").deptId(2L).positionId(2L).email("yuanma@iocoder.cn").mobile("15601701300") .nickname("源码").status(CommonStatusEnum.DISABLE.getStatus()).sex(SexEnum.FEMALE.getSex()).build() ); // 输出 @@ -168,7 +187,7 @@ public class UserController { @PostMapping("/import") @Operation(summary = "导入用户") @Parameters({ - @Parameter(name = "file", description = "Excel 文件", required = true), + @Parameter(name = "file", description = "导入文件", required = true), @Parameter(name = "updateSupport", description = "是否支持更新,默认为 false", example = "true") }) @PreAuthorize("@ss.hasPermission('system:user:import')") diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/UserProfileController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/UserProfileController.java similarity index 78% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/UserProfileController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/UserProfileController.java index f06daec..61307c0 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/UserProfileController.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/UserProfileController.java @@ -1,7 +1,8 @@ package com.njcn.msgpush.module.system.controller.admin.user; -import cn.hutool.core.collection.CollUtil; import com.njcn.msgpush.framework.common.pojo.CommonResult; +import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; +import com.njcn.msgpush.framework.encrypt.core.annotation.ApiEncrypt; import com.njcn.msgpush.module.system.controller.admin.user.vo.profile.UserProfileRespVO; import com.njcn.msgpush.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO; import com.njcn.msgpush.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO; @@ -21,7 +22,11 @@ import jakarta.annotation.Resource; import jakarta.validation.Valid; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; import java.util.List; @@ -51,13 +56,17 @@ public class UserProfileController { public CommonResult getUserProfile() { // 获得用户基本信息 AdminUserDO user = userService.getUser(getLoginUserId()); + if (user == null) { + return success(null); + } // 获得用户角色 List userRoles = roleService.getRoleListFromCache(permissionService.getUserRoleIdListByUserId(user.getId())); + userRoles.removeIf(role -> !CommonStatusEnum.ENABLE.getStatus().equals(role.getStatus())); // 获得部门信息 DeptDO dept = user.getDeptId() != null ? deptService.getDept(user.getDeptId()) : null; - // 获得岗位信息 - List posts = CollUtil.isNotEmpty(user.getPostIds()) ? postService.getPostList(user.getPostIds()) : null; - return success(UserConvert.INSTANCE.convert(user, userRoles, dept, posts)); + // 获得主岗位信息 + PostDO position = user.getPositionId() != null ? postService.getPost(user.getPositionId()) : null; + return success(UserConvert.INSTANCE.convert(user, userRoles, dept, position)); } @PutMapping("/update") @@ -69,6 +78,7 @@ public class UserProfileController { @PutMapping("/update-password") @Operation(summary = "修改用户个人密码") + @ApiEncrypt(response = false, requestFields = {"oldPassword", "newPassword"}) public CommonResult updateUserProfilePassword(@Valid @RequestBody UserProfileUpdatePasswordReqVO reqVO) { userService.updateUserPassword(getLoginUserId(), reqVO); return success(true); diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/profile/UserProfileRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/profile/UserProfileRespVO.java similarity index 94% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/profile/UserProfileRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/profile/UserProfileRespVO.java index 91978b4..6bd1149 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/profile/UserProfileRespVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/profile/UserProfileRespVO.java @@ -19,7 +19,7 @@ public class UserProfileRespVO { @Schema(description = "用户账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "msgpush") private String username; - @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "awen") private String nickname; @Schema(description = "用户邮箱", example = "msgpush@iocoder.cn") @@ -47,13 +47,15 @@ public class UserProfileRespVO { * 所属角色 */ private List roles; + /** * 所在部门 */ private DeptSimpleRespVO dept; + /** - * 所属岗位数组 + * 主岗位 */ - private List posts; + private PostSimpleRespVO position; } diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/profile/UserProfileUpdatePasswordReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/profile/UserProfileUpdatePasswordReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/profile/UserProfileUpdatePasswordReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/profile/UserProfileUpdatePasswordReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/profile/UserProfileUpdateReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/profile/UserProfileUpdateReqVO.java similarity index 95% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/profile/UserProfileUpdateReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/profile/UserProfileUpdateReqVO.java index 3be493c..cf18d4d 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/profile/UserProfileUpdateReqVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/profile/UserProfileUpdateReqVO.java @@ -13,7 +13,7 @@ import org.hibernate.validator.constraints.URL; @Data public class UserProfileUpdateReqVO { - @Schema(description = "用户昵称", example = "芋艿") + @Schema(description = "用户昵称", example = "awen") @Size(max = 30, message = "用户昵称长度不能超过 30 个字符") private String nickname; diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserImportExcelVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserImportExcelVO.java similarity index 94% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserImportExcelVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserImportExcelVO.java index ff71152..711790b 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserImportExcelVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserImportExcelVO.java @@ -1,9 +1,9 @@ package com.njcn.msgpush.module.system.controller.admin.user.vo.user; +import cn.idev.excel.annotation.ExcelProperty; import com.njcn.msgpush.framework.excel.core.annotations.DictFormat; import com.njcn.msgpush.framework.excel.core.convert.DictConvert; import com.njcn.msgpush.module.system.enums.DictTypeConstants; -import cn.idev.excel.annotation.ExcelProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -27,6 +27,9 @@ public class UserImportExcelVO { @ExcelProperty("部门编号") private Long deptId; + @ExcelProperty("主岗位编号") + private Long positionId; + @ExcelProperty("用户邮箱") private String email; diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserImportRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserImportRespVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserImportRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserImportRespVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserPageReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserPageReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserPageReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserPageReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserRespVO.java similarity index 85% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserRespVO.java index 10f8e2a..85ce822 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserRespVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserRespVO.java @@ -1,20 +1,19 @@ package com.njcn.msgpush.module.system.controller.admin.user.vo.user; +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; +import cn.idev.excel.annotation.ExcelProperty; import com.njcn.msgpush.framework.excel.core.annotations.DictFormat; import com.njcn.msgpush.framework.excel.core.convert.DictConvert; import com.njcn.msgpush.module.system.enums.DictTypeConstants; -import cn.idev.excel.annotation.ExcelIgnoreUnannotated; -import cn.idev.excel.annotation.ExcelProperty; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; -import java.util.Set; @Schema(description = "管理后台 - 用户信息 Response VO") @Data @ExcelIgnoreUnannotated -public class UserRespVO{ +public class UserRespVO { @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @ExcelProperty("用户编号") @@ -24,21 +23,26 @@ public class UserRespVO{ @ExcelProperty("用户名称") private String username; - @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "awen") @ExcelProperty("用户昵称") private String nickname; @Schema(description = "备注", example = "我是一个用户") private String remark; - @Schema(description = "部门ID", example = "我是一个用户") + @Schema(description = "部门编号", example = "1") private Long deptId; + @Schema(description = "部门名称", example = "IT 部") @ExcelProperty("部门名称") private String deptName; - @Schema(description = "岗位编号数组", example = "1") - private Set postIds; + @Schema(description = "主岗位编号", example = "1") + private Long positionId; + + @Schema(description = "主岗位名称", example = "后端开发工程师") + @ExcelProperty("主岗位") + private String positionName; @Schema(description = "用户邮箱", example = "msgpush@iocoder.cn") @ExcelProperty("用户邮箱") @@ -65,6 +69,9 @@ public class UserRespVO{ @ExcelProperty("最后登录IP") private String loginIp; + @Schema(description = "离职时间", example = "2026-03-19 00:00:00") + private LocalDateTime resignedAt; + @Schema(description = "最后登录时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "时间戳格式") @ExcelProperty("最后登录时间") private LocalDateTime loginDate; diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserSaveReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserSaveReqVO.java similarity index 69% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserSaveReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserSaveReqVO.java index 0519622..a6e870f 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserSaveReqVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserSaveReqVO.java @@ -1,18 +1,23 @@ package com.njcn.msgpush.module.system.controller.admin.user.vo.user; import cn.hutool.core.util.ObjectUtil; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.mzt.logapi.starter.annotation.DiffLogField; import com.njcn.msgpush.framework.common.validation.Mobile; import com.njcn.msgpush.module.system.framework.operatelog.core.DeptParseFunction; import com.njcn.msgpush.module.system.framework.operatelog.core.PostParseFunction; import com.njcn.msgpush.module.system.framework.operatelog.core.SexParseFunction; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.mzt.logapi.starter.annotation.DiffLogField; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.*; +import jakarta.validation.constraints.AssertTrue; +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; +import jakarta.validation.constraints.Size; import lombok.Data; import org.hibernate.validator.constraints.Length; -import java.util.Set; +import java.time.LocalDateTime; @Schema(description = "管理后台 - 用户创建/修改 Request VO") @Data @@ -23,13 +28,13 @@ public class UserSaveReqVO { @Schema(description = "用户账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "msgpush") @NotBlank(message = "用户账号不能为空") - @Pattern(regexp = "^[a-zA-Z0-9]+$", message = "用户账号由 数字、字母 组成") + @Pattern(regexp = "^[a-zA-Z0-9]{4,30}$", message = "用户账号由数字、字母组成") @Size(min = 4, max = 30, message = "用户账号长度为 4-30 个字符") @DiffLogField(name = "用户账号") private String username; - @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") - @Size(max = 30, message = "用户昵称长度不能超过30个字符") + @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "awen") + @Size(max = 30, message = "用户昵称长度不能超过 30 个字符") @DiffLogField(name = "用户昵称") private String nickname; @@ -37,13 +42,19 @@ public class UserSaveReqVO { @DiffLogField(name = "备注") private String remark; - @Schema(description = "部门编号", example = "我是一个用户") + @Schema(description = "部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotNull(message = "部门不能为空") @DiffLogField(name = "部门", function = DeptParseFunction.NAME) private Long deptId; - @Schema(description = "岗位编号数组", example = "1") - @DiffLogField(name = "岗位", function = PostParseFunction.NAME) - private Set postIds; + @Schema(description = "主岗位编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotNull(message = "主岗位不能为空") + @DiffLogField(name = "主岗位", function = PostParseFunction.NAME) + private Long positionId; + + @Schema(description = "离职时间", example = "2026-03-19 00:00:00") + @DiffLogField(name = "离职时间") + private LocalDateTime resignedAt; @Schema(description = "用户邮箱", example = "msgpush@iocoder.cn") @Email(message = "邮箱格式不正确") @@ -74,7 +85,7 @@ public class UserSaveReqVO { @JsonIgnore public boolean isPasswordValid() { return id != null // 修改时,不需要传递 - || (ObjectUtil.isAllNotEmpty(password)); // 新增时,必须都传递 password + || ObjectUtil.isAllNotEmpty(password); // 新增时,必须传递 password } } diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserSimpleRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserSimpleRespVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserSimpleRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserSimpleRespVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserUpdatePasswordReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserUpdatePasswordReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserUpdatePasswordReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserUpdatePasswordReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserUpdateStatusReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserUpdateStatusReqVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserUpdateStatusReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/admin/user/vo/user/UserUpdateStatusReqVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/app/dict/AppDictDataController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/app/dict/AppDictDataController.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/app/dict/AppDictDataController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/app/dict/AppDictDataController.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/app/dict/vo/AppDictDataRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/app/dict/vo/AppDictDataRespVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/app/dict/vo/AppDictDataRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/app/dict/vo/AppDictDataRespVO.java diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/app/file/AppFileController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/app/file/AppFileController.java similarity index 85% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/app/file/AppFileController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/app/file/AppFileController.java index e44b2c8..0c5c2ea 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/app/file/AppFileController.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/app/file/AppFileController.java @@ -1,11 +1,11 @@ -package com.njcn.msgpush.module.infra.controller.app.file; +package com.njcn.msgpush.module.system.controller.app.file; import cn.hutool.core.io.IoUtil; import com.njcn.msgpush.framework.common.pojo.CommonResult; -import com.njcn.msgpush.module.infra.controller.admin.file.vo.file.FileCreateReqVO; -import com.njcn.msgpush.module.infra.controller.admin.file.vo.file.FilePresignedUrlRespVO; -import com.njcn.msgpush.module.infra.controller.app.file.vo.AppFileUploadReqVO; -import com.njcn.msgpush.module.infra.service.file.FileService; +import com.njcn.msgpush.module.system.controller.admin.file.vo.file.FileCreateReqVO; +import com.njcn.msgpush.module.system.controller.admin.file.vo.file.FilePresignedUrlRespVO; +import com.njcn.msgpush.module.system.controller.app.file.vo.AppFileUploadReqVO; +import com.njcn.msgpush.module.system.service.file.FileService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameters; @@ -23,7 +23,7 @@ import static com.njcn.msgpush.framework.common.pojo.CommonResult.success; @Tag(name = "用户 App - 文件存储") @RestController -@RequestMapping("/infra/file") +@RequestMapping("/system/file") @Validated @Slf4j public class AppFileController { @@ -63,3 +63,4 @@ public class AppFileController { } } + diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/app/file/vo/AppFileUploadReqVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/app/file/vo/AppFileUploadReqVO.java similarity index 84% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/app/file/vo/AppFileUploadReqVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/app/file/vo/AppFileUploadReqVO.java index 17fb129..06d5fbf 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/controller/app/file/vo/AppFileUploadReqVO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/app/file/vo/AppFileUploadReqVO.java @@ -1,7 +1,7 @@ -package com.njcn.msgpush.module.infra.controller.app.file.vo; +package com.njcn.msgpush.module.system.controller.app.file.vo; -import com.njcn.msgpush.module.infra.controller.admin.file.vo.file.FileUploadReqVO; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.njcn.msgpush.module.system.controller.admin.file.vo.file.FileUploadReqVO; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.AssertTrue; import jakarta.validation.constraints.NotNull; diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/app/ip/AppAreaController.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/app/ip/AppAreaController.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/app/ip/AppAreaController.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/app/ip/AppAreaController.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/app/ip/vo/AppAreaNodeRespVO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/app/ip/vo/AppAreaNodeRespVO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/app/ip/vo/AppAreaNodeRespVO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/app/ip/vo/AppAreaNodeRespVO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/app/package-info.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/app/package-info.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/app/package-info.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/app/package-info.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/package-info.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/package-info.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/controller/package-info.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/controller/package-info.java diff --git a/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/convert/auth/AuthConvert.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/convert/auth/AuthConvert.java new file mode 100644 index 0000000..d20d1b6 --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/convert/auth/AuthConvert.java @@ -0,0 +1,395 @@ +package com.njcn.msgpush.module.system.convert.auth; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjUtil; +import cn.hutool.core.util.StrUtil; +import com.fasterxml.jackson.core.type.TypeReference; +import com.njcn.msgpush.framework.common.util.json.JsonUtils; +import com.njcn.msgpush.framework.common.util.object.BeanUtils; +import com.njcn.msgpush.module.system.controller.admin.auth.vo.AuthRouteMetaRespVO; +import com.njcn.msgpush.module.system.controller.admin.auth.vo.AuthRouteNodeRespVO; +import com.njcn.msgpush.module.system.controller.admin.auth.vo.AuthPermissionInfoRespVO; +import com.njcn.msgpush.module.system.controller.admin.auth.vo.AuthUserInfoRespVO; +import com.njcn.msgpush.module.system.controller.admin.auth.vo.AuthUserRouteRespVO; +import com.njcn.msgpush.module.system.dal.dataobject.permission.MenuDO; +import com.njcn.msgpush.module.system.dal.dataobject.permission.RoleDO; +import com.njcn.msgpush.module.system.dal.dataobject.user.AdminUserDO; +import com.njcn.msgpush.module.system.enums.permission.MenuRouteKindEnum; +import com.njcn.msgpush.module.system.enums.permission.MenuTypeEnum; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +import static com.njcn.msgpush.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.njcn.msgpush.framework.common.util.collection.CollectionUtils.convertList; +import static com.njcn.msgpush.framework.common.util.collection.CollectionUtils.convertSet; +import static com.njcn.msgpush.framework.common.util.collection.CollectionUtils.filterList; +import static com.njcn.msgpush.module.system.dal.dataobject.permission.MenuDO.ID_ROOT; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.MENU_ROUTE_NAME_DUPLICATE; + +@Mapper +public interface AuthConvert { + + AuthConvert INSTANCE = Mappers.getMapper(AuthConvert.class); + + default AuthPermissionInfoRespVO convert(AdminUserDO user, List roleList, List menuList) { + return AuthPermissionInfoRespVO.builder() + .user(BeanUtils.toBean(user, AuthPermissionInfoRespVO.UserVO.class)) + .roles(convertSet(roleList, RoleDO::getCode)) + .permissions(convertSet(filterList(menuList, menu -> StrUtil.isNotBlank(menu.getPermission())), + MenuDO::getPermission)) + .menus(buildMenuTree(menuList)) + .build(); + } + + default AuthUserInfoRespVO convertUserInfo(AdminUserDO user, List roleList, List menuList) { + return AuthUserInfoRespVO.builder() + .userId(String.valueOf(user.getId())) + .userName(user.getUsername()) + .roles(sortDistinctStrings(convertList(roleList, RoleDO::getCode))) + .buttons(sortDistinctStrings(convertList(menuList, MenuDO::getPermission, + menu -> StrUtil.isNotBlank(menu.getPermission())))) + .build(); + } + + default AuthUserRouteRespVO convertUserRoutes(List menuList) { + if (CollUtil.isEmpty(menuList)) { + return AuthUserRouteRespVO.builder() + .routes(Collections.emptyList()) + .home("") + .build(); + } + + List routeMenus = filterList(menuList, this::canExposeAsRoute); + if (CollUtil.isEmpty(routeMenus)) { + return AuthUserRouteRespVO.builder() + .routes(Collections.emptyList()) + .home("") + .build(); + } + + Map menuMap = new LinkedHashMap<>(); + routeMenus.forEach(menu -> menuMap.put(menu.getId(), menu)); + + Map fullPathCache = new HashMap<>(); + List validMenus = filterList(routeMenus, menu -> { + String fullPath = resolveFullPath(menu, menuMap, fullPathCache); + return StrUtil.isNotBlank(fullPath) && !isExternalPath(fullPath); + }); + if (CollUtil.isEmpty(validMenus)) { + return AuthUserRouteRespVO.builder() + .routes(Collections.emptyList()) + .home("") + .build(); + } + + Set validMenuIds = convertSet(validMenus, MenuDO::getId); + Set parentIds = new HashSet<>(); + validMenus.forEach(menu -> { + if (validMenuIds.contains(menu.getParentId())) { + parentIds.add(menu.getParentId()); + } + }); + + Map routeNameMap = buildRouteNameMap(validMenus, fullPathCache); + Map nodeMap = new LinkedHashMap<>(); + validMenus.forEach(menu -> nodeMap.put(menu.getId(), buildRouteNode(menu, + fullPathCache.get(menu.getId()), routeNameMap.get(menu.getId()), parentIds.contains(menu.getId())))); + + List roots = new ArrayList<>(); + validMenus.forEach(menu -> { + AuthRouteNodeRespVO node = nodeMap.get(menu.getId()); + if (!validMenuIds.contains(menu.getParentId()) || ID_ROOT.equals(menu.getParentId())) { + roots.add(node); + return; + } + + AuthRouteNodeRespVO parentNode = nodeMap.get(menu.getParentId()); + if (parentNode == null) { + roots.add(node); + return; + } + if (parentNode.getChildren() == null) { + parentNode.setChildren(new ArrayList<>()); + } + parentNode.getChildren().add(node); + }); + + List routes = sortRouteNodes(roots); + return AuthUserRouteRespVO.builder() + .routes(routes) + .home(StrUtil.blankToDefault(resolveHome(routes), "")) + .build(); + } + + /** + * 将菜单列表,构建成菜单树。 + */ + default List buildMenuTree(List menuList) { + if (CollUtil.isEmpty(menuList)) { + return Collections.emptyList(); + } + menuList.removeIf(menu -> menu.getType().equals(MenuTypeEnum.BUTTON.getType())); + menuList.sort(Comparator.comparing(MenuDO::getSort)); + + Map treeNodeMap = new LinkedHashMap<>(); + menuList.forEach(menu -> treeNodeMap.put(menu.getId(), + BeanUtils.toBean(menu, AuthPermissionInfoRespVO.MenuVO.class))); + + treeNodeMap.values().stream().filter(node -> ObjUtil.notEqual(node.getParentId(), ID_ROOT)).forEach(childNode -> { + AuthPermissionInfoRespVO.MenuVO parentNode = treeNodeMap.get(childNode.getParentId()); + if (parentNode == null) { + LoggerFactory.getLogger(getClass()).error("[buildRouterTree][resource({}) 找不到父资源({})]", + childNode.getId(), childNode.getParentId()); + return; + } + if (parentNode.getChildren() == null) { + parentNode.setChildren(new ArrayList<>()); + } + parentNode.getChildren().add(childNode); + }); + + return filterList(treeNodeMap.values(), node -> ID_ROOT.equals(node.getParentId())); + } + + default List sortDistinctStrings(List values) { + if (CollUtil.isEmpty(values)) { + return Collections.emptyList(); + } + return values.stream() + .filter(StrUtil::isNotBlank) + .distinct() + .sorted() + .collect(Collectors.toList()); + } + + default boolean canExposeAsRoute(MenuDO menu) { + return menu != null + && !MenuTypeEnum.BUTTON.getType().equals(menu.getType()) + && (MenuTypeEnum.DIR.getType().equals(menu.getType()) || !Boolean.FALSE.equals(menu.getVisible())); + } + + default String resolveFullPath(MenuDO menu, Map menuMap, Map cache) { + String cachedPath = cache.get(menu.getId()); + if (cachedPath != null) { + return cachedPath; + } + + String rawPath = StrUtil.trimToEmpty(menu.getPath()); + String fullPath; + if (StrUtil.isBlank(rawPath)) { + fullPath = ""; + } else if (isExternalPath(rawPath)) { + fullPath = rawPath; + } else if (StrUtil.startWith(rawPath, "/")) { + fullPath = normalizePath(rawPath); + } else { + MenuDO parent = menuMap.get(menu.getParentId()); + if (parent == null || ID_ROOT.equals(menu.getParentId())) { + fullPath = normalizePath("/" + rawPath); + } else { + String parentPath = resolveFullPath(parent, menuMap, cache); + fullPath = normalizePath(parentPath + "/" + rawPath); + } + } + + cache.put(menu.getId(), fullPath); + return fullPath; + } + + default Map buildRouteNameMap(List menus, Map fullPathCache) { + Map routeNameMap = new LinkedHashMap<>(); + Map usedNames = new LinkedHashMap<>(); + menus.forEach(menu -> { + String fullPath = fullPathCache.get(menu.getId()); + String baseName = resolveBaseRouteName(menu, fullPath); + if (StrUtil.isBlank(baseName)) { + baseName = "route_" + menu.getId(); + } + Long conflictMenuId = usedNames.putIfAbsent(baseName, menu.getId()); + if (conflictMenuId != null) { + throw exception(MENU_ROUTE_NAME_DUPLICATE, + StrUtil.format("{}(菜单 {} 与菜单 {})", baseName, conflictMenuId, menu.getId())); + } + routeNameMap.put(menu.getId(), baseName); + }); + return routeNameMap; + } + + default String resolveBaseRouteName(MenuDO menu, String fullPath) { + if (StrUtil.isNotBlank(menu.getComponentName())) { + return StrUtil.trim(menu.getComponentName()); + } + return normalizeRouteName(fullPath); + } + + default AuthRouteNodeRespVO buildRouteNode(MenuDO menu, String fullPath, String routeName, boolean hasChildren) { + MenuRouteKindEnum routeKind = resolveRouteKind(menu, hasChildren); + return AuthRouteNodeRespVO.builder() + .id(String.valueOf(menu.getId())) + .name(routeName) + .path(fullPath) + .component(resolveComponentKey(menu, routeKind, routeName)) + .props(resolveRouteProps(menu.getRoutePropsJson())) + .meta(buildRouteMeta(menu)) + .build(); + } + + default AuthRouteMetaRespVO buildRouteMeta(MenuDO menu) { + return AuthRouteMetaRespVO.builder() + .title(menu.getName()) + .icon(resolveIcon(menu.getIcon())) + .order(menu.getSort()) + .keepAlive(menu.getKeepAlive()) + .hideInMenu(Boolean.FALSE.equals(menu.getVisible())) + .build(); + } + + default MenuRouteKindEnum resolveRouteKind(MenuDO menu, boolean hasChildren) { + if (hasChildren) { + return MenuRouteKindEnum.DIR; + } + MenuRouteKindEnum routeKind = MenuRouteKindEnum.valueOfKind(menu.getRouteKind()); + if (routeKind != null) { + return routeKind; + } + if (MenuTypeEnum.DIR.getType().equals(menu.getType())) { + return MenuRouteKindEnum.DIR; + } + if (isExternalPath(menu.getPath())) { + return MenuRouteKindEnum.EXTERNAL; + } + if (ID_ROOT.equals(menu.getParentId())) { + return MenuRouteKindEnum.SINGLE; + } + return MenuRouteKindEnum.VIEW; + } + + default String resolveComponentKey(MenuDO menu, MenuRouteKindEnum routeKind, String routeName) { + if (StrUtil.isNotBlank(menu.getComponent())) { + return StrUtil.trim(menu.getComponent()); + } + if (MenuRouteKindEnum.DIR.equals(routeKind)) { + return "layout.base"; + } + if (MenuRouteKindEnum.IFRAME.equals(routeKind)) { + return "view.iframe-page"; + } + if (MenuRouteKindEnum.SINGLE.equals(routeKind)) { + return "layout.base$view." + routeName; + } + if (MenuRouteKindEnum.VIEW.equals(routeKind)) { + return "view." + routeName; + } + return null; + } + + default Object resolveRouteProps(String routePropsJson) { + if (StrUtil.isBlank(routePropsJson)) { + return null; + } + Object routeProps = JsonUtils.parseObjectQuietly(routePropsJson, new TypeReference() { + }); + if (routeProps != null) { + return routeProps; + } + LoggerFactory.getLogger(getClass()).warn("[resolveRouteProps][routePropsJson({}) 解析失败]", routePropsJson); + return null; + } + + default String resolveIcon(String icon) { + if (StrUtil.isBlank(icon) || "#".equals(icon)) { + return null; + } + return icon; + } + + default String normalizePath(String path) { + String normalized = path.replace('\\', '/'); + normalized = normalized.replaceAll("/{2,}", "/"); + if (!normalized.startsWith("/")) { + normalized = "/" + normalized; + } + if (normalized.length() > 1 && normalized.endsWith("/")) { + normalized = normalized.substring(0, normalized.length() - 1); + } + return normalized; + } + + default boolean isExternalPath(String path) { + return StrUtil.startWithAnyIgnoreCase(path, "http://", "https://"); + } + + default String normalizeRouteName(String fullPath) { + if (StrUtil.isBlank(fullPath)) { + return ""; + } + return fullPath + .replaceAll("([A-Z]+)([A-Z][a-z])", "$1_$2") + .replaceAll("([a-z\\d])([A-Z])", "$1_$2") + .replaceAll("^/+", "") + .replaceAll("/+$", "") + .replaceAll("[/\\\\.\\-\\s]+", "_") + .replaceAll("_+", "_") + .replaceAll("^_+", "") + .replaceAll("_+$", "") + .toLowerCase(); + } + + default List sortRouteNodes(List routes) { + if (CollUtil.isEmpty(routes)) { + return Collections.emptyList(); + } + + List sortedRoutes = new ArrayList<>(routes); + sortedRoutes.sort(Comparator + .comparing((AuthRouteNodeRespVO route) -> route.getMeta() != null && route.getMeta().getOrder() != null + ? route.getMeta().getOrder() : Integer.MAX_VALUE) + .thenComparing(AuthRouteNodeRespVO::getPath, Comparator.nullsLast(String::compareTo)) + .thenComparing(AuthRouteNodeRespVO::getId, Comparator.nullsLast(String::compareTo))); + + sortedRoutes.forEach(route -> { + if (CollUtil.isEmpty(route.getChildren())) { + route.setChildren(null); + return; + } + + List children = sortRouteNodes(route.getChildren()); + route.setChildren(children); + route.setRedirect(children.get(0).getPath()); + }); + return sortedRoutes; + } + + default String resolveHome(List routes) { + if (CollUtil.isEmpty(routes)) { + return null; + } + + for (AuthRouteNodeRespVO route : routes) { + if (CollUtil.isNotEmpty(route.getChildren())) { + String childHome = resolveHome(route.getChildren()); + if (StrUtil.isNotBlank(childHome)) { + return childHome; + } + } + + if (CollUtil.isEmpty(route.getChildren())) { + return route.getName(); + } + } + return null; + } + +} diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/convert/config/ConfigConvert.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/convert/config/ConfigConvert.java similarity index 68% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/convert/config/ConfigConvert.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/convert/config/ConfigConvert.java index a6754c5..ff53644 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/convert/config/ConfigConvert.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/convert/config/ConfigConvert.java @@ -1,9 +1,9 @@ -package com.njcn.msgpush.module.infra.convert.config; +package com.njcn.msgpush.module.system.convert.config; import com.njcn.msgpush.framework.common.pojo.PageResult; -import com.njcn.msgpush.module.infra.controller.admin.config.vo.ConfigRespVO; -import com.njcn.msgpush.module.infra.controller.admin.config.vo.ConfigSaveReqVO; -import com.njcn.msgpush.module.infra.dal.dataobject.config.ConfigDO; +import com.njcn.msgpush.module.system.controller.admin.config.vo.ConfigRespVO; +import com.njcn.msgpush.module.system.controller.admin.config.vo.ConfigSaveReqVO; +import com.njcn.msgpush.module.system.dal.dataobject.config.ConfigDO; import org.mapstruct.Mapper; import org.mapstruct.Mapping; import org.mapstruct.factory.Mappers; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/convert/file/FileConfigConvert.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/convert/file/FileConfigConvert.java similarity index 63% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/convert/file/FileConfigConvert.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/convert/file/FileConfigConvert.java index cf07b7d..c0d2934 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/convert/file/FileConfigConvert.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/convert/file/FileConfigConvert.java @@ -1,7 +1,7 @@ -package com.njcn.msgpush.module.infra.convert.file; +package com.njcn.msgpush.module.system.convert.file; -import com.njcn.msgpush.module.infra.controller.admin.file.vo.config.FileConfigSaveReqVO; -import com.njcn.msgpush.module.infra.dal.dataobject.file.FileConfigDO; +import com.njcn.msgpush.module.system.controller.admin.file.vo.config.FileConfigSaveReqVO; +import com.njcn.msgpush.module.system.dal.dataobject.file.FileConfigDO; import org.mapstruct.Mapper; import org.mapstruct.Mapping; import org.mapstruct.factory.Mappers; diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/convert/oauth2/OAuth2OpenConvert.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/convert/oauth2/OAuth2OpenConvert.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/convert/oauth2/OAuth2OpenConvert.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/convert/oauth2/OAuth2OpenConvert.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/convert/package-info.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/convert/package-info.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/convert/package-info.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/convert/package-info.java diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/convert/redis/RedisConvert.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/convert/redis/RedisConvert.java similarity index 87% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/convert/redis/RedisConvert.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/convert/redis/RedisConvert.java index fd83539..c41ef8b 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/convert/redis/RedisConvert.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/convert/redis/RedisConvert.java @@ -1,7 +1,7 @@ -package com.njcn.msgpush.module.infra.convert.redis; +package com.njcn.msgpush.module.system.convert.redis; import cn.hutool.core.util.StrUtil; -import com.njcn.msgpush.module.infra.controller.admin.redis.vo.RedisMonitorRespVO; +import com.njcn.msgpush.module.system.controller.admin.redis.vo.RedisMonitorRespVO; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/convert/user/UserConvert.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/convert/user/UserConvert.java similarity index 84% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/convert/user/UserConvert.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/convert/user/UserConvert.java index 4693fce..e4d4d65 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/convert/user/UserConvert.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/convert/user/UserConvert.java @@ -24,15 +24,18 @@ public interface UserConvert { UserConvert INSTANCE = Mappers.getMapper(UserConvert.class); - default List convertList(List list, Map deptMap) { - return CollectionUtils.convertList(list, user -> convert(user, deptMap.get(user.getDeptId()))); + default List convertList(List list, Map deptMap, Map postMap) { + return CollectionUtils.convertList(list, user -> convert(user, deptMap.get(user.getDeptId()), postMap.get(user.getPositionId()))); } - default UserRespVO convert(AdminUserDO user, DeptDO dept) { + default UserRespVO convert(AdminUserDO user, DeptDO dept, PostDO position) { UserRespVO userVO = BeanUtils.toBean(user, UserRespVO.class); if (dept != null) { userVO.setDeptName(dept.getName()); } + if (position != null) { + userVO.setPositionName(position.getName()); + } return userVO; } @@ -44,12 +47,11 @@ public interface UserConvert { }); } - default UserProfileRespVO convert(AdminUserDO user, List userRoles, - DeptDO dept, List posts) { + default UserProfileRespVO convert(AdminUserDO user, List userRoles, DeptDO dept, PostDO position) { UserProfileRespVO userVO = BeanUtils.toBean(user, UserProfileRespVO.class); userVO.setRoles(BeanUtils.toBean(userRoles, RoleSimpleRespVO.class)); userVO.setDept(BeanUtils.toBean(dept, DeptSimpleRespVO.class)); - userVO.setPosts(BeanUtils.toBean(posts, PostSimpleRespVO.class)); + userVO.setPosition(BeanUtils.toBean(position, PostSimpleRespVO.class)); return userVO; } diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/dataobject/config/ConfigDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/config/ConfigDO.java similarity index 78% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/dataobject/config/ConfigDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/config/ConfigDO.java index 1ecf1e9..b27beea 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/dataobject/config/ConfigDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/config/ConfigDO.java @@ -1,11 +1,9 @@ -package com.njcn.msgpush.module.infra.dal.dataobject.config; +package com.njcn.msgpush.module.system.dal.dataobject.config; -import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; - -import com.njcn.msgpush.module.infra.enums.config.ConfigTypeEnum; -import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; +import com.njcn.msgpush.module.system.enums.config.ConfigTypeEnum; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -16,10 +14,10 @@ import lombok.ToString; * @author hongawen */ @TableName("infra_config") -@KeySequence("infra_config_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) + public class ConfigDO extends BaseDO { /** diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dept/DeptDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dept/DeptDO.java similarity index 62% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dept/DeptDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dept/DeptDO.java index e4928ce..31b6ae3 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dept/DeptDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dept/DeptDO.java @@ -1,22 +1,18 @@ package com.njcn.msgpush.module.system.dal.dataobject.dept; -import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; -import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; -import com.njcn.msgpush.module.system.dal.dataobject.user.AdminUserDO; -import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; +import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; import lombok.Data; import lombok.EqualsAndHashCode; /** * 部门表 * - * @author ruoyi * @author hongawen */ @TableName("system_dept") -@KeySequence("system_dept_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) public class DeptDO extends BaseDO { @@ -24,7 +20,7 @@ public class DeptDO extends BaseDO { public static final Long PARENT_ID_ROOT = 0L; /** - * 部门ID + * 部门 ID */ @TableId private Long id; @@ -33,29 +29,29 @@ public class DeptDO extends BaseDO { */ private String name; /** - * 父部门ID - * - * 关联 {@link #id} + * 父部门 ID */ private Long parentId; + /** + * 组织节点类型 + */ + private String orgType; + /** + * 组织物化路径 + */ + private String path; + /** + * 组织层级 + */ + private Integer level; + /** + * 组织编码 + */ + private String code; /** * 显示顺序 */ private Integer sort; - /** - * 负责人 - * - * 关联 {@link AdminUserDO#getId()} - */ - private Long leaderUserId; - /** - * 联系电话 - */ - private String phone; - /** - * 邮箱 - */ - private String email; /** * 部门状态 * diff --git a/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dept/OrgLeaderRelationDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dept/OrgLeaderRelationDO.java new file mode 100644 index 0000000..f20ce94 --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dept/OrgLeaderRelationDO.java @@ -0,0 +1,47 @@ +package com.njcn.msgpush.module.system.dal.dataobject.dept; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.time.LocalDateTime; + +/** + * 组织负责人关系 DO + */ +@TableName("system_org_leader_relation") +@Data +@EqualsAndHashCode(callSuper = true) +public class OrgLeaderRelationDO extends BaseDO { + + @TableId + private Long id; + + /** + * 组织节点 ID + */ + private Long deptId; + + /** + * 负责人用户 ID + */ + private Long userId; + + /** + * 生效开始时间 + */ + private LocalDateTime effectiveFrom; + + /** + * 生效结束时间 + */ + private LocalDateTime effectiveUntil; + + /** + * 备注 + */ + private String remark; + +} diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dept/PostDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dept/PostDO.java similarity index 78% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dept/PostDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dept/PostDO.java index 49f361e..6de34e2 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dept/PostDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dept/PostDO.java @@ -1,47 +1,57 @@ package com.njcn.msgpush.module.system.dal.dataobject.dept; -import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; -import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; -import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; +import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; import lombok.Data; import lombok.EqualsAndHashCode; /** * 岗位表 * - * @author ruoyi + * @author hongawen */ @TableName("system_post") -@KeySequence("system_post_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) public class PostDO extends BaseDO { - /** - * 岗位序号 - */ @TableId private Long id; + /** * 岗位名称 */ private String name; + /** * 岗位编码 */ private String code; + + /** + * 岗位类型 + */ + private String postType; + + /** + * 岗位级别 + */ + private Integer levelRank; + /** * 岗位排序 */ private Integer sort; + /** * 状态 * * 枚举 {@link CommonStatusEnum} */ private Integer status; + /** * 备注 */ diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dict/DictDataDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dict/DictDataDO.java similarity index 87% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dict/DictDataDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dict/DictDataDO.java index baf8ab3..1cfdbd3 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dict/DictDataDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dict/DictDataDO.java @@ -2,6 +2,7 @@ package com.njcn.msgpush.module.system.dal.dataobject.dict; import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; + import com.baomidou.mybatisplus.annotation.*; import lombok.Data; import lombok.EqualsAndHashCode; @@ -9,10 +10,9 @@ import lombok.EqualsAndHashCode; /** * 字典数据表 * - * @author ruoyi + * @author hongawen */ @TableName("system_dict_data") -@KeySequence("system_dict_data_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) public class DictDataDO extends BaseDO { diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dict/DictTypeDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dict/DictTypeDO.java similarity index 81% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dict/DictTypeDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dict/DictTypeDO.java index b6280a7..749e191 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dict/DictTypeDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/dict/DictTypeDO.java @@ -2,7 +2,7 @@ package com.njcn.msgpush.module.system.dal.dataobject.dict; import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; -import com.baomidou.mybatisplus.annotation.KeySequence; + import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.*; @@ -12,16 +12,16 @@ import java.time.LocalDateTime; /** * 字典类型表 * - * @author ruoyi + * @author hongawen */ @TableName("system_dict_type") -@KeySequence("system_dict_type_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @Builder @NoArgsConstructor @AllArgsConstructor + public class DictTypeDO extends BaseDO { /** diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/dataobject/file/FileConfigDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/file/FileConfigDO.java similarity index 77% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/dataobject/file/FileConfigDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/file/FileConfigDO.java index 3645982..ce68334 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/dataobject/file/FileConfigDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/file/FileConfigDO.java @@ -1,21 +1,20 @@ -package com.njcn.msgpush.module.infra.dal.dataobject.file; +package com.njcn.msgpush.module.system.dal.dataobject.file; import cn.hutool.core.util.StrUtil; -import com.njcn.msgpush.framework.common.util.json.JsonUtils; -import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; - -import com.njcn.msgpush.module.infra.framework.file.core.client.FileClientConfig; -import com.njcn.msgpush.module.infra.framework.file.core.client.db.DBFileClientConfig; -import com.njcn.msgpush.module.infra.framework.file.core.client.ftp.FtpFileClientConfig; -import com.njcn.msgpush.module.infra.framework.file.core.client.local.LocalFileClientConfig; -import com.njcn.msgpush.module.infra.framework.file.core.client.s3.S3FileClientConfig; -import com.njcn.msgpush.module.infra.framework.file.core.client.sftp.SftpFileClientConfig; -import com.njcn.msgpush.module.infra.framework.file.core.enums.FileStorageEnum; -import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.handlers.AbstractJsonTypeHandler; import com.fasterxml.jackson.core.type.TypeReference; +import com.njcn.msgpush.framework.common.util.json.JsonUtils; +import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; +import com.njcn.msgpush.module.system.framework.file.core.client.FileClientConfig; +import com.njcn.msgpush.module.system.framework.file.core.client.db.DBFileClientConfig; +import com.njcn.msgpush.module.system.framework.file.core.client.ftp.FtpFileClientConfig; +import com.njcn.msgpush.module.system.framework.file.core.client.local.LocalFileClientConfig; +import com.njcn.msgpush.module.system.framework.file.core.client.s3.S3FileClientConfig; +import com.njcn.msgpush.module.system.framework.file.core.client.sftp.SftpFileClientConfig; +import com.njcn.msgpush.module.system.framework.file.core.enums.FileStorageEnum; import lombok.*; import java.lang.reflect.Field; @@ -26,18 +25,19 @@ import java.lang.reflect.Field; * @author hongawen */ @TableName(value = "infra_file_config", autoResultMap = true) -@KeySequence("infra_file_config_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @Builder @NoArgsConstructor @AllArgsConstructor + public class FileConfigDO extends BaseDO { /** * 配置编号,数据库自增 */ + @TableId private Long id; /** * 配置名 diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/dataobject/file/FileContentDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/file/FileContentDO.java similarity index 69% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/dataobject/file/FileContentDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/file/FileContentDO.java index 553e85e..d12e569 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/dataobject/file/FileContentDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/file/FileContentDO.java @@ -1,11 +1,9 @@ -package com.njcn.msgpush.module.infra.dal.dataobject.file; +package com.njcn.msgpush.module.system.dal.dataobject.file; -import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; - -import com.njcn.msgpush.module.infra.framework.file.core.client.db.DBFileClient; -import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; +import com.njcn.msgpush.module.system.framework.file.core.client.db.DBFileClient; import lombok.*; /** @@ -16,13 +14,13 @@ import lombok.*; * @author hongawen */ @TableName("infra_file_content") -@KeySequence("infra_file_content_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @Builder @NoArgsConstructor @AllArgsConstructor + public class FileContentDO extends BaseDO { /** diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/dataobject/file/FileDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/file/FileDO.java similarity index 76% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/dataobject/file/FileDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/file/FileDO.java index 2006d27..6ef18b1 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/dataobject/file/FileDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/file/FileDO.java @@ -1,9 +1,8 @@ -package com.njcn.msgpush.module.infra.dal.dataobject.file; +package com.njcn.msgpush.module.system.dal.dataobject.file; -import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; - -import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; import lombok.*; /** @@ -13,18 +12,19 @@ import lombok.*; * @author hongawen */ @TableName("infra_file") -@KeySequence("infra_file_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @Builder @NoArgsConstructor @AllArgsConstructor + public class FileDO extends BaseDO { /** * 编号,数据库自增 */ + @TableId private Long id; /** * 配置编号 @@ -51,6 +51,6 @@ public class FileDO extends BaseDO { /** * 文件大小 */ - private Integer size; + private Long size; } diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/dataobject/logger/ApiAccessLogDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/logger/ApiAccessLogDO.java similarity index 94% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/dataobject/logger/ApiAccessLogDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/logger/ApiAccessLogDO.java index 6e3f1ff..7c438a4 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/dataobject/logger/ApiAccessLogDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/logger/ApiAccessLogDO.java @@ -1,12 +1,11 @@ -package com.njcn.msgpush.module.infra.dal.dataobject.logger; +package com.njcn.msgpush.module.system.dal.dataobject.logger; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; import com.njcn.msgpush.framework.apilog.core.enums.OperateTypeEnum; import com.njcn.msgpush.framework.common.enums.UserTypeEnum; import com.njcn.msgpush.framework.common.pojo.CommonResult; import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; -import com.baomidou.mybatisplus.annotation.KeySequence; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; import lombok.*; import java.time.LocalDateTime; @@ -17,7 +16,6 @@ import java.time.LocalDateTime; * @author hongawen */ @TableName("infra_api_access_log") -@KeySequence(value = "infra_api_access_log_seq") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/dataobject/logger/ApiErrorLogDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/logger/ApiErrorLogDO.java similarity index 93% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/dataobject/logger/ApiErrorLogDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/logger/ApiErrorLogDO.java index 0e43028..097bd01 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/dataobject/logger/ApiErrorLogDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/logger/ApiErrorLogDO.java @@ -1,11 +1,10 @@ -package com.njcn.msgpush.module.infra.dal.dataobject.logger; +package com.njcn.msgpush.module.system.dal.dataobject.logger; -import com.njcn.msgpush.framework.common.enums.UserTypeEnum; -import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; -import com.njcn.msgpush.module.infra.enums.logger.ApiErrorLogProcessStatusEnum; -import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.njcn.msgpush.framework.common.enums.UserTypeEnum; +import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; +import com.njcn.msgpush.module.system.enums.logger.ApiErrorLogProcessStatusEnum; import lombok.*; import java.time.LocalDateTime; @@ -22,7 +21,6 @@ import java.time.LocalDateTime; @Builder @NoArgsConstructor @AllArgsConstructor -@KeySequence(value = "infra_api_error_log_seq") public class ApiErrorLogDO extends BaseDO { /** diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/logger/LoginLogDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/logger/LoginLogDO.java similarity index 87% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/logger/LoginLogDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/logger/LoginLogDO.java index 0d0891f..582cfcb 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/logger/LoginLogDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/logger/LoginLogDO.java @@ -4,7 +4,7 @@ import com.njcn.msgpush.framework.common.enums.UserTypeEnum; import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; import com.njcn.msgpush.module.system.enums.logger.LoginLogTypeEnum; import com.njcn.msgpush.module.system.enums.logger.LoginResultEnum; -import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -18,7 +18,6 @@ import lombok.ToString; * @author hongawen */ @TableName("system_login_log") -@KeySequence("system_login_log_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @@ -27,6 +26,7 @@ public class LoginLogDO extends BaseDO { /** * 日志主键 */ + @TableId private Long id; /** * 日志类型 diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/logger/OperateLogDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/logger/OperateLogDO.java similarity index 89% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/logger/OperateLogDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/logger/OperateLogDO.java index 458d2f6..77e3eac 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/logger/OperateLogDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/logger/OperateLogDO.java @@ -2,7 +2,6 @@ package com.njcn.msgpush.module.system.dal.dataobject.logger; import com.njcn.msgpush.framework.common.enums.UserTypeEnum; import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; -import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; @@ -13,7 +12,6 @@ import lombok.Data; * @author hongawen */ @TableName(value = "system_operate_log", autoResultMap = true) -@KeySequence("system_operate_log_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data public class OperateLogDO extends BaseDO { diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/notice/NoticeDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/notice/NoticeDO.java similarity index 79% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/notice/NoticeDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/notice/NoticeDO.java index 8a53013..d50d997 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/notice/NoticeDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/notice/NoticeDO.java @@ -3,7 +3,7 @@ package com.njcn.msgpush.module.system.dal.dataobject.notice; import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; import com.njcn.msgpush.module.system.enums.notice.NoticeTypeEnum; -import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -11,10 +11,9 @@ import lombok.EqualsAndHashCode; /** * 通知公告表 * - * @author ruoyi + * @author hongawen */ @TableName("system_notice") -@KeySequence("system_notice_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) public class NoticeDO extends BaseDO { @@ -22,6 +21,7 @@ public class NoticeDO extends BaseDO { /** * 公告ID */ + @TableId private Long id; /** * 公告标题 diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/notify/NotifyMessageDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/notify/NotifyMessageDO.java similarity index 90% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/notify/NotifyMessageDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/notify/NotifyMessageDO.java index df62b8d..659a172 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/notify/NotifyMessageDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/notify/NotifyMessageDO.java @@ -2,7 +2,6 @@ package com.njcn.msgpush.module.system.dal.dataobject.notify; import com.njcn.msgpush.framework.common.enums.UserTypeEnum; import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; -import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; @@ -15,10 +14,9 @@ import java.util.Map; /** * 站内信 DO * - * @author xrcoder + * @author hongawen */ @TableName(value = "system_notify_message", autoResultMap = true) -@KeySequence("system_notify_message_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/notify/NotifyTemplateDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/notify/NotifyTemplateDO.java similarity index 85% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/notify/NotifyTemplateDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/notify/NotifyTemplateDO.java index d057a5b..d858a2f 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/notify/NotifyTemplateDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/notify/NotifyTemplateDO.java @@ -3,7 +3,6 @@ package com.njcn.msgpush.module.system.dal.dataobject.notify; import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; -import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; @@ -15,16 +14,16 @@ import java.util.List; /** * 站内信模版 DO * - * @author xrcoder + * @author hongawen */ @TableName(value = "system_notify_template", autoResultMap = true) -@KeySequence("system_notify_template_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @Builder @NoArgsConstructor @AllArgsConstructor + public class NotifyTemplateDO extends BaseDO { /** diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2AccessTokenDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2AccessTokenDO.java similarity index 88% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2AccessTokenDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2AccessTokenDO.java index 6f3874c..e10ea19 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2AccessTokenDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2AccessTokenDO.java @@ -1,12 +1,11 @@ package com.njcn.msgpush.module.system.dal.dataobject.oauth2; import com.njcn.msgpush.framework.common.enums.UserTypeEnum; -import com.baomidou.mybatisplus.annotation.KeySequence; +import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; -import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; import lombok.Data; import lombok.EqualsAndHashCode; @@ -23,7 +22,6 @@ import java.util.Map; * @author hongawen */ @TableName(value = "system_oauth2_access_token", autoResultMap = true) -@KeySequence("system_oauth2_access_token_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) public class OAuth2AccessTokenDO extends BaseDO { diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2ApproveDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2ApproveDO.java similarity index 85% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2ApproveDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2ApproveDO.java index 0da261e..70f0ffa 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2ApproveDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2ApproveDO.java @@ -2,7 +2,6 @@ package com.njcn.msgpush.module.system.dal.dataobject.oauth2; import com.njcn.msgpush.framework.common.enums.UserTypeEnum; import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; -import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; @@ -18,7 +17,6 @@ import java.time.LocalDateTime; * @author hongawen */ @TableName(value = "system_oauth2_approve", autoResultMap = true) -@KeySequence("system_oauth2_approve_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) public class OAuth2ApproveDO extends BaseDO { diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2ClientDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2ClientDO.java similarity index 92% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2ClientDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2ClientDO.java index 77a8f9e..63c8d61 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2ClientDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2ClientDO.java @@ -4,7 +4,6 @@ import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; import com.njcn.msgpush.module.system.enums.oauth2.OAuth2GrantTypeEnum; -import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; @@ -20,9 +19,9 @@ import java.util.List; * @author hongawen */ @TableName(value = "system_oauth2_client", autoResultMap = true) -@KeySequence("system_oauth2_client_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) + public class OAuth2ClientDO extends BaseDO { /** diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2CodeDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2CodeDO.java similarity index 86% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2CodeDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2CodeDO.java index e7b7e1f..fd2702f 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2CodeDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2CodeDO.java @@ -2,8 +2,8 @@ package com.njcn.msgpush.module.system.dal.dataobject.oauth2; import com.njcn.msgpush.framework.common.enums.UserTypeEnum; import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; -import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; import lombok.Data; @@ -18,7 +18,6 @@ import java.util.List; * @author hongawen */ @TableName(value = "system_oauth2_code", autoResultMap = true) -@KeySequence("system_oauth2_code_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) public class OAuth2CodeDO extends BaseDO { @@ -26,6 +25,7 @@ public class OAuth2CodeDO extends BaseDO { /** * 编号,数据库递增 */ + @TableId private Long id; /** * 授权码 diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2RefreshTokenDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2RefreshTokenDO.java similarity index 85% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2RefreshTokenDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2RefreshTokenDO.java index 8be1dd2..b51848f 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2RefreshTokenDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/oauth2/OAuth2RefreshTokenDO.java @@ -1,11 +1,11 @@ package com.njcn.msgpush.module.system.dal.dataobject.oauth2; import com.njcn.msgpush.framework.common.enums.UserTypeEnum; -import com.baomidou.mybatisplus.annotation.KeySequence; +import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; -import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; import lombok.Data; import java.time.LocalDateTime; @@ -18,13 +18,13 @@ import java.util.List; */ @TableName(value = "system_oauth2_refresh_token", autoResultMap = true) // 由于 Oracle 的 SEQ 的名字长度有限制,所以就先用 system_oauth2_access_token_seq 吧,反正也没啥问题 -@KeySequence("system_oauth2_access_token_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data public class OAuth2RefreshTokenDO extends BaseDO { /** * 编号,数据库字典 */ + @TableId private Long id; /** * 刷新令牌 diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/MenuDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/MenuDO.java similarity index 92% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/MenuDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/MenuDO.java index bfd8f6f..2991ea2 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/MenuDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/MenuDO.java @@ -4,7 +4,6 @@ import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; import com.njcn.msgpush.module.system.enums.permission.MenuTypeEnum; -import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; @@ -13,12 +12,12 @@ import lombok.EqualsAndHashCode; /** * 菜单 DO * - * @author ruoyi + * @author hongawen */ @TableName("system_menu") -@KeySequence("system_menu_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) + public class MenuDO extends BaseDO { /** @@ -78,6 +77,14 @@ public class MenuDO extends BaseDO { * 组件名 */ private String componentName; + /** + * 路由类型 + */ + private String routeKind; + /** + * 路由 props JSON + */ + private String routePropsJson; /** * 状态 * diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/RoleDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/RoleDO.java similarity index 58% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/RoleDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/RoleDO.java index 0636a8d..89ac8c7 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/RoleDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/RoleDO.java @@ -2,25 +2,18 @@ package com.njcn.msgpush.module.system.dal.dataobject.permission; import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; -import com.njcn.msgpush.module.system.enums.permission.DataScopeEnum; import com.njcn.msgpush.module.system.enums.permission.RoleTypeEnum; -import com.baomidou.mybatisplus.annotation.KeySequence; -import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Set; - /** * 角色 DO * - * @author ruoyi + * @author hongawen */ @TableName(value = "system_role", autoResultMap = true) -@KeySequence("system_role_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) public class RoleDO extends BaseDO { @@ -61,18 +54,4 @@ public class RoleDO extends BaseDO { */ private String remark; - /** - * 数据范围 - * - * 枚举 {@link DataScopeEnum} - */ - private Integer dataScope; - /** - * 数据范围(指定部门数组) - * - * 适用于 {@link #dataScope} 的值为 {@link DataScopeEnum#DEPT_CUSTOM} 时 - */ - @TableField(typeHandler = JacksonTypeHandler.class) - private Set dataScopeDeptIds; - } diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/RoleMenuDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/RoleMenuDO.java similarity index 73% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/RoleMenuDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/RoleMenuDO.java index db202fb..1920339 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/RoleMenuDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/RoleMenuDO.java @@ -1,19 +1,17 @@ package com.njcn.msgpush.module.system.dal.dataobject.permission; -import com.baomidou.mybatisplus.annotation.KeySequence; +import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; import lombok.Data; import lombok.EqualsAndHashCode; /** * 角色和菜单关联 * - * @author ruoyi + * @author hongawen */ @TableName("system_role_menu") -@KeySequence("system_role_menu_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) public class RoleMenuDO extends BaseDO { diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/UserRoleDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/UserRoleDO.java similarity index 73% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/UserRoleDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/UserRoleDO.java index 3262567..e8d0ecf 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/UserRoleDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/permission/UserRoleDO.java @@ -1,7 +1,6 @@ package com.njcn.msgpush.module.system.dal.dataobject.permission; import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; -import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; @@ -10,10 +9,9 @@ import lombok.EqualsAndHashCode; /** * 用户和角色关联 * - * @author ruoyi + * @author hongawen */ @TableName("system_user_role") -@KeySequence("system_user_role_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) public class UserRoleDO extends BaseDO { diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/user/AdminUserDO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/user/AdminUserDO.java similarity index 79% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/user/AdminUserDO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/user/AdminUserDO.java index 53b20a2..a1616fc 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/user/AdminUserDO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/dataobject/user/AdminUserDO.java @@ -1,18 +1,20 @@ package com.njcn.msgpush.module.system.dal.dataobject.user; -import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; -import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; -import com.njcn.msgpush.module.system.enums.common.SexEnum; -import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.FieldStrategy; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; -import lombok.*; +import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; +import com.njcn.msgpush.framework.mybatis.core.dataobject.BaseDO; +import com.njcn.msgpush.module.system.enums.common.SexEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import java.time.LocalDateTime; -import java.util.Set; /** * 管理后台的用户 DO @@ -20,7 +22,6 @@ import java.util.Set; * @author hongawen */ @TableName(value = "system_users", autoResultMap = true) // 由于 SQL Server 的 system_user 是关键字,所以使用 system_users -@KeySequence("system_users_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) @Builder @@ -29,65 +30,83 @@ import java.util.Set; public class AdminUserDO extends BaseDO { /** - * 用户ID + * 用户 ID */ @TableId private Long id; + /** * 用户账号 */ private String username; + /** * 加密后的密码 * * 因为目前使用 {@link BCryptPasswordEncoder} 加密器,所以无需自己处理 salt 盐 */ private String password; + /** * 用户昵称 */ private String nickname; + /** * 备注 */ private String remark; + /** * 部门 ID */ private Long deptId; + /** - * 岗位编号数组 + * 主岗位编号 */ - @TableField(typeHandler = JacksonTypeHandler.class) - private Set postIds; + private Long positionId; + + /** + * 离职时间 + */ + @TableField(updateStrategy = FieldStrategy.ALWAYS) + private LocalDateTime resignedAt; + /** * 用户邮箱 */ private String email; + /** * 手机号码 */ private String mobile; + /** * 用户性别 * * 枚举类 {@link SexEnum} */ private Integer sex; + /** * 用户头像 */ private String avatar; + /** * 帐号状态 * * 枚举 {@link CommonStatusEnum} */ private Integer status; + /** - * 最后登录IP + * 最后登录 IP */ private String loginIp; + /** * 最后登录时间 */ diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/mysql/config/ConfigMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/config/ConfigMapper.java similarity index 81% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/mysql/config/ConfigMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/config/ConfigMapper.java index 4f91413..a307b6f 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/mysql/config/ConfigMapper.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/config/ConfigMapper.java @@ -1,10 +1,10 @@ -package com.njcn.msgpush.module.infra.dal.mysql.config; +package com.njcn.msgpush.module.system.dal.mysql.config; import com.njcn.msgpush.framework.common.pojo.PageResult; import com.njcn.msgpush.framework.mybatis.core.mapper.BaseMapperX; import com.njcn.msgpush.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.njcn.msgpush.module.infra.controller.admin.config.vo.ConfigPageReqVO; -import com.njcn.msgpush.module.infra.dal.dataobject.config.ConfigDO; +import com.njcn.msgpush.module.system.controller.admin.config.vo.ConfigPageReqVO; +import com.njcn.msgpush.module.system.dal.dataobject.config.ConfigDO; import org.apache.ibatis.annotations.Mapper; @Mapper diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dept/DeptMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dept/DeptMapper.java similarity index 77% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dept/DeptMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dept/DeptMapper.java index b3f584c..d7c91c4 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dept/DeptMapper.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dept/DeptMapper.java @@ -15,6 +15,7 @@ public interface DeptMapper extends BaseMapperX { default List selectList(DeptListReqVO reqVO) { return selectList(new LambdaQueryWrapperX() .likeIfPresent(DeptDO::getName, reqVO.getName()) + .eqIfPresent(DeptDO::getOrgType, reqVO.getOrgType()) .eqIfPresent(DeptDO::getStatus, reqVO.getStatus())); } @@ -22,6 +23,10 @@ public interface DeptMapper extends BaseMapperX { return selectOne(DeptDO::getParentId, parentId, DeptDO::getName, name); } + default DeptDO selectByCode(String code) { + return selectOne(DeptDO::getCode, code); + } + default Long selectCountByParentId(Long parentId) { return selectCount(DeptDO::getParentId, parentId); } @@ -30,8 +35,8 @@ public interface DeptMapper extends BaseMapperX { return selectList(DeptDO::getParentId, parentIds); } - default List selectListByLeaderUserId(Long id) { - return selectList(DeptDO::getLeaderUserId, id); + default List selectListByPathPrefix(String pathPrefix) { + return selectList(new LambdaQueryWrapperX().likeRight(DeptDO::getPath, pathPrefix)); } } diff --git a/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dept/OrgLeaderRelationMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dept/OrgLeaderRelationMapper.java new file mode 100644 index 0000000..2af8494 --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dept/OrgLeaderRelationMapper.java @@ -0,0 +1,26 @@ +package com.njcn.msgpush.module.system.dal.mysql.dept; + +import com.njcn.msgpush.framework.mybatis.core.mapper.BaseMapperX; +import com.njcn.msgpush.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.njcn.msgpush.module.system.dal.dataobject.dept.OrgLeaderRelationDO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface OrgLeaderRelationMapper extends BaseMapperX { + + default List selectListByDeptId(Long deptId) { + return selectList(new LambdaQueryWrapperX() + .eq(OrgLeaderRelationDO::getDeptId, deptId) + .orderByDesc(OrgLeaderRelationDO::getId)); + } + + default List selectListByDeptIdAndUserId(Long deptId, Long userId) { + return selectList(new LambdaQueryWrapperX() + .eq(OrgLeaderRelationDO::getDeptId, deptId) + .eq(OrgLeaderRelationDO::getUserId, userId) + .orderByDesc(OrgLeaderRelationDO::getId)); + } + +} diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dept/PostMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dept/PostMapper.java similarity index 90% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dept/PostMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dept/PostMapper.java index db05781..25e8742 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dept/PostMapper.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dept/PostMapper.java @@ -23,6 +23,8 @@ public interface PostMapper extends BaseMapperX { return selectPage(reqVO, new LambdaQueryWrapperX() .likeIfPresent(PostDO::getCode, reqVO.getCode()) .likeIfPresent(PostDO::getName, reqVO.getName()) + .eqIfPresent(PostDO::getPostType, reqVO.getPostType()) + .eqIfPresent(PostDO::getLevelRank, reqVO.getLevelRank()) .eqIfPresent(PostDO::getStatus, reqVO.getStatus()) .orderByDesc(PostDO::getId)); } diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dict/DictDataMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dict/DictDataMapper.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dict/DictDataMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dict/DictDataMapper.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dict/DictTypeMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dict/DictTypeMapper.java similarity index 58% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dict/DictTypeMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dict/DictTypeMapper.java index 92ed942..012807a 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dict/DictTypeMapper.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/dict/DictTypeMapper.java @@ -8,6 +8,7 @@ import com.njcn.msgpush.module.system.dal.dataobject.dict.DictTypeDO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Update; +import org.springframework.util.StringUtils; import java.time.LocalDateTime; @@ -15,12 +16,22 @@ import java.time.LocalDateTime; public interface DictTypeMapper extends BaseMapperX { default PageResult selectPage(DictTypePageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .likeIfPresent(DictTypeDO::getName, reqVO.getName()) - .likeIfPresent(DictTypeDO::getType, reqVO.getType()) - .eqIfPresent(DictTypeDO::getStatus, reqVO.getStatus()) + LambdaQueryWrapperX queryWrapper = new LambdaQueryWrapperX<>(); + String typeKeyword = reqVO.getTypeKeyword(); + boolean hasName = StringUtils.hasText(reqVO.getName()); + boolean hasType = StringUtils.hasText(typeKeyword); + if (hasName && hasType) { + queryWrapper.and(wrapper -> wrapper.like(DictTypeDO::getName, reqVO.getName()) + .or() + .like(DictTypeDO::getType, typeKeyword)); + } else { + queryWrapper.likeIfPresent(DictTypeDO::getName, reqVO.getName()) + .likeIfPresent(DictTypeDO::getType, typeKeyword); + } + queryWrapper.eqIfPresent(DictTypeDO::getStatus, reqVO.getStatus()) .betweenIfPresent(DictTypeDO::getCreateTime, reqVO.getCreateTime()) - .orderByDesc(DictTypeDO::getId)); + .orderByDesc(DictTypeDO::getId); + return selectPage(reqVO, queryWrapper); } default DictTypeDO selectByType(String type) { diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/mysql/file/FileConfigMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/file/FileConfigMapper.java similarity index 80% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/mysql/file/FileConfigMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/file/FileConfigMapper.java index 8e15c5e..2f05d5a 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/mysql/file/FileConfigMapper.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/file/FileConfigMapper.java @@ -1,10 +1,10 @@ -package com.njcn.msgpush.module.infra.dal.mysql.file; +package com.njcn.msgpush.module.system.dal.mysql.file; import com.njcn.msgpush.framework.common.pojo.PageResult; import com.njcn.msgpush.framework.mybatis.core.mapper.BaseMapperX; import com.njcn.msgpush.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.njcn.msgpush.module.infra.controller.admin.file.vo.config.FileConfigPageReqVO; -import com.njcn.msgpush.module.infra.dal.dataobject.file.FileConfigDO; +import com.njcn.msgpush.module.system.controller.admin.file.vo.config.FileConfigPageReqVO; +import com.njcn.msgpush.module.system.dal.dataobject.file.FileConfigDO; import org.apache.ibatis.annotations.Mapper; @Mapper diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/mysql/file/FileContentMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/file/FileContentMapper.java similarity index 86% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/mysql/file/FileContentMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/file/FileContentMapper.java index 107cc10..22a3113 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/mysql/file/FileContentMapper.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/file/FileContentMapper.java @@ -1,8 +1,8 @@ -package com.njcn.msgpush.module.infra.dal.mysql.file; +package com.njcn.msgpush.module.system.dal.mysql.file; -import com.njcn.msgpush.module.infra.dal.dataobject.file.FileContentDO; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.njcn.msgpush.module.system.dal.dataobject.file.FileContentDO; import org.apache.ibatis.annotations.Mapper; import java.util.List; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/mysql/file/FileMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/file/FileMapper.java similarity index 78% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/mysql/file/FileMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/file/FileMapper.java index 3cfd45b..6d170cc 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/mysql/file/FileMapper.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/file/FileMapper.java @@ -1,10 +1,10 @@ -package com.njcn.msgpush.module.infra.dal.mysql.file; +package com.njcn.msgpush.module.system.dal.mysql.file; import com.njcn.msgpush.framework.common.pojo.PageResult; import com.njcn.msgpush.framework.mybatis.core.mapper.BaseMapperX; import com.njcn.msgpush.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.njcn.msgpush.module.infra.controller.admin.file.vo.file.FilePageReqVO; -import com.njcn.msgpush.module.infra.dal.dataobject.file.FileDO; +import com.njcn.msgpush.module.system.controller.admin.file.vo.file.FilePageReqVO; +import com.njcn.msgpush.module.system.dal.dataobject.file.FileDO; import org.apache.ibatis.annotations.Mapper; /** diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/mysql/logger/ApiAccessLogMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/logger/ApiAccessLogMapper.java similarity index 88% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/mysql/logger/ApiAccessLogMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/logger/ApiAccessLogMapper.java index ba82934..3a1da50 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/mysql/logger/ApiAccessLogMapper.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/logger/ApiAccessLogMapper.java @@ -1,10 +1,10 @@ -package com.njcn.msgpush.module.infra.dal.mysql.logger; +package com.njcn.msgpush.module.system.dal.mysql.logger; import com.njcn.msgpush.framework.common.pojo.PageResult; import com.njcn.msgpush.framework.mybatis.core.mapper.BaseMapperX; import com.njcn.msgpush.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.njcn.msgpush.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogPageReqVO; -import com.njcn.msgpush.module.infra.dal.dataobject.logger.ApiAccessLogDO; +import com.njcn.msgpush.module.system.controller.admin.logger.vo.apiaccesslog.ApiAccessLogPageReqVO; +import com.njcn.msgpush.module.system.dal.dataobject.logger.ApiAccessLogDO; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/mysql/logger/ApiErrorLogMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/logger/ApiErrorLogMapper.java similarity index 87% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/mysql/logger/ApiErrorLogMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/logger/ApiErrorLogMapper.java index 0024d8e..500a23d 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/dal/mysql/logger/ApiErrorLogMapper.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/logger/ApiErrorLogMapper.java @@ -1,10 +1,10 @@ -package com.njcn.msgpush.module.infra.dal.mysql.logger; +package com.njcn.msgpush.module.system.dal.mysql.logger; import com.njcn.msgpush.framework.common.pojo.PageResult; import com.njcn.msgpush.framework.mybatis.core.mapper.BaseMapperX; import com.njcn.msgpush.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.njcn.msgpush.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogPageReqVO; -import com.njcn.msgpush.module.infra.dal.dataobject.logger.ApiErrorLogDO; +import com.njcn.msgpush.module.system.controller.admin.logger.vo.apierrorlog.ApiErrorLogPageReqVO; +import com.njcn.msgpush.module.system.dal.dataobject.logger.ApiErrorLogDO; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/logger/LoginLogMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/logger/LoginLogMapper.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/logger/LoginLogMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/logger/LoginLogMapper.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/logger/OperateLogMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/logger/OperateLogMapper.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/logger/OperateLogMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/logger/OperateLogMapper.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/notice/NoticeMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/notice/NoticeMapper.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/notice/NoticeMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/notice/NoticeMapper.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/notify/NotifyMessageMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/notify/NotifyMessageMapper.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/notify/NotifyMessageMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/notify/NotifyMessageMapper.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/notify/NotifyTemplateMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/notify/NotifyTemplateMapper.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/notify/NotifyTemplateMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/notify/NotifyTemplateMapper.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2AccessTokenMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2AccessTokenMapper.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2AccessTokenMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2AccessTokenMapper.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2ApproveMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2ApproveMapper.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2ApproveMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2ApproveMapper.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2ClientMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2ClientMapper.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2ClientMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2ClientMapper.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2CodeMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2CodeMapper.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2CodeMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2CodeMapper.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2RefreshTokenMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2RefreshTokenMapper.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2RefreshTokenMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/oauth2/OAuth2RefreshTokenMapper.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/package-info.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/package-info.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/package-info.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/package-info.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/permission/MenuMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/permission/MenuMapper.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/permission/MenuMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/permission/MenuMapper.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/permission/RoleMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/permission/RoleMapper.java similarity index 60% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/permission/RoleMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/permission/RoleMapper.java index e2f03b4..370bab6 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/permission/RoleMapper.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/permission/RoleMapper.java @@ -8,6 +8,7 @@ import com.njcn.msgpush.module.system.controller.admin.permission.vo.role.RolePa import com.njcn.msgpush.module.system.dal.dataobject.permission.RoleDO; import org.apache.ibatis.annotations.Mapper; import org.springframework.lang.Nullable; +import org.springframework.util.StringUtils; import java.util.Collection; import java.util.List; @@ -16,12 +17,21 @@ import java.util.List; public interface RoleMapper extends BaseMapperX { default PageResult selectPage(RolePageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .likeIfPresent(RoleDO::getName, reqVO.getName()) - .likeIfPresent(RoleDO::getCode, reqVO.getCode()) - .eqIfPresent(RoleDO::getStatus, reqVO.getStatus()) + LambdaQueryWrapperX queryWrapper = new LambdaQueryWrapperX<>(); + boolean hasName = StringUtils.hasText(reqVO.getName()); + boolean hasCode = StringUtils.hasText(reqVO.getCode()); + if (hasName && hasCode) { + queryWrapper.and(wrapper -> wrapper.like(RoleDO::getName, reqVO.getName()) + .or() + .like(RoleDO::getCode, reqVO.getCode())); + } else { + queryWrapper.likeIfPresent(RoleDO::getName, reqVO.getName()) + .likeIfPresent(RoleDO::getCode, reqVO.getCode()); + } + queryWrapper.eqIfPresent(RoleDO::getStatus, reqVO.getStatus()) .betweenIfPresent(BaseDO::getCreateTime, reqVO.getCreateTime()) - .orderByAsc(RoleDO::getSort)); + .orderByAsc(RoleDO::getSort); + return selectPage(reqVO, queryWrapper); } default RoleDO selectByName(String name) { diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/permission/RoleMenuMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/permission/RoleMenuMapper.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/permission/RoleMenuMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/permission/RoleMenuMapper.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/permission/UserRoleMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/permission/UserRoleMapper.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/permission/UserRoleMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/permission/UserRoleMapper.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/user/AdminUserMapper.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/user/AdminUserMapper.java similarity index 92% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/user/AdminUserMapper.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/user/AdminUserMapper.java index 9a1a77b..dc28e16 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/mysql/user/AdminUserMapper.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/mysql/user/AdminUserMapper.java @@ -48,4 +48,8 @@ public interface AdminUserMapper extends BaseMapperX { return selectList(AdminUserDO::getDeptId, deptIds); } + default List selectListByPositionIds(Collection positionIds) { + return selectList(AdminUserDO::getPositionId, positionIds); + } + } diff --git a/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/redis/RedisKeyConstants.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/redis/RedisKeyConstants.java new file mode 100644 index 0000000..d935a13 --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/redis/RedisKeyConstants.java @@ -0,0 +1,30 @@ +package com.njcn.msgpush.module.system.dal.redis; + +import com.njcn.msgpush.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO; + +/** + * System Redis Key 常量。 + */ +public interface RedisKeyConstants { + + String DEPT_CHILDREN_ID_LIST = "dept_children_ids"; + + String ROLE = "role"; + + String USER_ROLE_ID_LIST = "user_role_ids"; + + String MENU_ROLE_ID_LIST = "menu_role_ids"; + + String PERMISSION_MENU_ID_LIST = "permission_menu_ids"; + + String OAUTH_CLIENT = "oauth_client"; + + /** + * KEY: oauth2_access_token:{token} + * VALUE: {@link OAuth2AccessTokenDO} + */ + String OAUTH2_ACCESS_TOKEN = "oauth2_access_token:%s"; + + String NOTIFY_TEMPLATE = "notify_template"; + +} diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/redis/oauth2/OAuth2AccessTokenRedisDAO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/redis/oauth2/OAuth2AccessTokenRedisDAO.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/dal/redis/oauth2/OAuth2AccessTokenRedisDAO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/dal/redis/oauth2/OAuth2AccessTokenRedisDAO.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/captcha/config/MsgpushCaptchaConfiguration.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/captcha/config/MsgpushCaptchaConfiguration.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/captcha/config/MsgpushCaptchaConfiguration.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/captcha/config/MsgpushCaptchaConfiguration.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/captcha/core/PictureWordCaptchaServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/captcha/core/PictureWordCaptchaServiceImpl.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/captcha/core/PictureWordCaptchaServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/captcha/core/PictureWordCaptchaServiceImpl.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/captcha/core/RedisCaptchaServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/captcha/core/RedisCaptchaServiceImpl.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/captcha/core/RedisCaptchaServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/captcha/core/RedisCaptchaServiceImpl.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/captcha/package-info.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/captcha/package-info.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/captcha/package-info.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/captcha/package-info.java diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/config/MsgpushFileAutoConfiguration.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/config/MsgpushFileAutoConfiguration.java similarity index 60% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/config/MsgpushFileAutoConfiguration.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/config/MsgpushFileAutoConfiguration.java index d9f2503..808c6ab 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/config/MsgpushFileAutoConfiguration.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/config/MsgpushFileAutoConfiguration.java @@ -1,7 +1,7 @@ -package com.njcn.msgpush.module.infra.framework.file.config; +package com.njcn.msgpush.module.system.framework.file.config; -import com.njcn.msgpush.module.infra.framework.file.core.client.FileClientFactory; -import com.njcn.msgpush.module.infra.framework.file.core.client.FileClientFactoryImpl; +import com.njcn.msgpush.module.system.framework.file.core.client.FileClientFactory; +import com.njcn.msgpush.module.system.framework.file.core.client.FileClientFactoryImpl; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/AbstractFileClient.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/AbstractFileClient.java similarity index 91% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/AbstractFileClient.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/AbstractFileClient.java index 0226118..7caabae 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/AbstractFileClient.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/AbstractFileClient.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.infra.framework.file.core.client; +package com.njcn.msgpush.module.system.framework.file.core.client; import cn.hutool.core.util.StrUtil; import lombok.extern.slf4j.Slf4j; @@ -72,7 +72,8 @@ public abstract class AbstractFileClient implem * @return URL 访问地址 */ protected String formatFileUrl(String domain, String path) { - return StrUtil.format("{}/admin-api/infra/file/{}/get/{}", domain, getId(), path); + return StrUtil.format("{}/admin-api/system/file/{}/get/{}", domain, getId(), path); } } + diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/FileClient.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/FileClient.java similarity index 95% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/FileClient.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/FileClient.java index 49344f3..605bed0 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/FileClient.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/FileClient.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.infra.framework.file.core.client; +package com.njcn.msgpush.module.system.framework.file.core.client; /** * 文件客户端 diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/FileClientConfig.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/FileClientConfig.java similarity index 87% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/FileClientConfig.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/FileClientConfig.java index fcff703..b97241f 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/FileClientConfig.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/FileClientConfig.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.infra.framework.file.core.client; +package com.njcn.msgpush.module.system.framework.file.core.client; import com.fasterxml.jackson.annotation.JsonTypeInfo; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/FileClientFactory.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/FileClientFactory.java similarity index 77% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/FileClientFactory.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/FileClientFactory.java index 2f6a094..e068002 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/FileClientFactory.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/FileClientFactory.java @@ -1,6 +1,6 @@ -package com.njcn.msgpush.module.infra.framework.file.core.client; +package com.njcn.msgpush.module.system.framework.file.core.client; -import com.njcn.msgpush.module.infra.framework.file.core.enums.FileStorageEnum; +import com.njcn.msgpush.module.system.framework.file.core.enums.FileStorageEnum; public interface FileClientFactory { diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/FileClientFactoryImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/FileClientFactoryImpl.java similarity index 92% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/FileClientFactoryImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/FileClientFactoryImpl.java index 20c64d0..2ea24c2 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/FileClientFactoryImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/FileClientFactoryImpl.java @@ -1,8 +1,8 @@ -package com.njcn.msgpush.module.infra.framework.file.core.client; +package com.njcn.msgpush.module.system.framework.file.core.client; import cn.hutool.core.lang.Assert; import cn.hutool.core.util.ReflectUtil; -import com.njcn.msgpush.module.infra.framework.file.core.enums.FileStorageEnum; +import com.njcn.msgpush.module.system.framework.file.core.enums.FileStorageEnum; import lombok.extern.slf4j.Slf4j; import java.util.concurrent.ConcurrentHashMap; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/db/DBFileClient.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/db/DBFileClient.java similarity index 82% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/db/DBFileClient.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/db/DBFileClient.java index 677bf9d..b5064f9 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/db/DBFileClient.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/db/DBFileClient.java @@ -1,10 +1,10 @@ -package com.njcn.msgpush.module.infra.framework.file.core.client.db; +package com.njcn.msgpush.module.system.framework.file.core.client.db; import cn.hutool.core.collection.CollUtil; import cn.hutool.extra.spring.SpringUtil; -import com.njcn.msgpush.module.infra.dal.dataobject.file.FileContentDO; -import com.njcn.msgpush.module.infra.dal.mysql.file.FileContentMapper; -import com.njcn.msgpush.module.infra.framework.file.core.client.AbstractFileClient; +import com.njcn.msgpush.module.system.dal.dataobject.file.FileContentDO; +import com.njcn.msgpush.module.system.dal.mysql.file.FileContentMapper; +import com.njcn.msgpush.module.system.framework.file.core.client.AbstractFileClient; import java.util.Comparator; import java.util.List; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/db/DBFileClientConfig.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/db/DBFileClientConfig.java similarity index 73% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/db/DBFileClientConfig.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/db/DBFileClientConfig.java index 70c7b84..9954290 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/db/DBFileClientConfig.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/db/DBFileClientConfig.java @@ -1,6 +1,6 @@ -package com.njcn.msgpush.module.infra.framework.file.core.client.db; +package com.njcn.msgpush.module.system.framework.file.core.client.db; -import com.njcn.msgpush.module.infra.framework.file.core.client.FileClientConfig; +import com.njcn.msgpush.module.system.framework.file.core.client.FileClientConfig; import jakarta.validation.constraints.NotEmpty; import lombok.Data; import org.hibernate.validator.constraints.URL; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/ftp/FtpFileClient.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/ftp/FtpFileClient.java similarity index 94% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/ftp/FtpFileClient.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/ftp/FtpFileClient.java index 3cd04d1..20858b9 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/ftp/FtpFileClient.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/ftp/FtpFileClient.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.infra.framework.file.core.client.ftp; +package com.njcn.msgpush.module.system.framework.file.core.client.ftp; import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.CharsetUtil; @@ -7,7 +7,7 @@ import cn.hutool.extra.ftp.Ftp; import cn.hutool.extra.ftp.FtpConfig; import cn.hutool.extra.ftp.FtpException; import cn.hutool.extra.ftp.FtpMode; -import com.njcn.msgpush.module.infra.framework.file.core.client.AbstractFileClient; +import com.njcn.msgpush.module.system.framework.file.core.client.AbstractFileClient; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/ftp/FtpFileClientConfig.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/ftp/FtpFileClientConfig.java similarity index 88% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/ftp/FtpFileClientConfig.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/ftp/FtpFileClientConfig.java index 9716a8f..cc90e47 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/ftp/FtpFileClientConfig.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/ftp/FtpFileClientConfig.java @@ -1,6 +1,6 @@ -package com.njcn.msgpush.module.infra.framework.file.core.client.ftp; +package com.njcn.msgpush.module.system.framework.file.core.client.ftp; -import com.njcn.msgpush.module.infra.framework.file.core.client.FileClientConfig; +import com.njcn.msgpush.module.system.framework.file.core.client.FileClientConfig; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import lombok.Data; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/local/LocalFileClient.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/local/LocalFileClient.java similarity index 89% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/local/LocalFileClient.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/local/LocalFileClient.java index 8713ec2..fa6c612 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/local/LocalFileClient.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/local/LocalFileClient.java @@ -1,8 +1,8 @@ -package com.njcn.msgpush.module.infra.framework.file.core.client.local; +package com.njcn.msgpush.module.system.framework.file.core.client.local; import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.IORuntimeException; -import com.njcn.msgpush.module.infra.framework.file.core.client.AbstractFileClient; +import com.njcn.msgpush.module.system.framework.file.core.client.AbstractFileClient; import java.io.File; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/local/LocalFileClientConfig.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/local/LocalFileClientConfig.java similarity index 77% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/local/LocalFileClientConfig.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/local/LocalFileClientConfig.java index 36ab24a..d3c63d2 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/local/LocalFileClientConfig.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/local/LocalFileClientConfig.java @@ -1,6 +1,6 @@ -package com.njcn.msgpush.module.infra.framework.file.core.client.local; +package com.njcn.msgpush.module.system.framework.file.core.client.local; -import com.njcn.msgpush.module.infra.framework.file.core.client.FileClientConfig; +import com.njcn.msgpush.module.system.framework.file.core.client.FileClientConfig; import jakarta.validation.constraints.NotEmpty; import lombok.Data; import org.hibernate.validator.constraints.URL; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/s3/S3FileClient.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/s3/S3FileClient.java similarity index 98% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/s3/S3FileClient.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/s3/S3FileClient.java index 26e4009..c6e03b3 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/s3/S3FileClient.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/s3/S3FileClient.java @@ -1,11 +1,11 @@ -package com.njcn.msgpush.module.infra.framework.file.core.client.s3; +package com.njcn.msgpush.module.system.framework.file.core.client.s3; import cn.hutool.core.io.IoUtil; import cn.hutool.core.util.BooleanUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpUtil; import com.njcn.msgpush.framework.common.util.http.HttpUtils; -import com.njcn.msgpush.module.infra.framework.file.core.client.AbstractFileClient; +import com.njcn.msgpush.module.system.framework.file.core.client.AbstractFileClient; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/s3/S3FileClientConfig.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/s3/S3FileClientConfig.java similarity index 96% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/s3/S3FileClientConfig.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/s3/S3FileClientConfig.java index e4b9ca5..449100c 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/s3/S3FileClientConfig.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/s3/S3FileClientConfig.java @@ -1,13 +1,12 @@ -package com.njcn.msgpush.module.infra.framework.file.core.client.s3; +package com.njcn.msgpush.module.system.framework.file.core.client.s3; import cn.hutool.core.util.StrUtil; -import com.njcn.msgpush.module.infra.framework.file.core.client.FileClientConfig; import com.fasterxml.jackson.annotation.JsonIgnore; -import lombok.Data; -import org.hibernate.validator.constraints.URL; - +import com.njcn.msgpush.module.system.framework.file.core.client.FileClientConfig; import jakarta.validation.constraints.AssertTrue; import jakarta.validation.constraints.NotNull; +import lombok.Data; +import org.hibernate.validator.constraints.URL; /** * S3 文件客户端的配置类 diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/sftp/SftpFileClient.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/sftp/SftpFileClient.java similarity index 94% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/sftp/SftpFileClient.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/sftp/SftpFileClient.java index 7df07ad..23064de 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/sftp/SftpFileClient.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/sftp/SftpFileClient.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.infra.framework.file.core.client.sftp; +package com.njcn.msgpush.module.system.framework.file.core.client.sftp; import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.CharsetUtil; @@ -6,9 +6,9 @@ import cn.hutool.core.util.StrUtil; import cn.hutool.extra.ftp.FtpConfig; import cn.hutool.extra.ssh.JschRuntimeException; import cn.hutool.extra.ssh.Sftp; -import com.njcn.msgpush.framework.common.util.io.FileUtils; -import com.njcn.msgpush.module.infra.framework.file.core.client.AbstractFileClient; import com.jcraft.jsch.JSch; +import com.njcn.msgpush.framework.common.util.io.FileUtils; +import com.njcn.msgpush.module.system.framework.file.core.client.AbstractFileClient; import java.io.File; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/sftp/SftpFileClientConfig.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/sftp/SftpFileClientConfig.java similarity index 86% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/sftp/SftpFileClientConfig.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/sftp/SftpFileClientConfig.java index bf20cda..a7ab02a 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/client/sftp/SftpFileClientConfig.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/client/sftp/SftpFileClientConfig.java @@ -1,6 +1,6 @@ -package com.njcn.msgpush.module.infra.framework.file.core.client.sftp; +package com.njcn.msgpush.module.system.framework.file.core.client.sftp; -import com.njcn.msgpush.module.infra.framework.file.core.client.FileClientConfig; +import com.njcn.msgpush.module.system.framework.file.core.client.FileClientConfig; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import lombok.Data; diff --git a/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/enums/FileStorageEnum.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/enums/FileStorageEnum.java new file mode 100644 index 0000000..b646d9d --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/enums/FileStorageEnum.java @@ -0,0 +1,55 @@ +package com.njcn.msgpush.module.system.framework.file.core.enums; + +import cn.hutool.core.util.ArrayUtil; +import com.njcn.msgpush.module.system.framework.file.core.client.FileClient; +import com.njcn.msgpush.module.system.framework.file.core.client.FileClientConfig; +import com.njcn.msgpush.module.system.framework.file.core.client.db.DBFileClient; +import com.njcn.msgpush.module.system.framework.file.core.client.db.DBFileClientConfig; +import com.njcn.msgpush.module.system.framework.file.core.client.ftp.FtpFileClient; +import com.njcn.msgpush.module.system.framework.file.core.client.ftp.FtpFileClientConfig; +import com.njcn.msgpush.module.system.framework.file.core.client.local.LocalFileClient; +import com.njcn.msgpush.module.system.framework.file.core.client.local.LocalFileClientConfig; +import com.njcn.msgpush.module.system.framework.file.core.client.s3.S3FileClient; +import com.njcn.msgpush.module.system.framework.file.core.client.s3.S3FileClientConfig; +import com.njcn.msgpush.module.system.framework.file.core.client.sftp.SftpFileClient; +import com.njcn.msgpush.module.system.framework.file.core.client.sftp.SftpFileClientConfig; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 文件存储器枚举 + * + * @author hongawen + */ +@AllArgsConstructor +@Getter +public enum FileStorageEnum { + + DB(1, DBFileClientConfig.class, DBFileClient.class), + + LOCAL(10, LocalFileClientConfig.class, LocalFileClient.class), + FTP(11, FtpFileClientConfig.class, FtpFileClient.class), + SFTP(12, SftpFileClientConfig.class, SftpFileClient.class), + + S3(20, S3FileClientConfig.class, S3FileClient.class), + ; + + /** + * 存储器 + */ + private final Integer storage; + + /** + * 配置类 + */ + private final Class configClass; + /** + * 客户端类 + */ + private final Class clientClass; + + public static FileStorageEnum getByStorage(Integer storage) { + return ArrayUtil.firstMatch(o -> o.getStorage().equals(storage), values()); + } + +} diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/utils/FileTypeUtils.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/utils/FileTypeUtils.java similarity index 96% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/utils/FileTypeUtils.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/utils/FileTypeUtils.java index 1bbd460..834c9f1 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/core/utils/FileTypeUtils.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/core/utils/FileTypeUtils.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.infra.framework.file.core.utils; +package com.njcn.msgpush.module.system.framework.file.core.utils; import cn.hutool.core.io.IoUtil; import cn.hutool.core.util.StrUtil; @@ -84,6 +84,7 @@ public class FileTypeUtils { response.setContentType(mineType); // 设置内容显示、下载文件名:https://www.cnblogs.com/wq-9/articles/12165056.html if (isImage(mineType)) { + // 参见 https://github.com/YunaiV/ruoyi-vue-pro/issues/692 讨论 response.setHeader("Content-Disposition", "inline;filename=" + HttpUtils.encodeUtf8(filename)); } else { response.setHeader("Content-Disposition", "attachment;filename=" + HttpUtils.encodeUtf8(filename)); diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/package-info.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/package-info.java similarity index 84% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/package-info.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/package-info.java index 5140ecc..176b54a 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/file/package-info.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/file/package-info.java @@ -9,4 +9,4 @@ * * @author hongawen */ -package com.njcn.msgpush.module.infra.framework.file; \ No newline at end of file +package com.njcn.msgpush.module.system.framework.file; \ No newline at end of file diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/monitor/config/AdminServerConfiguration.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/monitor/config/AdminServerConfiguration.java similarity index 98% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/monitor/config/AdminServerConfiguration.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/monitor/config/AdminServerConfiguration.java index 16b4194..fcc6e3f 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/monitor/config/AdminServerConfiguration.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/monitor/config/AdminServerConfiguration.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.infra.framework.monitor.config; +package com.njcn.msgpush.module.system.framework.monitor.config; import jakarta.servlet.DispatcherType; import org.springframework.beans.factory.annotation.Value; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/monitor/package-info.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/monitor/package-info.java similarity index 52% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/monitor/package-info.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/monitor/package-info.java index f6594d1..357b757 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/framework/monitor/package-info.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/monitor/package-info.java @@ -1,4 +1,4 @@ /** * 使用 Spring Boot Admin 实现简单的监控平台 */ -package com.njcn.msgpush.module.infra.framework.monitor; +package com.njcn.msgpush.module.system.framework.monitor; diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/AdminUserParseFunction.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/AdminUserParseFunction.java similarity index 98% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/AdminUserParseFunction.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/AdminUserParseFunction.java index 0b44bfa..6ebc912 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/AdminUserParseFunction.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/AdminUserParseFunction.java @@ -12,7 +12,7 @@ import org.springframework.stereotype.Component; /** * 管理员名字的 {@link IParseFunction} 实现类 * - * @author HUIHUI + * @author hongawen */ @Slf4j @Component diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/AreaParseFunction.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/AreaParseFunction.java similarity index 97% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/AreaParseFunction.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/AreaParseFunction.java index 59f80b5..050ae78 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/AreaParseFunction.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/AreaParseFunction.java @@ -10,7 +10,7 @@ import org.springframework.stereotype.Component; /** * 地名的 {@link IParseFunction} 实现类 * - * @author HUIHUI + * @author hongawen */ @Slf4j @Component diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/BooleanParseFunction.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/BooleanParseFunction.java similarity index 91% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/BooleanParseFunction.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/BooleanParseFunction.java index 7280bf3..78cb1f6 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/BooleanParseFunction.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/BooleanParseFunction.java @@ -2,7 +2,7 @@ package com.njcn.msgpush.module.system.framework.operatelog.core; import cn.hutool.core.util.StrUtil; import com.njcn.msgpush.framework.dict.core.DictFrameworkUtils; -import com.njcn.msgpush.module.infra.enums.DictTypeConstants; +import com.njcn.msgpush.module.system.enums.DictTypeConstants; import com.mzt.logapi.service.IParseFunction; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -10,7 +10,7 @@ import org.springframework.stereotype.Component; /** * 是否类型的 {@link IParseFunction} 实现类 * - * @author HUIHUI + * @author hongawen */ @Component @Slf4j diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/DeptParseFunction.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/DeptParseFunction.java similarity index 98% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/DeptParseFunction.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/DeptParseFunction.java index 3340efb..f7ae7a7 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/DeptParseFunction.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/DeptParseFunction.java @@ -12,7 +12,7 @@ import org.springframework.stereotype.Component; /** * 部门名字的 {@link IParseFunction} 实现类 * - * @author HUIHUI + * @author hongawen */ @Slf4j @Component diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/PostParseFunction.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/PostParseFunction.java similarity index 98% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/PostParseFunction.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/PostParseFunction.java index bb3354f..a1da496 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/PostParseFunction.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/PostParseFunction.java @@ -12,7 +12,7 @@ import org.springframework.stereotype.Component; /** * 岗位名字的 {@link IParseFunction} 实现类 * - * @author HUIHUI + * @author hongawen */ @Slf4j @Component diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/SexParseFunction.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/SexParseFunction.java similarity index 97% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/SexParseFunction.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/SexParseFunction.java index a0aad09..6b32808 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/SexParseFunction.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/core/SexParseFunction.java @@ -10,7 +10,7 @@ import org.springframework.stereotype.Component; /** * 行业的 {@link IParseFunction} 实现类 * - * @author HUIHUI + * @author hongawen */ @Component @Slf4j diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/package-info.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/package-info.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/package-info.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/operatelog/package-info.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/package-info.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/package-info.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/package-info.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/package-info.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/rpc/config/RpcConfiguration.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/rpc/config/RpcConfiguration.java similarity index 51% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/rpc/config/RpcConfiguration.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/rpc/config/RpcConfiguration.java index 2ab9d15..557fdc7 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/rpc/config/RpcConfiguration.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/rpc/config/RpcConfiguration.java @@ -1,12 +1,11 @@ package com.njcn.msgpush.module.system.framework.rpc.config; -import com.njcn.msgpush.module.infra.api.config.ConfigApi; -import com.njcn.msgpush.module.infra.api.file.FileApi; -import com.njcn.msgpush.module.infra.api.websocket.WebSocketSenderApi; +import com.njcn.msgpush.module.system.api.config.ConfigApi; +import com.njcn.msgpush.module.system.api.websocket.WebSocketSenderApi; import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.Configuration; @Configuration(value = "systemRpcConfiguration", proxyBeanMethods = false) -@EnableFeignClients(clients = {FileApi.class, WebSocketSenderApi.class, ConfigApi.class}) +@EnableFeignClients(clients = {WebSocketSenderApi.class, ConfigApi.class}) public class RpcConfiguration { } diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/rpc/package-info.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/rpc/package-info.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/rpc/package-info.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/rpc/package-info.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/security/config/SecurityConfiguration.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/security/config/SecurityConfiguration.java similarity index 94% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/security/config/SecurityConfiguration.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/security/config/SecurityConfiguration.java index e825148..1a04751 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/security/config/SecurityConfiguration.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/security/config/SecurityConfiguration.java @@ -19,7 +19,7 @@ public class SecurityConfiguration { @Override public void customize(AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry registry) { - // TODO 芋艿:这个每个项目都需要重复配置,得捉摸有没通用的方案 + // TODO 这个每个项目都需要重复配置,得捉摸有没通用的方案 // Swagger 接口文档 registry.requestMatchers("/v3/api-docs/**").permitAll() .requestMatchers("/webjars/**").permitAll() diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/security/core/package-info.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/security/core/package-info.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/framework/security/core/package-info.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/framework/security/core/package-info.java diff --git a/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/job/logger/AccessLogCleanJob.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/job/logger/AccessLogCleanJob.java new file mode 100644 index 0000000..dc90c23 --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/job/logger/AccessLogCleanJob.java @@ -0,0 +1,35 @@ +package com.njcn.msgpush.module.system.job.logger; + +import com.njcn.msgpush.module.system.service.logger.ApiAccessLogService; +import jakarta.annotation.Resource; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +/** + * 物理删除 N 天前的访问日志的 Job + * + * @author j-sentinel + */ +@Component +@Slf4j +public class AccessLogCleanJob { + + @Resource + private ApiAccessLogService apiAccessLogService; + + /** + * 清理超过(14)天的日志 + */ + private static final Integer JOB_CLEAN_RETAIN_DAY = 14; + + /** + * 每次删除间隔的条数,如果值太高可能会造成数据库的压力过大 + */ + private static final Integer DELETE_LIMIT = 100; + + public void execute() { + Integer count = apiAccessLogService.cleanAccessLog(JOB_CLEAN_RETAIN_DAY, DELETE_LIMIT); + log.info("[execute][定时执行清理访问日志数量 ({}) 个]", count); + } + +} diff --git a/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/job/logger/ErrorLogCleanJob.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/job/logger/ErrorLogCleanJob.java new file mode 100644 index 0000000..aa7d687 --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/job/logger/ErrorLogCleanJob.java @@ -0,0 +1,35 @@ +package com.njcn.msgpush.module.system.job.logger; + +import com.njcn.msgpush.module.system.service.logger.ApiErrorLogService; +import jakarta.annotation.Resource; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +/** + * 物理删除 N 天前的错误日志的 Job + * + * @author j-sentinel + */ +@Slf4j +@Component +public class ErrorLogCleanJob { + + @Resource + private ApiErrorLogService apiErrorLogService; + + /** + * 清理超过(14)天的日志 + */ + private static final Integer JOB_CLEAN_RETAIN_DAY = 14; + + /** + * 每次删除间隔的条数,如果值太高可能会造成数据库的压力过大 + */ + private static final Integer DELETE_LIMIT = 100; + + public void execute() { + Integer count = apiErrorLogService.cleanErrorLog(JOB_CLEAN_RETAIN_DAY,DELETE_LIMIT); + log.info("[execute][定时执行清理错误日志数量 ({}) 个]", count); + } + +} diff --git a/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/job/package-info.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/job/package-info.java new file mode 100644 index 0000000..772561d --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/job/package-info.java @@ -0,0 +1,4 @@ +/** + * 占位,无特殊含义 + */ +package com.njcn.msgpush.module.system.job; diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/auth/AdminAuthService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/auth/AdminAuthService.java similarity index 77% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/auth/AdminAuthService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/auth/AdminAuthService.java index 120091f..5913d43 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/auth/AdminAuthService.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/auth/AdminAuthService.java @@ -1,20 +1,18 @@ package com.njcn.msgpush.module.system.service.auth; -import com.njcn.msgpush.module.system.controller.admin.auth.vo.*; +import com.njcn.msgpush.module.system.controller.admin.auth.vo.AuthLoginReqVO; +import com.njcn.msgpush.module.system.controller.admin.auth.vo.AuthLoginRespVO; +import com.njcn.msgpush.module.system.controller.admin.auth.vo.AuthRegisterReqVO; import com.njcn.msgpush.module.system.dal.dataobject.user.AdminUserDO; import jakarta.validation.Valid; /** - * 管理后台的认证 Service 接口 - * - * 提供用户的登录、登出的能力 - * - * @author hongawen + * 管理后台认证 Service 接口 */ public interface AdminAuthService { /** - * 验证账号 + 密码。如果通过,则返回用户 + * 验证账号 + 密码。 * * @param username 账号 * @param password 密码 @@ -38,8 +36,6 @@ public interface AdminAuthService { */ void logout(String token, Integer logType); - - /** * 刷新访问令牌 * @@ -56,5 +52,4 @@ public interface AdminAuthService { */ AuthLoginRespVO register(AuthRegisterReqVO createReqVO); - } diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/auth/AdminAuthServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/auth/AdminAuthServiceImpl.java similarity index 87% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/auth/AdminAuthServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/auth/AdminAuthServiceImpl.java index 134a96d..df11e64 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/auth/AdminAuthServiceImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/auth/AdminAuthServiceImpl.java @@ -1,27 +1,30 @@ package com.njcn.msgpush.module.system.service.auth; import cn.hutool.core.util.ObjectUtil; +import com.anji.captcha.model.common.ResponseModel; +import com.anji.captcha.model.vo.CaptchaVO; +import com.anji.captcha.service.CaptchaService; +import com.google.common.annotations.VisibleForTesting; import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; import com.njcn.msgpush.framework.common.enums.UserTypeEnum; import com.njcn.msgpush.framework.common.util.monitor.TracerUtils; import com.njcn.msgpush.framework.common.util.object.BeanUtils; import com.njcn.msgpush.framework.common.util.servlet.ServletUtils; import com.njcn.msgpush.framework.common.util.validation.ValidationUtils; -import com.njcn.msgpush.module.system.api.logger.dto.LoginLogCreateReqDTO; -import com.njcn.msgpush.module.system.controller.admin.auth.vo.*; +import com.njcn.msgpush.module.system.controller.admin.auth.vo.AuthLoginReqVO; +import com.njcn.msgpush.module.system.controller.admin.auth.vo.AuthLoginRespVO; +import com.njcn.msgpush.module.system.controller.admin.auth.vo.AuthRegisterReqVO; +import com.njcn.msgpush.module.system.controller.admin.auth.vo.CaptchaVerificationReqVO; import com.njcn.msgpush.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO; import com.njcn.msgpush.module.system.dal.dataobject.user.AdminUserDO; import com.njcn.msgpush.module.system.enums.logger.LoginLogTypeEnum; import com.njcn.msgpush.module.system.enums.logger.LoginResultEnum; import com.njcn.msgpush.module.system.enums.oauth2.OAuth2ClientConstants; import com.njcn.msgpush.module.system.service.logger.LoginLogService; +import com.njcn.msgpush.module.system.service.logger.dto.LoginLogCreateReqDTO; import com.njcn.msgpush.module.system.service.member.MemberService; import com.njcn.msgpush.module.system.service.oauth2.OAuth2TokenService; import com.njcn.msgpush.module.system.service.user.AdminUserService; -import com.anji.captcha.model.common.ResponseModel; -import com.anji.captcha.model.vo.CaptchaVO; -import com.anji.captcha.service.CaptchaService; -import com.google.common.annotations.VisibleForTesting; import jakarta.annotation.Resource; import jakarta.validation.Validator; import lombok.Setter; @@ -32,12 +35,14 @@ import org.springframework.stereotype.Service; import java.util.Objects; import static com.njcn.msgpush.framework.common.exception.util.ServiceExceptionUtil.exception; -import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.*; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.AUTH_LOGIN_BAD_CREDENTIALS; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.AUTH_LOGIN_CAPTCHA_CODE_ERROR; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.AUTH_LOGIN_USER_DISABLED; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.AUTH_LOGIN_USER_RESIGNED; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.AUTH_REGISTER_CAPTCHA_CODE_ERROR; /** * Auth Service 实现类 - * - * @author hongawen */ @Service @Slf4j @@ -57,16 +62,15 @@ public class AdminAuthServiceImpl implements AdminAuthService { private CaptchaService captchaService; /** - * 验证码的开关,默认为 true + * 验证码开关,默认 true */ @Value("${msgpush.captcha.enable:true}") - @Setter // 为了单测:开启或者关闭验证码 + @Setter private Boolean captchaEnable; @Override public AdminUserDO authenticate(String username, String password) { final LoginLogTypeEnum logTypeEnum = LoginLogTypeEnum.LOGIN_USERNAME; - // 校验账号是否存在 AdminUserDO user = userService.getUserByUsername(username); if (user == null) { createLoginLog(null, username, logTypeEnum, LoginResultEnum.BAD_CREDENTIALS); @@ -76,31 +80,26 @@ public class AdminAuthServiceImpl implements AdminAuthService { createLoginLog(user.getId(), username, logTypeEnum, LoginResultEnum.BAD_CREDENTIALS); throw exception(AUTH_LOGIN_BAD_CREDENTIALS); } - // 校验是否禁用 if (CommonStatusEnum.isDisable(user.getStatus())) { createLoginLog(user.getId(), username, logTypeEnum, LoginResultEnum.USER_DISABLED); throw exception(AUTH_LOGIN_USER_DISABLED); } + if (userService.isUserResigned(user)) { + createLoginLog(user.getId(), username, logTypeEnum, LoginResultEnum.USER_RESIGNED); + throw exception(AUTH_LOGIN_USER_RESIGNED); + } return user; } @Override public AuthLoginRespVO login(AuthLoginReqVO reqVO) { - // 校验验证码 validateCaptcha(reqVO); - - // 使用账号密码,进行登录 AdminUserDO user = authenticate(reqVO.getUsername(), reqVO.getPassword()); - - // 创建 Token 令牌,记录登录日志 return createTokenAfterLoginSuccess(user.getId(), reqVO.getUsername(), LoginLogTypeEnum.LOGIN_USERNAME); } - - private void createLoginLog(Long userId, String username, LoginLogTypeEnum logTypeEnum, LoginResultEnum loginResult) { - // 插入登录日志 LoginLogCreateReqDTO reqDTO = new LoginLogCreateReqDTO(); reqDTO.setLogType(logTypeEnum.getType()); reqDTO.setTraceId(TracerUtils.getTraceId()); @@ -111,7 +110,6 @@ public class AdminAuthServiceImpl implements AdminAuthService { reqDTO.setUserIp(ServletUtils.getClientIP()); reqDTO.setResult(loginResult.getResult()); loginLogService.createLoginLog(reqDTO); - // 更新最后登录时间 if (userId != null && Objects.equals(LoginResultEnum.SUCCESS.getResult(), loginResult.getResult())) { userService.updateUserLogin(userId, ServletUtils.getClientIP()); } @@ -120,16 +118,13 @@ public class AdminAuthServiceImpl implements AdminAuthService { @VisibleForTesting void validateCaptcha(AuthLoginReqVO reqVO) { ResponseModel response = doValidateCaptcha(reqVO); - // 校验验证码 if (!response.isSuccess()) { - // 创建登录失败日志(验证码不正确) createLoginLog(null, reqVO.getUsername(), LoginLogTypeEnum.LOGIN_USERNAME, LoginResultEnum.CAPTCHA_CODE_ERROR); throw exception(AUTH_LOGIN_CAPTCHA_CODE_ERROR, response.getRepMsg()); } } private ResponseModel doValidateCaptcha(CaptchaVerificationReqVO reqVO) { - // 如果验证码关闭,则不进行校验 if (!captchaEnable) { return ResponseModel.success(); } @@ -140,12 +135,9 @@ public class AdminAuthServiceImpl implements AdminAuthService { } private AuthLoginRespVO createTokenAfterLoginSuccess(Long userId, String username, LoginLogTypeEnum logType) { - // 插入登陆日志 createLoginLog(userId, username, logType, LoginResultEnum.SUCCESS); - // 创建访问令牌 OAuth2AccessTokenDO accessTokenDO = oauth2TokenService.createAccessToken(userId, getUserType().getValue(), OAuth2ClientConstants.CLIENT_ID_DEFAULT, null); - // 构建返回结果 return BeanUtils.toBean(accessTokenDO, AuthLoginRespVO.class); } @@ -157,12 +149,10 @@ public class AdminAuthServiceImpl implements AdminAuthService { @Override public void logout(String token, Integer logType) { - // 删除访问令牌 OAuth2AccessTokenDO accessTokenDO = oauth2TokenService.removeAccessToken(token); if (accessTokenDO == null) { return; } - // 删除成功,则记录登出日志 createLogoutLog(accessTokenDO.getUserId(), accessTokenDO.getUserType(), logType); } @@ -197,24 +187,17 @@ public class AdminAuthServiceImpl implements AdminAuthService { @Override public AuthLoginRespVO register(AuthRegisterReqVO registerReqVO) { - // 1. 校验验证码 validateCaptcha(registerReqVO); - - // 2. 校验用户名是否已存在 Long userId = userService.registerUser(registerReqVO); - - // 3. 创建 Token 令牌,记录登录日志 return createTokenAfterLoginSuccess(userId, registerReqVO.getUsername(), LoginLogTypeEnum.LOGIN_USERNAME); } @VisibleForTesting void validateCaptcha(AuthRegisterReqVO reqVO) { ResponseModel response = doValidateCaptcha(reqVO); - // 验证不通过 if (!response.isSuccess()) { throw exception(AUTH_REGISTER_CAPTCHA_CODE_ERROR, response.getRepMsg()); } } - } diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/config/ConfigService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/config/ConfigService.java similarity index 81% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/config/ConfigService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/config/ConfigService.java index 2773ef4..6fb2349 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/config/ConfigService.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/config/ConfigService.java @@ -1,9 +1,9 @@ -package com.njcn.msgpush.module.infra.service.config; +package com.njcn.msgpush.module.system.service.config; import com.njcn.msgpush.framework.common.pojo.PageResult; -import com.njcn.msgpush.module.infra.controller.admin.config.vo.ConfigPageReqVO; -import com.njcn.msgpush.module.infra.controller.admin.config.vo.ConfigSaveReqVO; -import com.njcn.msgpush.module.infra.dal.dataobject.config.ConfigDO; +import com.njcn.msgpush.module.system.controller.admin.config.vo.ConfigPageReqVO; +import com.njcn.msgpush.module.system.controller.admin.config.vo.ConfigSaveReqVO; +import com.njcn.msgpush.module.system.dal.dataobject.config.ConfigDO; import jakarta.validation.Valid; import java.util.List; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/config/ConfigServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/config/ConfigServiceImpl.java similarity index 85% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/config/ConfigServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/config/ConfigServiceImpl.java index d032915..0f62a51 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/config/ConfigServiceImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/config/ConfigServiceImpl.java @@ -1,13 +1,13 @@ -package com.njcn.msgpush.module.infra.service.config; +package com.njcn.msgpush.module.system.service.config; -import com.njcn.msgpush.framework.common.pojo.PageResult; -import com.njcn.msgpush.module.infra.controller.admin.config.vo.ConfigPageReqVO; -import com.njcn.msgpush.module.infra.controller.admin.config.vo.ConfigSaveReqVO; -import com.njcn.msgpush.module.infra.convert.config.ConfigConvert; -import com.njcn.msgpush.module.infra.dal.dataobject.config.ConfigDO; -import com.njcn.msgpush.module.infra.dal.mysql.config.ConfigMapper; -import com.njcn.msgpush.module.infra.enums.config.ConfigTypeEnum; import com.google.common.annotations.VisibleForTesting; +import com.njcn.msgpush.framework.common.pojo.PageResult; +import com.njcn.msgpush.module.system.controller.admin.config.vo.ConfigPageReqVO; +import com.njcn.msgpush.module.system.controller.admin.config.vo.ConfigSaveReqVO; +import com.njcn.msgpush.module.system.convert.config.ConfigConvert; +import com.njcn.msgpush.module.system.dal.dataobject.config.ConfigDO; +import com.njcn.msgpush.module.system.dal.mysql.config.ConfigMapper; +import com.njcn.msgpush.module.system.enums.config.ConfigTypeEnum; import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -16,7 +16,7 @@ import org.springframework.validation.annotation.Validated; import java.util.List; import static com.njcn.msgpush.framework.common.exception.util.ServiceExceptionUtil.exception; -import static com.njcn.msgpush.module.infra.enums.ErrorCodeConstants.*; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.*; /** * 参数配置 Service 实现类 diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/dept/DeptService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dept/DeptService.java similarity index 86% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/dept/DeptService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dept/DeptService.java index 87aa559..6f6e596 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/dept/DeptService.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dept/DeptService.java @@ -5,7 +5,11 @@ import com.njcn.msgpush.module.system.controller.admin.dept.vo.dept.DeptListReqV import com.njcn.msgpush.module.system.controller.admin.dept.vo.dept.DeptSaveReqVO; import com.njcn.msgpush.module.system.dal.dataobject.dept.DeptDO; -import java.util.*; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; /** * 部门 Service 接口 @@ -96,28 +100,18 @@ public interface DeptService { */ List getChildDeptList(Collection ids); - /** - * 获得指定领导者的部门列表 - * - * @param id 领导者编号 - * @return 部门列表 - */ - List getDeptListByLeaderUserId(Long id); - /** * 获得所有子部门,从缓存中 * * @param id 父部门编号 - * @return 子部门列表 + * @return 子部门编号集合 */ Set getChildDeptIdListFromCache(Long id); /** - * 校验部门们是否有效。如下情况,视为无效: - * 1. 部门编号不存在 - * 2. 部门被禁用 + * 校验部门们是否有效 * - * @param ids 角色编号数组 + * @param ids 部门编号数组 */ void validateDeptList(Collection ids); diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/dept/DeptServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dept/DeptServiceImpl.java similarity index 64% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/dept/DeptServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dept/DeptServiceImpl.java index 527c554..9fb8f6c 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/dept/DeptServiceImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dept/DeptServiceImpl.java @@ -2,6 +2,7 @@ package com.njcn.msgpush.module.system.service.dept; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; import com.njcn.msgpush.framework.common.util.object.BeanUtils; import com.njcn.msgpush.module.system.controller.admin.dept.vo.dept.DeptListReqVO; @@ -9,15 +10,24 @@ import com.njcn.msgpush.module.system.controller.admin.dept.vo.dept.DeptSaveReqV import com.njcn.msgpush.module.system.dal.dataobject.dept.DeptDO; import com.njcn.msgpush.module.system.dal.mysql.dept.DeptMapper; import com.njcn.msgpush.module.system.dal.redis.RedisKeyConstants; +import com.njcn.msgpush.module.system.enums.dept.DeptOrgTypeEnum; import com.google.common.annotations.VisibleForTesting; import lombok.extern.slf4j.Slf4j; import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.annotation.Validated; import jakarta.annotation.Resource; -import java.util.*; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; import static com.njcn.msgpush.framework.common.exception.util.ServiceExceptionUtil.exception; import static com.njcn.msgpush.framework.common.util.collection.CollectionUtils.convertSet; @@ -37,40 +47,50 @@ public class DeptServiceImpl implements DeptService { private DeptMapper deptMapper; @Override + @Transactional(rollbackFor = Exception.class) @CacheEvict(cacheNames = RedisKeyConstants.DEPT_CHILDREN_ID_LIST, allEntries = true) // allEntries 清空所有缓存,因为操作一个部门,涉及到多个缓存 public Long createDept(DeptSaveReqVO createReqVO) { - if (createReqVO.getParentId() == null) { - createReqVO.setParentId(DeptDO.PARENT_ID_ROOT); - } + normalizeDeptCreateReq(createReqVO); // 校验父部门的有效性 validateParentDept(null, createReqVO.getParentId()); // 校验部门名的唯一性 validateDeptNameUnique(null, createReqVO.getParentId(), createReqVO.getName()); + // 校验组织编码唯一性 + validateDeptCodeUnique(null, createReqVO.getCode()); + // 校验组织节点类型 + validateDeptOrgType(createReqVO.getOrgType()); // 插入部门 DeptDO dept = BeanUtils.toBean(createReqVO, DeptDO.class); deptMapper.insert(dept); + fillDeptTreeFields(dept, createReqVO.getParentId()); + deptMapper.updateById(dept); return dept.getId(); } @Override + @Transactional(rollbackFor = Exception.class) @CacheEvict(cacheNames = RedisKeyConstants.DEPT_CHILDREN_ID_LIST, allEntries = true) // allEntries 清空所有缓存,因为操作一个部门,涉及到多个缓存 public void updateDept(DeptSaveReqVO updateReqVO) { - if (updateReqVO.getParentId() == null) { - updateReqVO.setParentId(DeptDO.PARENT_ID_ROOT); - } // 校验自己存在 - validateDeptExists(updateReqVO.getId()); + DeptDO oldDept = validateDeptExists(updateReqVO.getId()); + normalizeDeptUpdateReq(updateReqVO, oldDept); // 校验父部门的有效性 validateParentDept(updateReqVO.getId(), updateReqVO.getParentId()); // 校验部门名的唯一性 validateDeptNameUnique(updateReqVO.getId(), updateReqVO.getParentId(), updateReqVO.getName()); + // 校验组织编码唯一性 + validateDeptCodeUnique(updateReqVO.getId(), updateReqVO.getCode()); + // 校验组织节点类型 + validateDeptOrgType(updateReqVO.getOrgType()); // 更新部门 DeptDO updateObj = BeanUtils.toBean(updateReqVO, DeptDO.class); + fillDeptTreeFields(updateObj, updateReqVO.getParentId()); deptMapper.updateById(updateObj); + updateChildDeptTree(updateObj.getId(), oldDept.getPath(), oldDept.getLevel(), updateObj.getPath(), updateObj.getLevel()); } @Override @@ -103,14 +123,15 @@ public class DeptServiceImpl implements DeptService { } @VisibleForTesting - void validateDeptExists(Long id) { + DeptDO validateDeptExists(Long id) { if (id == null) { - return; + return null; } DeptDO dept = deptMapper.selectById(id); if (dept == null) { throw exception(DEPT_NOT_FOUND); } + return dept; } @VisibleForTesting @@ -163,6 +184,27 @@ public class DeptServiceImpl implements DeptService { } } + @VisibleForTesting + void validateDeptCodeUnique(Long id, String code) { + if (StrUtil.isBlank(code)) { + return; + } + DeptDO dept = deptMapper.selectByCode(code); + if (dept == null) { + return; + } + if (id == null || ObjectUtil.notEqual(dept.getId(), id)) { + throw exception(DEPT_CODE_DUPLICATE, code); + } + } + + @VisibleForTesting + void validateDeptOrgType(String orgType) { + if (!DeptOrgTypeEnum.isValid(orgType)) { + throw exception(DEPT_ORG_TYPE_INVALID, orgType); + } + } + @Override public DeptDO getDept(Long id) { return deptMapper.selectById(id); @@ -179,7 +221,7 @@ public class DeptServiceImpl implements DeptService { @Override public List getDeptList(DeptListReqVO reqVO) { List list = deptMapper.selectList(reqVO); - list.sort(Comparator.comparing(DeptDO::getSort)); + list.sort(Comparator.comparing(DeptDO::getSort).thenComparing(DeptDO::getId)); return list; } @@ -202,11 +244,6 @@ public class DeptServiceImpl implements DeptService { return children; } - @Override - public List getDeptListByLeaderUserId(Long id) { - return deptMapper.selectListByLeaderUserId(id); - } - @Override @Cacheable(cacheNames = RedisKeyConstants.DEPT_CHILDREN_ID_LIST, key = "#id") public Set getChildDeptIdListFromCache(Long id) { @@ -233,4 +270,59 @@ public class DeptServiceImpl implements DeptService { }); } + private void normalizeDeptCreateReq(DeptSaveReqVO reqVO) { + if (reqVO.getParentId() == null) { + reqVO.setParentId(DeptDO.PARENT_ID_ROOT); + } + if (StrUtil.isBlank(reqVO.getOrgType())) { + reqVO.setOrgType(DeptOrgTypeEnum.defaultType()); + } + if (StrUtil.isBlank(reqVO.getCode())) { + reqVO.setCode(null); + } + } + + private void normalizeDeptUpdateReq(DeptSaveReqVO reqVO, DeptDO oldDept) { + if (reqVO.getParentId() == null) { + reqVO.setParentId(DeptDO.PARENT_ID_ROOT); + } + if (StrUtil.isBlank(reqVO.getOrgType())) { + reqVO.setOrgType(StrUtil.blankToDefault(oldDept.getOrgType(), DeptOrgTypeEnum.defaultType())); + } + if (StrUtil.isBlank(reqVO.getCode())) { + reqVO.setCode(oldDept.getCode()); + } + } + + private void fillDeptTreeFields(DeptDO dept, Long parentId) { + String parentPath = "/"; + int parentLevel = 0; + if (!DeptDO.PARENT_ID_ROOT.equals(parentId)) { + DeptDO parentDept = deptMapper.selectById(parentId); + if (parentDept != null) { + parentPath = StrUtil.blankToDefault(parentDept.getPath(), "/" + parentDept.getId() + "/"); + parentLevel = ObjectUtil.defaultIfNull(parentDept.getLevel(), 1); + } + } + dept.setPath(parentPath + dept.getId() + "/"); + dept.setLevel(parentLevel + 1); + } + + private void updateChildDeptTree(Long deptId, String oldPath, Integer oldLevel, String newPath, Integer newLevel) { + if (StrUtil.equals(oldPath, newPath) && Objects.equals(oldLevel, newLevel)) { + return; + } + List children = deptMapper.selectListByPathPrefix(oldPath); + children.removeIf(dept -> Objects.equals(dept.getId(), deptId)); + if (CollUtil.isEmpty(children)) { + return; + } + int levelDiff = ObjectUtil.defaultIfNull(newLevel, 1) - ObjectUtil.defaultIfNull(oldLevel, 1); + children.forEach(child -> { + child.setPath(newPath + StrUtil.removePrefix(child.getPath(), oldPath)); + child.setLevel(ObjectUtil.defaultIfNull(child.getLevel(), 1) + levelDiff); + }); + deptMapper.updateBatch(children); + } + } diff --git a/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dept/OrgLeaderRelationService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dept/OrgLeaderRelationService.java new file mode 100644 index 0000000..7b64db4 --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dept/OrgLeaderRelationService.java @@ -0,0 +1,52 @@ +package com.njcn.msgpush.module.system.service.dept; + +import com.njcn.msgpush.module.system.controller.admin.dept.vo.orgleader.OrgLeaderRelationSaveReqVO; +import com.njcn.msgpush.module.system.dal.dataobject.dept.OrgLeaderRelationDO; +import com.njcn.msgpush.module.system.dal.dataobject.user.AdminUserDO; + +import java.util.List; + +/** + * 组织负责人关系 Service + */ +public interface OrgLeaderRelationService { + + /** + * 创建组织负责人关系 + * + * @param createReqVO 创建请求 + * @return 负责人关系 ID + */ + Long createOrgLeaderRelation(OrgLeaderRelationSaveReqVO createReqVO); + + /** + * 更新组织负责人关系 + * + * @param updateReqVO 更新请求 + */ + void updateOrgLeaderRelation(OrgLeaderRelationSaveReqVO updateReqVO); + + /** + * 删除组织负责人关系 + * + * @param id 关系 ID + */ + void deleteOrgLeaderRelation(Long id); + + /** + * 查询指定组织下的负责人关系列表 + * + * @param deptId 组织 ID + * @return 负责人关系列表 + */ + List getOrgLeaderRelationListByDeptId(Long deptId); + + /** + * 查询组织负责人候选用户 + * + * @param deptId 组织 ID + * @return 候选用户列表 + */ + List getCandidateUsersByDeptId(Long deptId); + +} diff --git a/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dept/OrgLeaderRelationServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dept/OrgLeaderRelationServiceImpl.java new file mode 100644 index 0000000..6a22429 --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dept/OrgLeaderRelationServiceImpl.java @@ -0,0 +1,160 @@ +package com.njcn.msgpush.module.system.service.dept; + +import cn.hutool.core.collection.CollUtil; +import com.google.common.annotations.VisibleForTesting; +import com.njcn.msgpush.framework.common.util.object.BeanUtils; +import com.njcn.msgpush.module.system.controller.admin.dept.vo.orgleader.OrgLeaderRelationSaveReqVO; +import com.njcn.msgpush.module.system.dal.dataobject.dept.DeptDO; +import com.njcn.msgpush.module.system.dal.dataobject.dept.OrgLeaderRelationDO; +import com.njcn.msgpush.module.system.dal.dataobject.user.AdminUserDO; +import com.njcn.msgpush.module.system.dal.mysql.dept.OrgLeaderRelationMapper; +import com.njcn.msgpush.module.system.service.user.AdminUserService; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import java.time.LocalDateTime; +import java.util.Comparator; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.Set; + +import static com.njcn.msgpush.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.*; +import static java.util.Collections.singleton; + +/** + * 组织负责人关系 Service 实现类 + */ +@Service +@Validated +public class OrgLeaderRelationServiceImpl implements OrgLeaderRelationService { + + @Resource + private OrgLeaderRelationMapper orgLeaderRelationMapper; + @Resource + private DeptService deptService; + @Resource + private AdminUserService adminUserService; + + @Override + public Long createOrgLeaderRelation(OrgLeaderRelationSaveReqVO createReqVO) { + validateOrgLeaderRelationForCreateOrUpdate(null, createReqVO); + OrgLeaderRelationDO relation = BeanUtils.toBean(createReqVO, OrgLeaderRelationDO.class); + orgLeaderRelationMapper.insert(relation); + return relation.getId(); + } + + @Override + public void updateOrgLeaderRelation(OrgLeaderRelationSaveReqVO updateReqVO) { + if (updateReqVO.getId() == null) { + throw exception(ORG_LEADER_RELATION_NOT_FOUND); + } + validateOrgLeaderRelationForCreateOrUpdate(updateReqVO.getId(), updateReqVO); + OrgLeaderRelationDO relation = BeanUtils.toBean(updateReqVO, OrgLeaderRelationDO.class); + orgLeaderRelationMapper.updateById(relation); + } + + @Override + public void deleteOrgLeaderRelation(Long id) { + validateOrgLeaderRelationExists(id); + orgLeaderRelationMapper.deleteById(id); + } + + @Override + public List getOrgLeaderRelationListByDeptId(Long deptId) { + validateDeptExists(deptId); + return orgLeaderRelationMapper.selectListByDeptId(deptId); + } + + @Override + public List getCandidateUsersByDeptId(Long deptId) { + validateDeptExists(deptId); + Set deptScope = new HashSet<>(deptService.getChildDeptIdListFromCache(deptId)); + deptScope.add(deptId); + List users = adminUserService.getUserListByDeptIds(deptScope); + users.removeIf(user -> !adminUserService.isUserAvailable(user)); + users.sort(Comparator.comparing(AdminUserDO::getDeptId) + .thenComparing(AdminUserDO::getNickname) + .thenComparing(AdminUserDO::getId)); + return users; + } + + private void validateOrgLeaderRelationForCreateOrUpdate(Long id, OrgLeaderRelationSaveReqVO reqVO) { + validateOrgLeaderRelationExists(id); + deptService.validateDeptList(singleton(reqVO.getDeptId())); + adminUserService.validateUserList(singleton(reqVO.getUserId())); + validateEffectiveRange(reqVO.getEffectiveFrom(), reqVO.getEffectiveUntil()); + validateUserInDeptScope(reqVO.getDeptId(), reqVO.getUserId()); + validateRelationOverlap(id, reqVO.getDeptId(), reqVO.getUserId(), + reqVO.getEffectiveFrom(), reqVO.getEffectiveUntil()); + } + + @VisibleForTesting + void validateEffectiveRange(LocalDateTime effectiveFrom, LocalDateTime effectiveUntil) { + if (effectiveFrom != null && effectiveUntil != null && effectiveFrom.isAfter(effectiveUntil)) { + throw exception(ORG_LEADER_EFFECTIVE_RANGE_INVALID); + } + } + + @VisibleForTesting + void validateUserInDeptScope(Long deptId, Long userId) { + AdminUserDO user = adminUserService.getUser(userId); + if (user == null) { + throw exception(USER_NOT_EXISTS); + } + Set deptScope = new HashSet<>(deptService.getChildDeptIdListFromCache(deptId)); + deptScope.add(deptId); + if (!deptScope.contains(user.getDeptId())) { + throw exception(ORG_LEADER_USER_NOT_IN_DEPT, user.getNickname()); + } + } + + @VisibleForTesting + void validateRelationOverlap(Long id, Long deptId, Long userId, + LocalDateTime effectiveFrom, LocalDateTime effectiveUntil) { + List relations = orgLeaderRelationMapper.selectListByDeptIdAndUserId(deptId, userId); + if (CollUtil.isEmpty(relations)) { + return; + } + for (OrgLeaderRelationDO relation : relations) { + if (Objects.equals(relation.getId(), id)) { + continue; + } + if (isTimeRangeOverlap(effectiveFrom, effectiveUntil, + relation.getEffectiveFrom(), relation.getEffectiveUntil())) { + throw exception(ORG_LEADER_RELATION_OVERLAP); + } + } + } + + private boolean isTimeRangeOverlap(LocalDateTime start1, LocalDateTime end1, + LocalDateTime start2, LocalDateTime end2) { + return !isAfter(start1, end2) && !isAfter(start2, end1); + } + + private boolean isAfter(LocalDateTime start, LocalDateTime end) { + return start != null && end != null && start.isAfter(end); + } + + private OrgLeaderRelationDO validateOrgLeaderRelationExists(Long id) { + if (id == null) { + return null; + } + OrgLeaderRelationDO relation = orgLeaderRelationMapper.selectById(id); + if (relation == null) { + throw exception(ORG_LEADER_RELATION_NOT_FOUND); + } + return relation; + } + + private DeptDO validateDeptExists(Long deptId) { + DeptDO dept = deptService.getDept(deptId); + if (dept == null) { + throw exception(DEPT_NOT_FOUND); + } + return dept; + } + +} diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/dept/PostService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dept/PostService.java similarity index 73% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/dept/PostService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dept/PostService.java index b0a177e..f4a567a 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/dept/PostService.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dept/PostService.java @@ -1,13 +1,17 @@ package com.njcn.msgpush.module.system.service.dept; +import cn.hutool.core.collection.CollUtil; import com.njcn.msgpush.framework.common.pojo.PageResult; +import com.njcn.msgpush.framework.common.util.collection.CollectionUtils; import com.njcn.msgpush.module.system.controller.admin.dept.vo.post.PostPageReqVO; import com.njcn.msgpush.module.system.controller.admin.dept.vo.post.PostSaveReqVO; import com.njcn.msgpush.module.system.dal.dataobject.dept.PostDO; import org.springframework.lang.Nullable; import java.util.Collection; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * 岗位 Service 接口 @@ -49,7 +53,7 @@ public interface PostService { * 获得岗位列表 * * @param ids 岗位编号数组 - * @return 部门列表 + * @return 岗位列表 */ List getPostList(@Nullable Collection ids); @@ -58,16 +62,15 @@ public interface PostService { * * @param ids 岗位编号数组。如果为空,不进行筛选 * @param statuses 状态数组。如果为空,不进行筛选 - * @return 部门列表 + * @return 岗位列表 */ - List getPostList(@Nullable Collection ids, - @Nullable Collection statuses); + List getPostList(@Nullable Collection ids, @Nullable Collection statuses); /** * 获得岗位分页列表 * * @param reqVO 分页条件 - * @return 部门分页列表 + * @return 岗位分页列表 */ PageResult getPostPage(PostPageReqVO reqVO); @@ -79,6 +82,19 @@ public interface PostService { */ PostDO getPost(Long id); + /** + * 获得岗位 Map + * + * @param ids 岗位编号数组 + * @return 岗位 Map + */ + default Map getPostMap(Collection ids) { + if (CollUtil.isEmpty(ids)) { + return new HashMap<>(); + } + return CollectionUtils.convertMap(getPostList(ids), PostDO::getId); + } + /** * 校验岗位们是否有效。如下情况,视为无效: * 1. 岗位编号不存在 diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/dept/PostServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dept/PostServiceImpl.java similarity index 85% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/dept/PostServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dept/PostServiceImpl.java index 542312d..d11400f 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/dept/PostServiceImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dept/PostServiceImpl.java @@ -1,6 +1,7 @@ package com.njcn.msgpush.module.system.service.dept; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; import com.njcn.msgpush.framework.common.pojo.PageResult; import com.njcn.msgpush.framework.common.util.object.BeanUtils; @@ -8,6 +9,8 @@ import com.njcn.msgpush.module.system.controller.admin.dept.vo.post.PostPageReqV import com.njcn.msgpush.module.system.controller.admin.dept.vo.post.PostSaveReqVO; import com.njcn.msgpush.module.system.dal.dataobject.dept.PostDO; import com.njcn.msgpush.module.system.dal.mysql.dept.PostMapper; +import com.njcn.msgpush.module.system.enums.dept.PostTypeEnum; +import com.google.common.annotations.VisibleForTesting; import jakarta.annotation.Resource; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; @@ -36,7 +39,7 @@ public class PostServiceImpl implements PostService { @Override public Long createPost(PostSaveReqVO createReqVO) { // 校验正确性 - validatePostForCreateOrUpdate(null, createReqVO.getName(), createReqVO.getCode()); + validatePostForCreateOrUpdate(null, createReqVO.getName(), createReqVO.getCode(), createReqVO.getPostType()); // 插入岗位 PostDO post = BeanUtils.toBean(createReqVO, PostDO.class); @@ -47,7 +50,7 @@ public class PostServiceImpl implements PostService { @Override public void updatePost(PostSaveReqVO updateReqVO) { // 校验正确性 - validatePostForCreateOrUpdate(updateReqVO.getId(), updateReqVO.getName(), updateReqVO.getCode()); + validatePostForCreateOrUpdate(updateReqVO.getId(), updateReqVO.getName(), updateReqVO.getCode(), updateReqVO.getPostType()); // 更新岗位 PostDO updateObj = BeanUtils.toBean(updateReqVO, PostDO.class); @@ -67,16 +70,19 @@ public class PostServiceImpl implements PostService { postMapper.deleteByIds(ids); } - private void validatePostForCreateOrUpdate(Long id, String name, String code) { + private void validatePostForCreateOrUpdate(Long id, String name, String code, String postType) { // 校验自己存在 validatePostExists(id); // 校验岗位名的唯一性 validatePostNameUnique(id, name); // 校验岗位编码的唯一性 validatePostCodeUnique(id, code); + // 校验岗位类型 + validatePostType(postType); } - private void validatePostNameUnique(Long id, String name) { + @VisibleForTesting + void validatePostNameUnique(Long id, String name) { PostDO post = postMapper.selectByName(name); if (post == null) { return; @@ -90,7 +96,8 @@ public class PostServiceImpl implements PostService { } } - private void validatePostCodeUnique(Long id, String code) { + @VisibleForTesting + void validatePostCodeUnique(Long id, String code) { PostDO post = postMapper.selectByCode(code); if (post == null) { return; @@ -104,6 +111,16 @@ public class PostServiceImpl implements PostService { } } + @VisibleForTesting + void validatePostType(String postType) { + if (StrUtil.isBlank(postType)) { + return; + } + if (!PostTypeEnum.isValid(postType)) { + throw exception(POST_TYPE_INVALID, postType); + } + } + private void validatePostExists(Long id) { if (id == null) { return; diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/dict/DictDataService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dict/DictDataService.java similarity index 99% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/dict/DictDataService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dict/DictDataService.java index 3916066..45e5192 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/dict/DictDataService.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dict/DictDataService.java @@ -12,7 +12,7 @@ import java.util.List; /** * 字典数据 Service 接口 * - * @author ruoyi + * @author hongawen */ public interface DictDataService { diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/dict/DictDataServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dict/DictDataServiceImpl.java similarity index 99% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/dict/DictDataServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dict/DictDataServiceImpl.java index c43ae5d..9f4e420 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/dict/DictDataServiceImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dict/DictDataServiceImpl.java @@ -26,7 +26,7 @@ import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.*; /** * 字典数据 Service 实现类 * - * @author ruoyi + * @author hongawen */ @Service @Slf4j diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/dict/DictTypeService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dict/DictTypeService.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/dict/DictTypeService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dict/DictTypeService.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/dict/DictTypeServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dict/DictTypeServiceImpl.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/dict/DictTypeServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/dict/DictTypeServiceImpl.java diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/file/FileConfigService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/file/FileConfigService.java similarity index 82% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/file/FileConfigService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/file/FileConfigService.java index 7116311..4f4688a 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/file/FileConfigService.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/file/FileConfigService.java @@ -1,10 +1,10 @@ -package com.njcn.msgpush.module.infra.service.file; +package com.njcn.msgpush.module.system.service.file; import com.njcn.msgpush.framework.common.pojo.PageResult; -import com.njcn.msgpush.module.infra.controller.admin.file.vo.config.FileConfigPageReqVO; -import com.njcn.msgpush.module.infra.controller.admin.file.vo.config.FileConfigSaveReqVO; -import com.njcn.msgpush.module.infra.dal.dataobject.file.FileConfigDO; -import com.njcn.msgpush.module.infra.framework.file.core.client.FileClient; +import com.njcn.msgpush.module.system.controller.admin.file.vo.config.FileConfigPageReqVO; +import com.njcn.msgpush.module.system.controller.admin.file.vo.config.FileConfigSaveReqVO; +import com.njcn.msgpush.module.system.dal.dataobject.file.FileConfigDO; +import com.njcn.msgpush.module.system.framework.file.core.client.FileClient; import jakarta.validation.Valid; import java.util.List; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/file/FileConfigServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/file/FileConfigServiceImpl.java similarity index 86% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/file/FileConfigServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/file/FileConfigServiceImpl.java index 1af621b..f6c8e09 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/file/FileConfigServiceImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/file/FileConfigServiceImpl.java @@ -1,21 +1,21 @@ -package com.njcn.msgpush.module.infra.service.file; +package com.njcn.msgpush.module.system.service.file; import cn.hutool.core.io.resource.ResourceUtil; import cn.hutool.core.util.IdUtil; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; import com.njcn.msgpush.framework.common.pojo.PageResult; import com.njcn.msgpush.framework.common.util.json.JsonUtils; import com.njcn.msgpush.framework.common.util.validation.ValidationUtils; -import com.njcn.msgpush.module.infra.controller.admin.file.vo.config.FileConfigPageReqVO; -import com.njcn.msgpush.module.infra.controller.admin.file.vo.config.FileConfigSaveReqVO; -import com.njcn.msgpush.module.infra.convert.file.FileConfigConvert; -import com.njcn.msgpush.module.infra.dal.dataobject.file.FileConfigDO; -import com.njcn.msgpush.module.infra.dal.mysql.file.FileConfigMapper; -import com.njcn.msgpush.module.infra.framework.file.core.client.FileClient; -import com.njcn.msgpush.module.infra.framework.file.core.client.FileClientConfig; -import com.njcn.msgpush.module.infra.framework.file.core.client.FileClientFactory; -import com.njcn.msgpush.module.infra.framework.file.core.enums.FileStorageEnum; -import com.google.common.cache.CacheLoader; -import com.google.common.cache.LoadingCache; +import com.njcn.msgpush.module.system.controller.admin.file.vo.config.FileConfigPageReqVO; +import com.njcn.msgpush.module.system.controller.admin.file.vo.config.FileConfigSaveReqVO; +import com.njcn.msgpush.module.system.convert.file.FileConfigConvert; +import com.njcn.msgpush.module.system.dal.dataobject.file.FileConfigDO; +import com.njcn.msgpush.module.system.dal.mysql.file.FileConfigMapper; +import com.njcn.msgpush.module.system.framework.file.core.client.FileClient; +import com.njcn.msgpush.module.system.framework.file.core.client.FileClientConfig; +import com.njcn.msgpush.module.system.framework.file.core.client.FileClientFactory; +import com.njcn.msgpush.module.system.framework.file.core.enums.FileStorageEnum; import jakarta.annotation.Resource; import jakarta.validation.Validator; import lombok.Getter; @@ -31,8 +31,8 @@ import java.util.Objects; import static com.njcn.msgpush.framework.common.exception.util.ServiceExceptionUtil.exception; import static com.njcn.msgpush.framework.common.util.cache.CacheUtils.buildAsyncReloadingCache; -import static com.njcn.msgpush.module.infra.enums.ErrorCodeConstants.FILE_CONFIG_DELETE_FAIL_MASTER; -import static com.njcn.msgpush.module.infra.enums.ErrorCodeConstants.FILE_CONFIG_NOT_EXISTS; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.FILE_CONFIG_DELETE_FAIL_MASTER; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.FILE_CONFIG_NOT_EXISTS; /** * 文件配置 Service 实现类 diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/file/FileService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/file/FileService.java similarity index 84% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/file/FileService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/file/FileService.java index a5af8b9..c359950 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/file/FileService.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/file/FileService.java @@ -1,10 +1,10 @@ -package com.njcn.msgpush.module.infra.service.file; +package com.njcn.msgpush.module.system.service.file; import com.njcn.msgpush.framework.common.pojo.PageResult; -import com.njcn.msgpush.module.infra.controller.admin.file.vo.file.FileCreateReqVO; -import com.njcn.msgpush.module.infra.controller.admin.file.vo.file.FilePageReqVO; -import com.njcn.msgpush.module.infra.controller.admin.file.vo.file.FilePresignedUrlRespVO; -import com.njcn.msgpush.module.infra.dal.dataobject.file.FileDO; +import com.njcn.msgpush.module.system.controller.admin.file.vo.file.FileCreateReqVO; +import com.njcn.msgpush.module.system.controller.admin.file.vo.file.FilePageReqVO; +import com.njcn.msgpush.module.system.controller.admin.file.vo.file.FilePresignedUrlRespVO; +import com.njcn.msgpush.module.system.dal.dataobject.file.FileDO; import jakarta.validation.constraints.NotEmpty; import java.util.List; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/file/FileServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/file/FileServiceImpl.java similarity index 89% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/file/FileServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/file/FileServiceImpl.java index 5cc31b0..18cf1af 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/file/FileServiceImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/file/FileServiceImpl.java @@ -1,21 +1,21 @@ -package com.njcn.msgpush.module.infra.service.file; +package com.njcn.msgpush.module.system.service.file; import cn.hutool.core.date.LocalDateTimeUtil; import cn.hutool.core.io.FileUtil; import cn.hutool.core.lang.Assert; import cn.hutool.core.util.StrUtil; import cn.hutool.crypto.digest.DigestUtil; +import com.google.common.annotations.VisibleForTesting; import com.njcn.msgpush.framework.common.pojo.PageResult; import com.njcn.msgpush.framework.common.util.http.HttpUtils; import com.njcn.msgpush.framework.common.util.object.BeanUtils; -import com.njcn.msgpush.module.infra.controller.admin.file.vo.file.FileCreateReqVO; -import com.njcn.msgpush.module.infra.controller.admin.file.vo.file.FilePageReqVO; -import com.njcn.msgpush.module.infra.controller.admin.file.vo.file.FilePresignedUrlRespVO; -import com.njcn.msgpush.module.infra.dal.dataobject.file.FileDO; -import com.njcn.msgpush.module.infra.dal.mysql.file.FileMapper; -import com.njcn.msgpush.module.infra.framework.file.core.client.FileClient; -import com.njcn.msgpush.module.infra.framework.file.core.utils.FileTypeUtils; -import com.google.common.annotations.VisibleForTesting; +import com.njcn.msgpush.module.system.controller.admin.file.vo.file.FileCreateReqVO; +import com.njcn.msgpush.module.system.controller.admin.file.vo.file.FilePageReqVO; +import com.njcn.msgpush.module.system.controller.admin.file.vo.file.FilePresignedUrlRespVO; +import com.njcn.msgpush.module.system.dal.dataobject.file.FileDO; +import com.njcn.msgpush.module.system.dal.mysql.file.FileMapper; +import com.njcn.msgpush.module.system.framework.file.core.client.FileClient; +import com.njcn.msgpush.module.system.framework.file.core.utils.FileTypeUtils; import jakarta.annotation.Resource; import lombok.SneakyThrows; import org.springframework.stereotype.Service; @@ -24,7 +24,7 @@ import java.util.List; import static cn.hutool.core.date.DatePattern.PURE_DATE_PATTERN; import static com.njcn.msgpush.framework.common.exception.util.ServiceExceptionUtil.exception; -import static com.njcn.msgpush.module.infra.enums.ErrorCodeConstants.FILE_NOT_EXISTS; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.FILE_NOT_EXISTS; /** * 文件 Service 实现类 @@ -88,7 +88,7 @@ public class FileServiceImpl implements FileService { // 3. 保存到数据库 fileMapper.insert(new FileDO().setConfigId(client.getId()) .setName(name).setPath(path).setUrl(url) - .setType(type).setSize(content.length)); + .setType(type).setSize((long) content.length)); return url; } diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/logger/ApiAccessLogService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/ApiAccessLogService.java similarity index 74% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/logger/ApiAccessLogService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/ApiAccessLogService.java index c48520c..ed726af 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/logger/ApiAccessLogService.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/ApiAccessLogService.java @@ -1,9 +1,9 @@ -package com.njcn.msgpush.module.infra.service.logger; +package com.njcn.msgpush.module.system.service.logger; -import com.njcn.msgpush.framework.common.biz.infra.logger.dto.ApiAccessLogCreateReqDTO; +import com.njcn.msgpush.framework.common.biz.system.logger.dto.ApiAccessLogCreateReqDTO; import com.njcn.msgpush.framework.common.pojo.PageResult; -import com.njcn.msgpush.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogPageReqVO; -import com.njcn.msgpush.module.infra.dal.dataobject.logger.ApiAccessLogDO; +import com.njcn.msgpush.module.system.controller.admin.logger.vo.apiaccesslog.ApiAccessLogPageReqVO; +import com.njcn.msgpush.module.system.dal.dataobject.logger.ApiAccessLogDO; /** * API 访问日志 Service 接口 diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/logger/ApiAccessLogServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/ApiAccessLogServiceImpl.java similarity index 76% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/logger/ApiAccessLogServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/ApiAccessLogServiceImpl.java index 21bfeb4..22f22a6 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/logger/ApiAccessLogServiceImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/ApiAccessLogServiceImpl.java @@ -1,12 +1,12 @@ -package com.njcn.msgpush.module.infra.service.logger; +package com.njcn.msgpush.module.system.service.logger; -import com.njcn.msgpush.framework.common.biz.infra.logger.dto.ApiAccessLogCreateReqDTO; +import com.njcn.msgpush.framework.common.biz.system.logger.dto.ApiAccessLogCreateReqDTO; import com.njcn.msgpush.framework.common.pojo.PageResult; import com.njcn.msgpush.framework.common.util.object.BeanUtils; import com.njcn.msgpush.framework.common.util.string.StrUtils; -import com.njcn.msgpush.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogPageReqVO; -import com.njcn.msgpush.module.infra.dal.dataobject.logger.ApiAccessLogDO; -import com.njcn.msgpush.module.infra.dal.mysql.logger.ApiAccessLogMapper; +import com.njcn.msgpush.module.system.controller.admin.logger.vo.apiaccesslog.ApiAccessLogPageReqVO; +import com.njcn.msgpush.module.system.dal.dataobject.logger.ApiAccessLogDO; +import com.njcn.msgpush.module.system.dal.mysql.logger.ApiAccessLogMapper; import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -14,8 +14,8 @@ import org.springframework.validation.annotation.Validated; import java.time.LocalDateTime; -import static com.njcn.msgpush.module.infra.dal.dataobject.logger.ApiAccessLogDO.REQUEST_PARAMS_MAX_LENGTH; -import static com.njcn.msgpush.module.infra.dal.dataobject.logger.ApiAccessLogDO.RESULT_MSG_MAX_LENGTH; +import static com.njcn.msgpush.module.system.dal.dataobject.logger.ApiAccessLogDO.REQUEST_PARAMS_MAX_LENGTH; +import static com.njcn.msgpush.module.system.dal.dataobject.logger.ApiAccessLogDO.RESULT_MSG_MAX_LENGTH; /** * API 访问日志 Service 实现类 @@ -36,6 +36,7 @@ public class ApiAccessLogServiceImpl implements ApiAccessLogService { apiAccessLog.setRequestParams(StrUtils.maxLength(apiAccessLog.getRequestParams(), REQUEST_PARAMS_MAX_LENGTH)); apiAccessLog.setResultMsg(StrUtils.maxLength(apiAccessLog.getResultMsg(), RESULT_MSG_MAX_LENGTH)); apiAccessLogMapper.insert(apiAccessLog); + } @Override diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/logger/ApiErrorLogService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/ApiErrorLogService.java similarity index 79% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/logger/ApiErrorLogService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/ApiErrorLogService.java index 2cbd19b..ac551c0 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/logger/ApiErrorLogService.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/ApiErrorLogService.java @@ -1,9 +1,9 @@ -package com.njcn.msgpush.module.infra.service.logger; +package com.njcn.msgpush.module.system.service.logger; -import com.njcn.msgpush.framework.common.biz.infra.logger.dto.ApiErrorLogCreateReqDTO; +import com.njcn.msgpush.framework.common.biz.system.logger.dto.ApiErrorLogCreateReqDTO; import com.njcn.msgpush.framework.common.pojo.PageResult; -import com.njcn.msgpush.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogPageReqVO; -import com.njcn.msgpush.module.infra.dal.dataobject.logger.ApiErrorLogDO; +import com.njcn.msgpush.module.system.controller.admin.logger.vo.apierrorlog.ApiErrorLogPageReqVO; +import com.njcn.msgpush.module.system.dal.dataobject.logger.ApiErrorLogDO; /** * API 错误日志 Service 接口 diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/logger/ApiErrorLogServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/ApiErrorLogServiceImpl.java similarity index 76% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/logger/ApiErrorLogServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/ApiErrorLogServiceImpl.java index 8b4f54d..15a3ca7 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/service/logger/ApiErrorLogServiceImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/ApiErrorLogServiceImpl.java @@ -1,13 +1,13 @@ -package com.njcn.msgpush.module.infra.service.logger; +package com.njcn.msgpush.module.system.service.logger; -import com.njcn.msgpush.framework.common.biz.infra.logger.dto.ApiErrorLogCreateReqDTO; +import com.njcn.msgpush.framework.common.biz.system.logger.dto.ApiErrorLogCreateReqDTO; import com.njcn.msgpush.framework.common.pojo.PageResult; import com.njcn.msgpush.framework.common.util.object.BeanUtils; import com.njcn.msgpush.framework.common.util.string.StrUtils; -import com.njcn.msgpush.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogPageReqVO; -import com.njcn.msgpush.module.infra.dal.dataobject.logger.ApiErrorLogDO; -import com.njcn.msgpush.module.infra.dal.mysql.logger.ApiErrorLogMapper; -import com.njcn.msgpush.module.infra.enums.logger.ApiErrorLogProcessStatusEnum; +import com.njcn.msgpush.module.system.controller.admin.logger.vo.apierrorlog.ApiErrorLogPageReqVO; +import com.njcn.msgpush.module.system.dal.dataobject.logger.ApiErrorLogDO; +import com.njcn.msgpush.module.system.dal.mysql.logger.ApiErrorLogMapper; +import com.njcn.msgpush.module.system.enums.logger.ApiErrorLogProcessStatusEnum; import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -16,9 +16,9 @@ import org.springframework.validation.annotation.Validated; import java.time.LocalDateTime; import static com.njcn.msgpush.framework.common.exception.util.ServiceExceptionUtil.exception; -import static com.njcn.msgpush.module.infra.dal.dataobject.logger.ApiErrorLogDO.REQUEST_PARAMS_MAX_LENGTH; -import static com.njcn.msgpush.module.infra.enums.ErrorCodeConstants.API_ERROR_LOG_NOT_FOUND; -import static com.njcn.msgpush.module.infra.enums.ErrorCodeConstants.API_ERROR_LOG_PROCESSED; +import static com.njcn.msgpush.module.system.dal.dataobject.logger.ApiErrorLogDO.REQUEST_PARAMS_MAX_LENGTH; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.API_ERROR_LOG_NOT_FOUND; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.API_ERROR_LOG_PROCESSED; /** * API 错误日志 Service 实现类 @@ -41,7 +41,6 @@ public class ApiErrorLogServiceImpl implements ApiErrorLogService { try { apiErrorLogMapper.insert(apiErrorLog); } catch (Exception ex) { - // 兜底处理,目前只有 msgpush-cloud 会发生:https://gitee.com/msgpushcode/msgpush-cloud-mini/issues/IC1O0A log.error("[createApiErrorLog][记录时({}) 发生异常]", createDTO, ex); } } diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/logger/LoginLogService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/LoginLogService.java similarity index 91% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/logger/LoginLogService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/LoginLogService.java index 6c4c6b4..d8738e3 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/logger/LoginLogService.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/LoginLogService.java @@ -1,7 +1,7 @@ package com.njcn.msgpush.module.system.service.logger; import com.njcn.msgpush.framework.common.pojo.PageResult; -import com.njcn.msgpush.module.system.api.logger.dto.LoginLogCreateReqDTO; +import com.njcn.msgpush.module.system.service.logger.dto.LoginLogCreateReqDTO; import com.njcn.msgpush.module.system.controller.admin.logger.vo.loginlog.LoginLogPageReqVO; import com.njcn.msgpush.module.system.dal.dataobject.logger.LoginLogDO; diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/logger/LoginLogServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/LoginLogServiceImpl.java similarity index 93% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/logger/LoginLogServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/LoginLogServiceImpl.java index bc8596d..479dfcf 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/logger/LoginLogServiceImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/LoginLogServiceImpl.java @@ -2,7 +2,7 @@ package com.njcn.msgpush.module.system.service.logger; import com.njcn.msgpush.framework.common.pojo.PageResult; import com.njcn.msgpush.framework.common.util.object.BeanUtils; -import com.njcn.msgpush.module.system.api.logger.dto.LoginLogCreateReqDTO; +import com.njcn.msgpush.module.system.service.logger.dto.LoginLogCreateReqDTO; import com.njcn.msgpush.module.system.controller.admin.logger.vo.loginlog.LoginLogPageReqVO; import com.njcn.msgpush.module.system.dal.dataobject.logger.LoginLogDO; import com.njcn.msgpush.module.system.dal.mysql.logger.LoginLogMapper; diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/logger/OperateLogService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/OperateLogService.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/logger/OperateLogService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/OperateLogService.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/logger/OperateLogServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/OperateLogServiceImpl.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/logger/OperateLogServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/OperateLogServiceImpl.java diff --git a/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/api/logger/dto/LoginLogCreateReqDTO.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/dto/LoginLogCreateReqDTO.java similarity index 85% rename from msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/api/logger/dto/LoginLogCreateReqDTO.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/dto/LoginLogCreateReqDTO.java index 4d51746..c5a6b30 100644 --- a/msgpush-module-system/msgpush-module-system-api/src/main/java/com/njcn/msgpush/module/system/api/logger/dto/LoginLogCreateReqDTO.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/logger/dto/LoginLogCreateReqDTO.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.system.api.logger.dto; +package com.njcn.msgpush.module.system.service.logger.dto; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotEmpty; @@ -6,11 +6,11 @@ import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; import lombok.Data; -@Schema(description = "RPC 服务 - 登录日志创建 Request DTO") +@Schema(description = "登录日志创建 Request DTO") @Data public class LoginLogCreateReqDTO { - @Schema(description = "日志类型,参见 LoginLogTypeEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1" ) + @Schema(description = "日志类型,参见 LoginLogTypeEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotNull(message = "日志类型不能为空") private Integer logType; @@ -19,12 +19,14 @@ public class LoginLogCreateReqDTO { @Schema(description = "用户编号", example = "666") private Long userId; - @Schema(description = "用户类型,参见 UserTypeEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "2" ) + + @Schema(description = "用户类型,参见 UserTypeEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") @NotNull(message = "用户类型不能为空") private Integer userType; + @Schema(description = "用户账号", example = "msgpush") @Size(max = 30, message = "用户账号长度不能超过30个字符") - private String username; // 不再强制校验 username 非空,因为 Member 社交登录时,此时暂时没有 username(mobile)! + private String username; @Schema(description = "登录结果,参见 LoginResultEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotNull(message = "登录结果不能为空") diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/member/MemberService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/member/MemberService.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/member/MemberService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/member/MemberService.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/member/MemberServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/member/MemberServiceImpl.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/member/MemberServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/member/MemberServiceImpl.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/member/package-info.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/member/package-info.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/member/package-info.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/member/package-info.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/notice/NoticeService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/notice/NoticeService.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/notice/NoticeService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/notice/NoticeService.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/notice/NoticeServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/notice/NoticeServiceImpl.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/notice/NoticeServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/notice/NoticeServiceImpl.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyMessageService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyMessageService.java similarity index 99% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyMessageService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyMessageService.java index 0c1a910..644bcdc 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyMessageService.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyMessageService.java @@ -13,7 +13,7 @@ import java.util.Map; /** * 站内信 Service 接口 * - * @author xrcoder + * @author hongawen */ public interface NotifyMessageService { diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyMessageServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyMessageServiceImpl.java similarity index 99% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyMessageServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyMessageServiceImpl.java index d2435a7..cf74f3c 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyMessageServiceImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyMessageServiceImpl.java @@ -17,7 +17,7 @@ import java.util.Map; /** * 站内信 Service 实现类 * - * @author xrcoder + * @author hongawen */ @Service @Validated diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifySendService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifySendService.java similarity index 93% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifySendService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifySendService.java index 3afff84..5597a13 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifySendService.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifySendService.java @@ -6,7 +6,7 @@ import java.util.Map; /** * 站内信发送 Service 接口 * - * @author xrcoder + * @author hongawen */ public interface NotifySendService { @@ -16,8 +16,8 @@ public interface NotifySendService { * 在 mobile 为空时,使用 userId 加载对应管理员的手机号 * * @param userId 用户编号 - * @param templateCode 短信模板编号 - * @param templateParams 短信模板参数 + * @param templateCode 站内信模板编号 + * @param templateParams 站内信模板参数 * @return 发送日志编号 */ Long sendSingleNotifyToAdmin(Long userId, diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifySendServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifySendServiceImpl.java similarity index 99% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifySendServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifySendServiceImpl.java index 9bb61de..04dd0d9 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifySendServiceImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifySendServiceImpl.java @@ -19,7 +19,7 @@ import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.NOTIFY_SEN /** * 站内信发送 Service 实现类 * - * @author xrcoder + * @author hongawen */ @Service @Validated diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyTemplateService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyTemplateService.java similarity index 99% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyTemplateService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyTemplateService.java index 187821a..51d96c2 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyTemplateService.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyTemplateService.java @@ -12,7 +12,7 @@ import java.util.Map; /** * 站内信模版 Service 接口 * - * @author xrcoder + * @author hongawen */ public interface NotifyTemplateService { diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyTemplateServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyTemplateServiceImpl.java similarity index 99% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyTemplateServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyTemplateServiceImpl.java index a2a82f7..85b6da9 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyTemplateServiceImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/notify/NotifyTemplateServiceImpl.java @@ -28,7 +28,7 @@ import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.NOTIFY_TEM /** * 站内信模版 Service 实现类 * - * @author xrcoder + * @author hongawen */ @Service @Validated diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2ApproveService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2ApproveService.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2ApproveService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2ApproveService.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2ApproveServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2ApproveServiceImpl.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2ApproveServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2ApproveServiceImpl.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2ClientService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2ClientService.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2ClientService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2ClientService.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2ClientServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2ClientServiceImpl.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2ClientServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2ClientServiceImpl.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2CodeService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2CodeService.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2CodeService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2CodeService.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2CodeServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2CodeServiceImpl.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2CodeServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2CodeServiceImpl.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2GrantService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2GrantService.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2GrantService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2GrantService.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2GrantServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2GrantServiceImpl.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2GrantServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2GrantServiceImpl.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2TokenService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2TokenService.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2TokenService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2TokenService.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2TokenServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2TokenServiceImpl.java similarity index 95% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2TokenServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2TokenServiceImpl.java index cd5635e..654a730 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2TokenServiceImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/oauth2/OAuth2TokenServiceImpl.java @@ -6,11 +6,14 @@ import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.njcn.msgpush.framework.common.enums.UserTypeEnum; +import com.njcn.msgpush.framework.common.exception.ServiceException; import com.njcn.msgpush.framework.common.exception.enums.GlobalErrorCodeConstants; import com.njcn.msgpush.framework.common.pojo.PageResult; import com.njcn.msgpush.framework.common.util.date.DateUtils; import com.njcn.msgpush.framework.common.util.object.BeanUtils; import com.njcn.msgpush.framework.security.core.LoginUser; + + import com.njcn.msgpush.module.system.controller.admin.oauth2.vo.token.OAuth2AccessTokenPageReqVO; import com.njcn.msgpush.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO; import com.njcn.msgpush.module.system.dal.dataobject.oauth2.OAuth2ClientDO; @@ -19,6 +22,7 @@ import com.njcn.msgpush.module.system.dal.dataobject.user.AdminUserDO; import com.njcn.msgpush.module.system.dal.mysql.oauth2.OAuth2AccessTokenMapper; import com.njcn.msgpush.module.system.dal.mysql.oauth2.OAuth2RefreshTokenMapper; import com.njcn.msgpush.module.system.dal.redis.oauth2.OAuth2AccessTokenRedisDAO; +import com.njcn.msgpush.module.system.enums.ErrorCodeConstants; import com.njcn.msgpush.module.system.service.user.AdminUserService; import jakarta.annotation.Resource; import org.springframework.context.annotation.Lazy; @@ -30,6 +34,7 @@ import java.util.Collections; import java.util.List; import java.util.Map; +import static com.njcn.msgpush.framework.common.exception.util.ServiceExceptionUtil.exception; import static com.njcn.msgpush.framework.common.exception.util.ServiceExceptionUtil.exception0; import static com.njcn.msgpush.framework.common.util.collection.CollectionUtils.convertSet; @@ -66,7 +71,7 @@ public class OAuth2TokenServiceImpl implements OAuth2TokenService { } @Override - @Transactional(rollbackFor = Exception.class) + @Transactional(noRollbackFor = ServiceException.class) public OAuth2AccessTokenDO refreshAccessToken(String refreshToken, String clientId) { // 查询访问令牌 OAuth2RefreshTokenDO refreshTokenDO = oauth2RefreshTokenMapper.selectByRefreshToken(refreshToken); @@ -90,7 +95,7 @@ public class OAuth2TokenServiceImpl implements OAuth2TokenService { // 已过期的情况下,删除刷新令牌 if (DateUtils.isExpired(refreshTokenDO.getExpiresTime())) { oauth2RefreshTokenMapper.deleteById(refreshTokenDO.getId()); - throw exception0(GlobalErrorCodeConstants.UNAUTHORIZED.getCode(), "刷新令牌已过期"); + throw exception(ErrorCodeConstants.OAUTH2_REFRESH_TOKEN_EXPIRE); } // 创建访问令牌 @@ -131,7 +136,7 @@ public class OAuth2TokenServiceImpl implements OAuth2TokenService { throw exception0(GlobalErrorCodeConstants.UNAUTHORIZED.getCode(), "访问令牌不存在"); } if (DateUtils.isExpired(accessTokenDO.getExpiresTime())) { - throw exception0(GlobalErrorCodeConstants.UNAUTHORIZED.getCode(), "访问令牌已过期"); + throw exception(ErrorCodeConstants.OAUTH2_ACCESS_TOKEN_EXPIRE); } return accessTokenDO; } @@ -201,7 +206,7 @@ public class OAuth2TokenServiceImpl implements OAuth2TokenService { } /** - * 加载用户信息,方便 {@link com.njcn.msgpush.framework.security.core.LoginUser} 获取到昵称、部门等信息 + * 加载用户信息,方便 {@link LoginUser} 获取到昵称、部门等信息 * * @param userId 用户编号 * @param userType 用户类型 diff --git a/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/permission/MenuService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/permission/MenuService.java new file mode 100644 index 0000000..bd63715 --- /dev/null +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/permission/MenuService.java @@ -0,0 +1,41 @@ +package com.njcn.msgpush.module.system.service.permission; + +import com.njcn.msgpush.module.system.controller.admin.permission.vo.menu.MenuListReqVO; +import com.njcn.msgpush.module.system.controller.admin.permission.vo.menu.MenuSaveVO; +import com.njcn.msgpush.module.system.dal.dataobject.permission.MenuDO; + +import java.util.Collection; +import java.util.List; + +public interface MenuService { + + Long createMenu(MenuSaveVO createReqVO); + + void updateMenu(MenuSaveVO updateReqVO); + + void deleteMenu(Long id); + + void deleteMenuList(List ids); + + List getMenuList(); + + List filterDisableMenus(List list); + + List getMenuList(MenuListReqVO reqVO); + + List getMenuIdListByPermissionFromCache(String permission); + + MenuDO getMenu(Long id); + + List getMenuList(Collection ids); + + /** + * 校验菜单们是否有效。如下情况,视为无效: + * 1. 菜单编号不存在 + * 2. 菜单被禁用 + * + * @param ids 菜单编号数组 + */ + void validateMenuList(Collection ids); + +} diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/permission/MenuServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/permission/MenuServiceImpl.java similarity index 79% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/permission/MenuServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/permission/MenuServiceImpl.java index 30d6d78..dd648a4 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/permission/MenuServiceImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/permission/MenuServiceImpl.java @@ -3,21 +3,24 @@ package com.njcn.msgpush.module.system.service.permission; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjUtil; import cn.hutool.core.util.StrUtil; +import com.fasterxml.jackson.core.type.TypeReference; import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; +import com.njcn.msgpush.framework.common.util.json.JsonUtils; import com.njcn.msgpush.framework.common.util.object.BeanUtils; import com.njcn.msgpush.module.system.controller.admin.permission.vo.menu.MenuListReqVO; import com.njcn.msgpush.module.system.controller.admin.permission.vo.menu.MenuSaveVO; import com.njcn.msgpush.module.system.dal.dataobject.permission.MenuDO; import com.njcn.msgpush.module.system.dal.mysql.permission.MenuMapper; import com.njcn.msgpush.module.system.dal.redis.RedisKeyConstants; +import com.njcn.msgpush.module.system.enums.permission.MenuRouteKindEnum; import com.njcn.msgpush.module.system.enums.permission.MenuTypeEnum; + import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Lists; import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.Cacheable; -import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -43,6 +46,7 @@ public class MenuServiceImpl implements MenuService { @Resource private PermissionService permissionService; + @Override @CacheEvict(value = RedisKeyConstants.PERMISSION_MENU_ID_LIST, key = "#createReqVO.permission", condition = "#createReqVO.permission != null") @@ -52,6 +56,7 @@ public class MenuServiceImpl implements MenuService { // 校验菜单(自己) validateMenuName(createReqVO.getParentId(), createReqVO.getName(), null); validateMenuComponentName(createReqVO.getComponentName(), null); + validateMenuRoute(createReqVO); // 插入数据库 MenuDO menu = BeanUtils.toBean(createReqVO, MenuDO.class); @@ -74,6 +79,7 @@ public class MenuServiceImpl implements MenuService { // 校验菜单(自己) validateMenuName(updateReqVO.getParentId(), updateReqVO.getName(), updateReqVO.getId()); validateMenuComponentName(updateReqVO.getComponentName(), updateReqVO.getId()); + validateMenuRoute(updateReqVO); // 更新到数据库 MenuDO updateObj = BeanUtils.toBean(updateReqVO, MenuDO.class); @@ -107,6 +113,9 @@ public class MenuServiceImpl implements MenuService { public void deleteMenuList(List ids) { // 校验是否还有子菜单 ids.forEach(id -> { + if (menuMapper.selectById(id) == null) { + throw exception(MENU_NOT_EXISTS); + } if (menuMapper.selectCountByParentId(id) > 0) { throw exception(MENU_EXISTS_CHILDREN); } @@ -195,6 +204,24 @@ public class MenuServiceImpl implements MenuService { return menuMapper.selectByIds(ids); } + @Override + public void validateMenuList(Collection ids) { + if (CollUtil.isEmpty(ids)) { + return; + } + List menus = menuMapper.selectByIds(ids); + Map menuMap = convertMap(menus, MenuDO::getId); + ids.forEach(id -> { + MenuDO menu = menuMap.get(id); + if (menu == null) { + throw exception(MENU_NOT_EXISTS); + } + if (CommonStatusEnum.isDisable(menu.getStatus())) { + throw exception(MENU_NOT_ENABLE, menu.getName()); + } + }); + } + /** * 校验父菜单是否合法 *

@@ -274,6 +301,43 @@ public class MenuServiceImpl implements MenuService { } } + @VisibleForTesting + void validateMenuRoute(MenuSaveVO reqVO) { + if (reqVO == null || MenuTypeEnum.BUTTON.getType().equals(reqVO.getType())) { + return; + } + + MenuRouteKindEnum routeKind = MenuRouteKindEnum.valueOfKind(reqVO.getRouteKind()); + if (StrUtil.isNotBlank(reqVO.getRouteKind()) && routeKind == null) { + throw exception(MENU_ROUTE_KIND_INVALID); + } + + String routePropsJson = StrUtil.trim(reqVO.getRoutePropsJson()); + if (StrUtil.isBlank(routePropsJson)) { + if (MenuRouteKindEnum.IFRAME.equals(routeKind)) { + throw exception(MENU_ROUTE_IFRAME_URL_REQUIRED); + } + return; + } + + Object routeProps = JsonUtils.parseObjectQuietly(routePropsJson, new TypeReference() { + }); + if (routeProps == null) { + throw exception(MENU_ROUTE_PROPS_JSON_INVALID); + } + if (!MenuRouteKindEnum.IFRAME.equals(routeKind)) { + return; + } + + if (!(routeProps instanceof Map routePropsMap)) { + throw exception(MENU_ROUTE_PROPS_JSON_INVALID); + } + Object url = routePropsMap.get("url"); + if (!(url instanceof String urlString) || StrUtil.isBlank(urlString)) { + throw exception(MENU_ROUTE_IFRAME_URL_REQUIRED); + } + } + /** * 初始化菜单的通用属性。 *

@@ -282,13 +346,22 @@ public class MenuServiceImpl implements MenuService { * @param menu 菜单 */ private void initMenuProperty(MenuDO menu) { + menu.setRouteKind(normalizeRouteKind(menu.getRouteKind())); + menu.setRoutePropsJson(StrUtil.blankToDefault(StrUtil.trim(menu.getRoutePropsJson()), null)); // 菜单为按钮类型时,无需 component、icon、path 属性,进行置空 if (MenuTypeEnum.BUTTON.getType().equals(menu.getType())) { menu.setComponent(""); menu.setComponentName(""); menu.setIcon(""); menu.setPath(""); + menu.setRouteKind(null); + menu.setRoutePropsJson(null); } } + private String normalizeRouteKind(String routeKind) { + MenuRouteKindEnum routeKindEnum = MenuRouteKindEnum.valueOfKind(routeKind); + return routeKindEnum != null ? routeKindEnum.getKind() : null; + } + } diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/permission/PermissionService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/permission/PermissionService.java similarity index 80% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/permission/PermissionService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/permission/PermissionService.java index fb8badc..b4ab30b 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/permission/PermissionService.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/permission/PermissionService.java @@ -1,7 +1,5 @@ package com.njcn.msgpush.module.system.service.permission; -import com.njcn.msgpush.framework.common.biz.system.permission.dto.DeptDataPermissionRespDTO; - import java.util.Collection; import java.util.Set; @@ -10,7 +8,7 @@ import static java.util.Collections.singleton; /** * 权限 Service 接口 *

- * 提供用户-角色、角色-菜单、角色-部门的关联权限处理 + * 提供用户-角色、角色-菜单的关联权限处理 * * @author hongawen */ @@ -124,23 +122,4 @@ public interface PermissionService { */ Set getUserRoleIdListByUserIdFromCache(Long userId); - // ========== 用户-部门的相关方法 ========== - - /** - * 设置角色的数据权限 - * - * @param roleId 角色编号 - * @param dataScope 数据范围 - * @param dataScopeDeptIds 部门编号数组 - */ - void assignRoleDataScope(Long roleId, Integer dataScope, Set dataScopeDeptIds); - - /** - * 获得登陆用户的部门数据权限 - * - * @param userId 用户编号 - * @return 部门数据权限 - */ - DeptDataPermissionRespDTO getDeptDataPermission(Long userId); - } diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/permission/PermissionServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/permission/PermissionServiceImpl.java similarity index 73% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/permission/PermissionServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/permission/PermissionServiceImpl.java index 1c1cce8..e7394ad 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/permission/PermissionServiceImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/permission/PermissionServiceImpl.java @@ -6,7 +6,6 @@ import cn.hutool.core.util.ArrayUtil; import cn.hutool.extra.spring.SpringUtil; import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; import com.njcn.msgpush.framework.common.util.collection.CollectionUtils; -import com.njcn.msgpush.framework.common.biz.system.permission.dto.DeptDataPermissionRespDTO; import com.njcn.msgpush.module.system.dal.dataobject.permission.MenuDO; import com.njcn.msgpush.module.system.dal.dataobject.permission.RoleDO; import com.njcn.msgpush.module.system.dal.dataobject.permission.RoleMenuDO; @@ -14,12 +13,9 @@ import com.njcn.msgpush.module.system.dal.dataobject.permission.UserRoleDO; import com.njcn.msgpush.module.system.dal.mysql.permission.RoleMenuMapper; import com.njcn.msgpush.module.system.dal.mysql.permission.UserRoleMapper; import com.njcn.msgpush.module.system.dal.redis.RedisKeyConstants; -import com.njcn.msgpush.module.system.enums.permission.DataScopeEnum; -import com.njcn.msgpush.module.system.service.dept.DeptService; import com.njcn.msgpush.module.system.service.user.AdminUserService; import com.baomidou.dynamic.datasource.annotation.DSTransactional; import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Suppliers; import com.google.common.collect.Sets; import lombok.extern.slf4j.Slf4j; import org.springframework.cache.annotation.CacheEvict; @@ -30,10 +26,8 @@ import org.springframework.transaction.annotation.Transactional; import jakarta.annotation.Resource; import java.util.*; -import java.util.function.Supplier; import static com.njcn.msgpush.framework.common.util.collection.CollectionUtils.convertSet; -import static com.njcn.msgpush.framework.common.util.json.JsonUtils.toJsonString; /** * 权限 Service 实现类 @@ -54,8 +48,6 @@ public class PermissionServiceImpl implements PermissionService { @Resource private MenuService menuService; @Resource - private DeptService deptService; - @Resource private AdminUserService userService; @Override @@ -95,10 +87,14 @@ public class PermissionServiceImpl implements PermissionService { if (CollUtil.isEmpty(menuIds)) { return false; } + List menus = getEnablePermissionMenus(menuIds); + if (CollUtil.isEmpty(menus)) { + return false; + } // 判断是否有权限 Set roleIds = convertSet(roles, RoleDO::getId); - for (Long menuId : menuIds) { + for (Long menuId : convertSet(menus, MenuDO::getId)) { // 获得拥有该菜单的角色编号集合 Set menuRoleIds = getSelf().getMenuRoleIdListByMenuIdFromCache(menuId); // 如果有交集,说明有权限 @@ -109,6 +105,46 @@ public class PermissionServiceImpl implements PermissionService { return false; } + /** + * 加载权限菜单自身及其父链后,再统一过滤禁用节点,避免仅查询按钮节点时误判父菜单缺失。 + */ + private List getEnablePermissionMenus(Collection menuIds) { + Set targetMenuIds = new HashSet<>(menuIds); + Map menuMap = new LinkedHashMap<>(); + Set currentIds = new HashSet<>(menuIds); + while (CollUtil.isNotEmpty(currentIds)) { + List currentMenus = menuService.getMenuList(currentIds); + if (CollUtil.isEmpty(currentMenus)) { + break; + } + currentMenus.forEach(menu -> menuMap.put(menu.getId(), menu)); + Set parentIds = convertSet(currentMenus, MenuDO::getParentId); + parentIds.remove(MenuDO.ID_ROOT); + parentIds.removeIf(menuMap::containsKey); + currentIds = parentIds; + } + List enabledMenus = menuService.filterDisableMenus(new ArrayList<>(menuMap.values())); + enabledMenus.removeIf(menu -> !targetMenuIds.contains(menu.getId())); + return enabledMenus; + } + + /** + * 为已选菜单补齐父链,避免只授权子菜单或按钮时,权限树缺少上级节点。 + */ + private Set expandMenuIdsWithAncestors(Collection menuIds) { + Set results = new LinkedHashSet<>(menuIds); + menuIds.forEach(menuId -> { + MenuDO menu = menuService.getMenu(menuId); + while (menu != null && !MenuDO.ID_ROOT.equals(menu.getParentId())) { + if (!results.add(menu.getParentId())) { + break; + } + menu = menuService.getMenu(menu.getParentId()); + } + }); + return results; + } + @Override public boolean hasAnyRoles(Long userId, String... roles) { // 如果为空,说明已经有权限 @@ -138,10 +174,12 @@ public class PermissionServiceImpl implements PermissionService { allEntries = true) // allEntries 清空所有缓存,主要一次更新涉及到的 menuIds 较多,反倒批量会更快 }) public void assignRoleMenu(Long roleId, Set menuIds) { + roleService.validateRoleList(Collections.singleton(roleId)); + menuService.validateMenuList(menuIds); // 获得角色拥有菜单编号 Set dbMenuIds = convertSet(roleMenuMapper.selectListByRoleId(roleId), RoleMenuDO::getMenuId); // 计算新增和删除的菜单编号 - Set menuIdList = CollUtil.emptyIfNull(menuIds); + Set menuIdList = expandMenuIdsWithAncestors(CollUtil.emptyIfNull(menuIds)); Collection createMenuIds = CollUtil.subtract(menuIdList, dbMenuIds); Collection deleteMenuIds = CollUtil.subtract(dbMenuIds, menuIdList); // 执行新增和删除。对于已经授权的菜单,不用做任何处理 @@ -187,10 +225,12 @@ public class PermissionServiceImpl implements PermissionService { // 如果是管理员的情况下,获取全部菜单编号 if (roleService.hasAnySuperAdmin(roleIds)) { - return convertSet(menuService.getMenuList(), MenuDO::getId); + return convertSet(menuService.filterDisableMenus(menuService.getMenuList()), MenuDO::getId); } - // 如果是非管理员的情况下,获得拥有的菜单编号 - return convertSet(roleMenuMapper.selectListByRoleId(roleIds), RoleMenuDO::getMenuId); + // 如果是非管理员的情况下,仅返回当前仍然有效的菜单,并补齐其父链 + Set menuIds = convertSet(roleMenuMapper.selectListByRoleId(roleIds), RoleMenuDO::getMenuId); + List menus = menuService.filterDisableMenus(menuService.getMenuList(menuIds)); + return expandMenuIdsWithAncestors(convertSet(menus, MenuDO::getId)); } @Override @@ -205,6 +245,8 @@ public class PermissionServiceImpl implements PermissionService { @DSTransactional // 多数据源,使用 @DSTransactional 保证本地事务,以及数据源的切换 @CacheEvict(value = RedisKeyConstants.USER_ROLE_ID_LIST, key = "#userId") public void assignUserRole(Long userId, Set roleIds) { + userService.validateUserList(Collections.singleton(userId)); + roleService.validateRoleList(roleIds); // 获得角色拥有角色编号 Set dbRoleIds = convertSet(userRoleMapper.selectListByUserId(userId), UserRoleDO::getRoleId); @@ -234,13 +276,16 @@ public class PermissionServiceImpl implements PermissionService { @Override public Set getUserRoleIdListByUserId(Long userId) { - return convertSet(userRoleMapper.selectListByUserId(userId), UserRoleDO::getRoleId); + Set roleIds = getRawUserRoleIdListByUserId(userId); + List roles = roleService.getRoleList(roleIds); + roles.removeIf(role -> !CommonStatusEnum.ENABLE.getStatus().equals(role.getStatus())); + return convertSet(roles, RoleDO::getId); } @Override @Cacheable(value = RedisKeyConstants.USER_ROLE_ID_LIST, key = "#userId") public Set getUserRoleIdListByUserIdFromCache(Long userId) { - return getUserRoleIdListByUserId(userId); + return getRawUserRoleIdListByUserId(userId); } @Override @@ -264,69 +309,6 @@ public class PermissionServiceImpl implements PermissionService { return roles; } - // ========== 用户-部门的相关方法 ========== - - @Override - public void assignRoleDataScope(Long roleId, Integer dataScope, Set dataScopeDeptIds) { - roleService.updateRoleDataScope(roleId, dataScope, dataScopeDeptIds); - } - - @Override - public DeptDataPermissionRespDTO getDeptDataPermission(Long userId) { - // 获得用户的角色 - List roles = getEnableUserRoleListByUserIdFromCache(userId); - - // 如果角色为空,则只能查看自己 - DeptDataPermissionRespDTO result = new DeptDataPermissionRespDTO(); - if (CollUtil.isEmpty(roles)) { - result.setSelf(true); - return result; - } - - // 获得用户的部门编号的缓存,通过 Guava 的 Suppliers 惰性求值,即有且仅有第一次发起 DB 的查询 - Supplier userDeptId = Suppliers.memoize(() -> userService.getUser(userId).getDeptId()); - // 遍历每个角色,计算 - for (RoleDO role : roles) { - // 为空时,跳过 - if (role.getDataScope() == null) { - continue; - } - // 情况一,ALL - if (Objects.equals(role.getDataScope(), DataScopeEnum.ALL.getScope())) { - result.setAll(true); - continue; - } - // 情况二,DEPT_CUSTOM - if (Objects.equals(role.getDataScope(), DataScopeEnum.DEPT_CUSTOM.getScope())) { - CollUtil.addAll(result.getDeptIds(), role.getDataScopeDeptIds()); - // 自定义可见部门时,保证可以看到自己所在的部门。否则,一些场景下可能会有问题。 - // 例如说,登录时,基于 t_user 的 username 查询会可能被 dept_id 过滤掉 - CollUtil.addAll(result.getDeptIds(), userDeptId.get()); - continue; - } - // 情况三,DEPT_ONLY - if (Objects.equals(role.getDataScope(), DataScopeEnum.DEPT_ONLY.getScope())) { - CollectionUtils.addIfNotNull(result.getDeptIds(), userDeptId.get()); - continue; - } - // 情况四,DEPT_DEPT_AND_CHILD - if (Objects.equals(role.getDataScope(), DataScopeEnum.DEPT_AND_CHILD.getScope())) { - CollUtil.addAll(result.getDeptIds(), deptService.getChildDeptIdListFromCache(userDeptId.get())); - // 添加本身部门编号 - CollUtil.addAll(result.getDeptIds(), userDeptId.get()); - continue; - } - // 情况五,SELF - if (Objects.equals(role.getDataScope(), DataScopeEnum.SELF.getScope())) { - result.setSelf(true); - continue; - } - // 未知情况,error log 即可 - log.error("[getDeptDataPermission][LoginUser({}) role({}) 无法处理]", userId, toJsonString(result)); - } - return result; - } - /** * 获得自身的代理对象,解决 AOP 生效问题 * @@ -336,4 +318,11 @@ public class PermissionServiceImpl implements PermissionService { return SpringUtil.getBean(getClass()); } + /** + * 获得用户已分配的原始角色编号集合,不做启停状态过滤,供缓存与底层鉴权链路复用。 + */ + private Set getRawUserRoleIdListByUserId(Long userId) { + return convertSet(userRoleMapper.selectListByUserId(userId), UserRoleDO::getRoleId); + } + } diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/permission/RoleService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/permission/RoleService.java similarity index 90% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/permission/RoleService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/permission/RoleService.java index 2a94f35..e9871a0 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/permission/RoleService.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/permission/RoleService.java @@ -8,7 +8,6 @@ import jakarta.validation.Valid; import java.util.Collection; import java.util.List; -import java.util.Set; /** * 角色 Service 接口 @@ -47,15 +46,6 @@ public interface RoleService { */ void deleteRoleList(List ids); - /** - * 设置角色的数据权限 - * - * @param id 角色编号 - * @param dataScope 数据范围 - * @param dataScopeDeptIds 部门编号数组 - */ - void updateRoleDataScope(Long id, Integer dataScope, Set dataScopeDeptIds); - /** * 获得角色 * diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/permission/RoleServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/permission/RoleServiceImpl.java similarity index 70% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/permission/RoleServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/permission/RoleServiceImpl.java index 68263ed..04609bf 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/permission/RoleServiceImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/permission/RoleServiceImpl.java @@ -5,6 +5,10 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.ObjUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.extra.spring.SpringUtil; +import com.google.common.annotations.VisibleForTesting; +import com.mzt.logapi.context.LogRecordContext; +import com.mzt.logapi.service.impl.DiffParseFunction; +import com.mzt.logapi.starter.annotation.LogRecord; import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; import com.njcn.msgpush.framework.common.pojo.PageResult; import com.njcn.msgpush.framework.common.util.collection.CollectionUtils; @@ -14,13 +18,8 @@ import com.njcn.msgpush.module.system.controller.admin.permission.vo.role.RoleSa import com.njcn.msgpush.module.system.dal.dataobject.permission.RoleDO; import com.njcn.msgpush.module.system.dal.mysql.permission.RoleMapper; import com.njcn.msgpush.module.system.dal.redis.RedisKeyConstants; -import com.njcn.msgpush.module.system.enums.permission.DataScopeEnum; import com.njcn.msgpush.module.system.enums.permission.RoleCodeEnum; import com.njcn.msgpush.module.system.enums.permission.RoleTypeEnum; -import com.google.common.annotations.VisibleForTesting; -import com.mzt.logapi.context.LogRecordContext; -import com.mzt.logapi.service.impl.DiffParseFunction; -import com.mzt.logapi.starter.annotation.LogRecord; import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; import org.springframework.cache.annotation.CacheEvict; @@ -29,18 +28,27 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.StringUtils; -import java.util.*; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; import static com.njcn.msgpush.framework.common.exception.util.ServiceExceptionUtil.exception; import static com.njcn.msgpush.framework.common.util.collection.CollectionUtils.convertMap; -import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.*; -import static com.njcn.msgpush.module.system.enums.LogRecordConstants.*; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.ROLE_ADMIN_CODE_ERROR; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.ROLE_CAN_NOT_DELETE_SYSTEM_TYPE_ROLE; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.ROLE_CODE_DUPLICATE; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.ROLE_IS_DISABLE; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.ROLE_NAME_DUPLICATE; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.ROLE_NOT_EXISTS; +import static com.njcn.msgpush.module.system.enums.LogRecordConstants.SYSTEM_ROLE_CREATE_SUB_TYPE; +import static com.njcn.msgpush.module.system.enums.LogRecordConstants.SYSTEM_ROLE_CREATE_SUCCESS; +import static com.njcn.msgpush.module.system.enums.LogRecordConstants.SYSTEM_ROLE_DELETE_SUB_TYPE; +import static com.njcn.msgpush.module.system.enums.LogRecordConstants.SYSTEM_ROLE_DELETE_SUCCESS; +import static com.njcn.msgpush.module.system.enums.LogRecordConstants.SYSTEM_ROLE_TYPE; +import static com.njcn.msgpush.module.system.enums.LogRecordConstants.SYSTEM_ROLE_UPDATE_SUB_TYPE; +import static com.njcn.msgpush.module.system.enums.LogRecordConstants.SYSTEM_ROLE_UPDATE_SUCCESS; -/** - * 角色 Service 实现类 - * - * @author hongawen - */ @Service @Slf4j public class RoleServiceImpl implements RoleService { @@ -56,17 +64,13 @@ public class RoleServiceImpl implements RoleService { @LogRecord(type = SYSTEM_ROLE_TYPE, subType = SYSTEM_ROLE_CREATE_SUB_TYPE, bizNo = "{{#role.id}}", success = SYSTEM_ROLE_CREATE_SUCCESS) public Long createRole(RoleSaveReqVO createReqVO, Integer type) { - // 1. 校验角色 validateRoleDuplicate(createReqVO.getName(), createReqVO.getCode(), null); - // 2. 插入到数据库 RoleDO role = BeanUtils.toBean(createReqVO, RoleDO.class) .setType(ObjectUtil.defaultIfNull(type, RoleTypeEnum.CUSTOM.getType())) - .setStatus(ObjUtil.defaultIfNull(createReqVO.getStatus(), CommonStatusEnum.ENABLE.getStatus())) - .setDataScope(DataScopeEnum.ALL.getScope()); // 默认可查看所有数据。原因是,可能一些项目不需要项目权限 + .setStatus(ObjUtil.defaultIfNull(createReqVO.getStatus(), CommonStatusEnum.ENABLE.getStatus())); roleMapper.insert(role); - // 3. 记录操作日志上下文 LogRecordContext.putVariable("role", role); return role.getId(); } @@ -76,127 +80,105 @@ public class RoleServiceImpl implements RoleService { @LogRecord(type = SYSTEM_ROLE_TYPE, subType = SYSTEM_ROLE_UPDATE_SUB_TYPE, bizNo = "{{#updateReqVO.id}}", success = SYSTEM_ROLE_UPDATE_SUCCESS) public void updateRole(RoleSaveReqVO updateReqVO) { - // 1.1 校验是否可以更新 - RoleDO role = validateRoleForUpdate(updateReqVO.getId()); - // 1.2 校验角色的唯一字段是否重复 - validateRoleDuplicate(updateReqVO.getName(), updateReqVO.getCode(), updateReqVO.getId()); + RoleDO role = validateRoleExists(updateReqVO.getId()); + String effectiveCode = shouldPreserveBuiltInCode(role) ? role.getCode() : updateReqVO.getCode(); + validateRoleDuplicate(updateReqVO.getName(), effectiveCode, updateReqVO.getId()); - // 2. 更新到数据库 RoleDO updateObj = BeanUtils.toBean(updateReqVO, RoleDO.class); + if (shouldPreserveBuiltInCode(role)) { + updateObj.setCode(role.getCode()); + } roleMapper.updateById(updateObj); - // 3. 记录操作日志上下文 LogRecordContext.putVariable(DiffParseFunction.OLD_OBJECT, BeanUtils.toBean(role, RoleSaveReqVO.class)); LogRecordContext.putVariable("role", role); } - @Override - @CacheEvict(value = RedisKeyConstants.ROLE, key = "#id") - public void updateRoleDataScope(Long id, Integer dataScope, Set dataScopeDeptIds) { - // 校验是否可以更新 - validateRoleForUpdate(id); - - // 更新数据范围 - RoleDO updateObject = new RoleDO(); - updateObject.setId(id); - updateObject.setDataScope(dataScope); - updateObject.setDataScopeDeptIds(dataScopeDeptIds); - roleMapper.updateById(updateObject); - } - @Override @Transactional(rollbackFor = Exception.class) @CacheEvict(value = RedisKeyConstants.ROLE, key = "#id") @LogRecord(type = SYSTEM_ROLE_TYPE, subType = SYSTEM_ROLE_DELETE_SUB_TYPE, bizNo = "{{#id}}", success = SYSTEM_ROLE_DELETE_SUCCESS) public void deleteRole(Long id) { - // 1. 校验是否可以更新 - RoleDO role = validateRoleForUpdate(id); + RoleDO role = validateRoleForDelete(id); - // 2.1 标记删除 roleMapper.deleteById(id); - // 2.2 删除相关数据 permissionService.processRoleDeleted(id); - // 3. 记录操作日志上下文 LogRecordContext.putVariable("role", role); } @Override @Transactional(rollbackFor = Exception.class) + @CacheEvict(value = RedisKeyConstants.ROLE, allEntries = true) public void deleteRoleList(List ids) { - // 1. 校验是否可以删除 - ids.forEach(this::validateRoleForUpdate); + ids.forEach(this::validateRoleForDelete); - // 2.1 标记删除 roleMapper.deleteByIds(ids); - // 2.2 删除相关数据 - ids.forEach(id -> permissionService.processRoleDeleted(id)); + ids.forEach(permissionService::processRoleDeleted); } - /** - * 校验角色的唯一字段是否重复 - * - * 1. 是否存在相同名字的角色 - * 2. 是否存在相同编码的角色 - * - * @param name 角色名字 - * @param code 角色额编码 - * @param id 角色编号 - */ @VisibleForTesting void validateRoleDuplicate(String name, String code, Long id) { - // 0. 超级管理员,不允许创建 - if (RoleCodeEnum.isSuperAdmin(code)) { - throw exception(ROLE_ADMIN_CODE_ERROR, code); + if (RoleCodeEnum.isBuiltIn(code)) { + if (id == null) { + throw exception(ROLE_ADMIN_CODE_ERROR, code); + } + RoleDO currentRole = roleMapper.selectById(id); + if (currentRole == null || !ObjUtil.equal(currentRole.getCode(), code)) { + throw exception(ROLE_ADMIN_CODE_ERROR, code); + } } - // 1. 该 name 名字被其它角色所使用 + RoleDO role = roleMapper.selectByName(name); if (role != null && !role.getId().equals(id)) { throw exception(ROLE_NAME_DUPLICATE, name); } - // 2. 是否存在相同编码的角色 + if (!StringUtils.hasText(code)) { return; } - // 该 code 编码被其它角色所使用 role = roleMapper.selectByCode(code); if (role != null && !role.getId().equals(id)) { throw exception(ROLE_CODE_DUPLICATE, code); } } - /** - * 校验角色是否可以被更新 - * - * @param id 角色编号 - */ @VisibleForTesting - RoleDO validateRoleForUpdate(Long id) { + RoleDO validateRoleExists(Long id) { RoleDO role = roleMapper.selectById(id); if (role == null) { throw exception(ROLE_NOT_EXISTS); } - // 内置角色,不允许删除 + return role; + } + + @VisibleForTesting + RoleDO validateRoleForDelete(Long id) { + RoleDO role = validateRoleExists(id); if (RoleTypeEnum.SYSTEM.getType().equals(role.getType())) { - throw exception(ROLE_CAN_NOT_UPDATE_SYSTEM_TYPE_ROLE); + throw exception(ROLE_CAN_NOT_DELETE_SYSTEM_TYPE_ROLE); } return role; } + private boolean shouldPreserveBuiltInCode(RoleDO role) { + return role != null + && RoleTypeEnum.SYSTEM.getType().equals(role.getType()) + && RoleCodeEnum.isBuiltIn(role.getCode()); + } + @Override public RoleDO getRole(Long id) { return roleMapper.selectById(id); } @Override - @Cacheable(value = RedisKeyConstants.ROLE, key = "#id", - unless = "#result == null") + @Cacheable(value = RedisKeyConstants.ROLE, key = "#id", unless = "#result == null") public RoleDO getRoleFromCache(Long id) { return roleMapper.selectById(id); } - @Override public List getRoleListByStatus(Collection statuses) { return roleMapper.selectListByStatus(statuses); @@ -220,7 +202,6 @@ public class RoleServiceImpl implements RoleService { if (CollectionUtil.isEmpty(ids)) { return Collections.emptyList(); } - // 这里采用 for 循环从缓存中获取,主要考虑 Spring CacheManager 无法批量操作的问题 RoleServiceImpl self = getSelf(); return CollectionUtils.convertList(ids, self::getRoleFromCache); } @@ -247,10 +228,8 @@ public class RoleServiceImpl implements RoleService { if (CollUtil.isEmpty(ids)) { return; } - // 获得角色信息 List roles = roleMapper.selectByIds(ids); Map roleMap = convertMap(roles, RoleDO::getId); - // 校验 ids.forEach(id -> { RoleDO role = roleMap.get(id); if (role == null) { @@ -262,11 +241,6 @@ public class RoleServiceImpl implements RoleService { }); } - /** - * 获得自身的代理对象,解决 AOP 生效问题 - * - * @return 自己 - */ private RoleServiceImpl getSelf() { return SpringUtil.getBean(getClass()); } diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/user/AdminUserService.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/user/AdminUserService.java similarity index 88% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/user/AdminUserService.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/user/AdminUserService.java index f943d95..b91e049 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/user/AdminUserService.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/user/AdminUserService.java @@ -49,10 +49,10 @@ public interface AdminUserService { void updateUser(@Valid UserSaveReqVO updateReqVO); /** - * 更新用户的最后登陆信息 + * 更新用户的最后登录信息 * * @param id 用户编号 - * @param loginIp 登陆 IP + * @param loginIp 登录 IP */ void updateUserLogin(Long id, String loginIp); @@ -75,7 +75,7 @@ public interface AdminUserService { /** * 修改密码 * - * @param id 用户编号 + * @param id 用户编号 * @param password 密码 */ void updateUserPassword(Long id, String password); @@ -83,7 +83,7 @@ public interface AdminUserService { /** * 修改状态 * - * @param id 用户编号 + * @param id 用户编号 * @param status 状态 */ void updateUserStatus(Long id, Integer status); @@ -129,7 +129,7 @@ public interface AdminUserService { /** * 通过用户 ID 查询用户 * - * @param id 用户ID + * @param id 用户 ID * @return 用户对象信息 */ AdminUserDO getUser(Long id); @@ -162,6 +162,7 @@ public interface AdminUserService { * 校验用户们是否有效。如下情况,视为无效: * 1. 用户编号不存在 * 2. 用户被禁用 + * 3. 用户已离职生效 * * @param ids 用户编号数组 */ @@ -191,7 +192,7 @@ public interface AdminUserService { /** * 批量导入用户 * - * @param importUsers 导入用户列表 + * @param importUsers 导入用户列表 * @param isUpdateSupport 是否支持更新 * @return 导入结果 */ @@ -214,4 +215,24 @@ public interface AdminUserService { */ boolean isPasswordMatch(String rawPassword, String encodedPassword); + /** + * 判断用户是否已离职生效 + * + * @param user 用户 + * @return 是否已离职 + */ + boolean isUserResigned(AdminUserDO user); + + /** + * 判断用户当前是否可用 + * + * 口径: + * 1. `status` 必须为启用 + * 2. `resignedAt` 为空,或者晚于当前时间 + * + * @param user 用户 + * @return 是否可用 + */ + boolean isUserAvailable(AdminUserDO user); + } diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/user/AdminUserServiceImpl.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/user/AdminUserServiceImpl.java similarity index 72% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/user/AdminUserServiceImpl.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/user/AdminUserServiceImpl.java index d626eb2..550f35c 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/service/user/AdminUserServiceImpl.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/service/user/AdminUserServiceImpl.java @@ -1,9 +1,12 @@ package com.njcn.msgpush.module.system.service.user; import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.ObjUtil; import cn.hutool.core.util.StrUtil; +import com.google.common.annotations.VisibleForTesting; +import com.mzt.logapi.context.LogRecordContext; +import com.mzt.logapi.service.impl.DiffParseFunction; +import com.mzt.logapi.starter.annotation.LogRecord; import com.njcn.msgpush.framework.common.enums.CommonStatusEnum; import com.njcn.msgpush.framework.common.enums.UserTypeEnum; import com.njcn.msgpush.framework.common.exception.ServiceException; @@ -11,7 +14,6 @@ import com.njcn.msgpush.framework.common.pojo.PageResult; import com.njcn.msgpush.framework.common.util.collection.CollectionUtils; import com.njcn.msgpush.framework.common.util.object.BeanUtils; import com.njcn.msgpush.framework.common.util.validation.ValidationUtils; -import com.njcn.msgpush.module.infra.api.config.ConfigApi; import com.njcn.msgpush.module.system.controller.admin.auth.vo.AuthRegisterReqVO; import com.njcn.msgpush.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO; import com.njcn.msgpush.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO; @@ -19,19 +21,15 @@ import com.njcn.msgpush.module.system.controller.admin.user.vo.user.UserImportEx import com.njcn.msgpush.module.system.controller.admin.user.vo.user.UserImportRespVO; import com.njcn.msgpush.module.system.controller.admin.user.vo.user.UserPageReqVO; import com.njcn.msgpush.module.system.controller.admin.user.vo.user.UserSaveReqVO; +import com.njcn.msgpush.module.system.dal.dataobject.config.ConfigDO; import com.njcn.msgpush.module.system.dal.dataobject.dept.DeptDO; -import com.njcn.msgpush.module.system.dal.dataobject.dept.UserPostDO; import com.njcn.msgpush.module.system.dal.dataobject.user.AdminUserDO; -import com.njcn.msgpush.module.system.dal.mysql.dept.UserPostMapper; import com.njcn.msgpush.module.system.dal.mysql.user.AdminUserMapper; +import com.njcn.msgpush.module.system.service.config.ConfigService; import com.njcn.msgpush.module.system.service.dept.DeptService; import com.njcn.msgpush.module.system.service.dept.PostService; import com.njcn.msgpush.module.system.service.oauth2.OAuth2TokenService; import com.njcn.msgpush.module.system.service.permission.PermissionService; -import com.google.common.annotations.VisibleForTesting; -import com.mzt.logapi.context.LogRecordContext; -import com.mzt.logapi.service.impl.DiffParseFunction; -import com.mzt.logapi.starter.annotation.LogRecord; import jakarta.annotation.Resource; import jakarta.validation.ConstraintViolationException; import lombok.extern.slf4j.Slf4j; @@ -41,12 +39,36 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.time.LocalDateTime; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.atomic.AtomicInteger; import static com.njcn.msgpush.framework.common.exception.util.ServiceExceptionUtil.exception; -import static com.njcn.msgpush.framework.common.util.collection.CollectionUtils.*; -import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.*; -import static com.njcn.msgpush.module.system.enums.LogRecordConstants.*; +import static com.njcn.msgpush.framework.common.util.collection.CollectionUtils.singleton; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.USER_EMAIL_EXISTS; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.USER_IMPORT_INIT_PASSWORD; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.USER_IMPORT_LIST_IS_EMPTY; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.USER_IS_DISABLE; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.USER_IS_RESIGNED; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.USER_MOBILE_EXISTS; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.USER_NOT_EXISTS; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.USER_PASSWORD_FAILED; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.USER_REGISTER_DISABLED; +import static com.njcn.msgpush.module.system.enums.ErrorCodeConstants.USER_USERNAME_EXISTS; +import static com.njcn.msgpush.module.system.enums.LogRecordConstants.SYSTEM_USER_CREATE_SUB_TYPE; +import static com.njcn.msgpush.module.system.enums.LogRecordConstants.SYSTEM_USER_CREATE_SUCCESS; +import static com.njcn.msgpush.module.system.enums.LogRecordConstants.SYSTEM_USER_DELETE_SUB_TYPE; +import static com.njcn.msgpush.module.system.enums.LogRecordConstants.SYSTEM_USER_DELETE_SUCCESS; +import static com.njcn.msgpush.module.system.enums.LogRecordConstants.SYSTEM_USER_TYPE; +import static com.njcn.msgpush.module.system.enums.LogRecordConstants.SYSTEM_USER_UPDATE_PASSWORD_SUB_TYPE; +import static com.njcn.msgpush.module.system.enums.LogRecordConstants.SYSTEM_USER_UPDATE_PASSWORD_SUCCESS; +import static com.njcn.msgpush.module.system.enums.LogRecordConstants.SYSTEM_USER_UPDATE_SUB_TYPE; +import static com.njcn.msgpush.module.system.enums.LogRecordConstants.SYSTEM_USER_UPDATE_SUCCESS; /** * 后台用户 Service 实现类 @@ -58,12 +80,10 @@ import static com.njcn.msgpush.module.system.enums.LogRecordConstants.*; public class AdminUserServiceImpl implements AdminUserService { static final String USER_INIT_PASSWORD_KEY = "system.user.init-password"; - static final String USER_REGISTER_ENABLED_KEY = "system.user.register-enabled"; @Resource private AdminUserMapper userMapper; - @Resource private DeptService deptService; @Resource @@ -73,34 +93,24 @@ public class AdminUserServiceImpl implements AdminUserService { @Resource private PasswordEncoder passwordEncoder; @Resource - @Lazy // 懒加载,避免循环依赖 + @Lazy private OAuth2TokenService oauth2TokenService; - @Resource - private UserPostMapper userPostMapper; - - @Resource - private ConfigApi configApi; + private ConfigService configService; @Override @Transactional(rollbackFor = Exception.class) @LogRecord(type = SYSTEM_USER_TYPE, subType = SYSTEM_USER_CREATE_SUB_TYPE, bizNo = "{{#user.id}}", success = SYSTEM_USER_CREATE_SUCCESS) public Long createUser(UserSaveReqVO createReqVO) { - // 1.1 校验正确性 - validateUserForCreateOrUpdate(null, createReqVO.getUsername(), - createReqVO.getMobile(), createReqVO.getEmail(), createReqVO.getDeptId(), createReqVO.getPostIds()); - // 2.1 插入用户 + // 1. 校验正确性 + validateUserForCreateOrUpdate(null, createReqVO.getUsername(), createReqVO.getMobile(), + createReqVO.getEmail(), createReqVO.getDeptId(), createReqVO.getPositionId()); + // 2. 插入用户 AdminUserDO user = BeanUtils.toBean(createReqVO, AdminUserDO.class); user.setStatus(CommonStatusEnum.ENABLE.getStatus()); // 默认开启 user.setPassword(encodePassword(createReqVO.getPassword())); // 加密密码 userMapper.insert(user); - // 2.2 插入关联岗位 - if (CollectionUtil.isNotEmpty(user.getPostIds())) { - userPostMapper.insertBatch(convertList(user.getPostIds(), - postId -> new UserPostDO().setUserId(user.getId()).setPostId(postId))); - } - // 3. 记录操作日志上下文 LogRecordContext.putVariable("user", user); return user.getId(); @@ -109,12 +119,12 @@ public class AdminUserServiceImpl implements AdminUserService { @Override public Long registerUser(AuthRegisterReqVO registerReqVO) { // 1.1 校验是否开启注册 - if (ObjUtil.notEqual(configApi.getConfigValueByKey(USER_REGISTER_ENABLED_KEY).getCheckedData(), "true")) { + if (ObjUtil.notEqual(getConfigValue(USER_REGISTER_ENABLED_KEY), "true")) { throw exception(USER_REGISTER_DISABLED); } // 1.2 校验正确性 - validateUserForCreateOrUpdate(null, registerReqVO.getUsername(), null, null, null, null); - + validateUserForCreateOrUpdate(null, registerReqVO.getUsername(), null, null, + registerReqVO.getDeptId(), registerReqVO.getPositionId()); // 2. 插入用户 AdminUserDO user = BeanUtils.toBean(registerReqVO, AdminUserDO.class); user.setStatus(CommonStatusEnum.ENABLE.getStatus()); // 默认开启 @@ -131,33 +141,16 @@ public class AdminUserServiceImpl implements AdminUserService { updateReqVO.setPassword(null); // 特殊:此处不更新密码 // 1. 校验正确性 AdminUserDO oldUser = validateUserForCreateOrUpdate(updateReqVO.getId(), updateReqVO.getUsername(), - updateReqVO.getMobile(), updateReqVO.getEmail(), updateReqVO.getDeptId(), updateReqVO.getPostIds()); - - // 2.1 更新用户 + updateReqVO.getMobile(), updateReqVO.getEmail(), updateReqVO.getDeptId(), updateReqVO.getPositionId()); + // 2. 更新用户 AdminUserDO updateObj = BeanUtils.toBean(updateReqVO, AdminUserDO.class); userMapper.updateById(updateObj); - // 2.2 更新岗位 - updateUserPost(updateReqVO, updateObj); - // 3. 记录操作日志上下文 LogRecordContext.putVariable(DiffParseFunction.OLD_OBJECT, BeanUtils.toBean(oldUser, UserSaveReqVO.class)); LogRecordContext.putVariable("user", oldUser); - } - - private void updateUserPost(UserSaveReqVO reqVO, AdminUserDO updateObj) { - Long userId = reqVO.getId(); - Set dbPostIds = convertSet(userPostMapper.selectListByUserId(userId), UserPostDO::getPostId); - // 计算新增和删除的岗位编号 - Set postIds = CollUtil.emptyIfNull(updateObj.getPostIds()); - Collection createPostIds = CollUtil.subtract(postIds, dbPostIds); - Collection deletePostIds = CollUtil.subtract(dbPostIds, postIds); - // 执行新增和删除。对于已经授权的岗位,不用做任何处理 - if (!CollectionUtil.isEmpty(createPostIds)) { - userPostMapper.insertBatch(convertList(createPostIds, - postId -> new UserPostDO().setUserId(userId).setPostId(postId))); - } - if (!CollectionUtil.isEmpty(deletePostIds)) { - userPostMapper.deleteByUserIdAndPostId(userId, deletePostIds); + // 4. 如果更新后用户已不可用,主动移除其 token + if (!isUserAvailable(buildAvailabilityUser(oldUser, updateReqVO.getResignedAt(), oldUser.getStatus()))) { + oauth2TokenService.removeAccessToken(oldUser.getId(), UserTypeEnum.ADMIN.getValue()); } } @@ -178,7 +171,7 @@ public class AdminUserServiceImpl implements AdminUserService { @Override public void updateUserPassword(Long id, UserProfileUpdatePasswordReqVO reqVO) { - // 校验旧密码密码 + // 校验旧密码 validateOldPassword(id, reqVO.getOldPassword()); // 执行更新 AdminUserDO updateObj = new AdminUserDO().setId(id); @@ -192,13 +185,11 @@ public class AdminUserServiceImpl implements AdminUserService { public void updateUserPassword(Long id, String password) { // 1. 校验用户存在 AdminUserDO user = validateUserExists(id); - // 2. 更新密码 AdminUserDO updateObj = new AdminUserDO(); updateObj.setId(id); updateObj.setPassword(encodePassword(password)); // 加密密码 userMapper.updateById(updateObj); - // 3. 记录操作日志上下文 LogRecordContext.putVariable("user", user); LogRecordContext.putVariable("newPassword", updateObj.getPassword()); @@ -207,15 +198,14 @@ public class AdminUserServiceImpl implements AdminUserService { @Override public void updateUserStatus(Long id, Integer status) { // 校验用户存在 - validateUserExists(id); + AdminUserDO user = validateUserExists(id); // 更新状态 AdminUserDO updateObj = new AdminUserDO(); updateObj.setId(id); updateObj.setStatus(status); userMapper.updateById(updateObj); - - // 如果是禁用用户,则删除其 Token 信息 - if (CommonStatusEnum.isDisable(status)) { + // 如果更新后用户不可用,则删除其 Token 信息 + if (!isUserAvailable(buildAvailabilityUser(user, user.getResignedAt(), status))) { oauth2TokenService.removeAccessToken(id, UserTypeEnum.ADMIN.getValue()); } } @@ -227,14 +217,10 @@ public class AdminUserServiceImpl implements AdminUserService { public void deleteUser(Long id) { // 1. 校验用户存在 AdminUserDO user = validateUserExists(id); - - // 2.1 删除用户 + // 2. 删除用户及其关联数据 userMapper.deleteById(id); - // 2.2 删除用户关联数据 permissionService.processUserDeleted(id); - // 2.2 删除用户岗位 - userPostMapper.deleteByUserId(id); - + oauth2TokenService.removeAccessToken(id, UserTypeEnum.ADMIN.getValue()); // 3. 记录操作日志上下文 LogRecordContext.putVariable("user", user); } @@ -244,11 +230,10 @@ public class AdminUserServiceImpl implements AdminUserService { public void deleteUserList(List ids) { // 1. 批量删除用户 userMapper.deleteByIds(ids); - // 2. 批量删除用户关联数据 ids.forEach(id -> { permissionService.processUserDeleted(id); - userPostMapper.deleteByUserId(id); + oauth2TokenService.removeAccessToken(id, UserTypeEnum.ADMIN.getValue()); }); } @@ -265,10 +250,12 @@ public class AdminUserServiceImpl implements AdminUserService { @Override public PageResult getUserPage(UserPageReqVO reqVO) { // 如果有角色编号,查询角色对应的用户编号 - Set userIds = reqVO.getRoleId() != null ? - permissionService.getUserRoleIdListByRoleId(singleton(reqVO.getRoleId())) : null; - if (userIds != null && userIds.isEmpty()) { - return PageResult.empty(); + Set userIds = null; + if (reqVO.getRoleId() != null) { + userIds = permissionService.getUserRoleIdListByRoleId(singleton(reqVO.getRoleId())); + if (CollUtil.isEmpty(userIds)) { + return PageResult.empty(); + } } // 分页查询 return userMapper.selectPage(reqVO, getDeptCondition(reqVO.getDeptId()), userIds); @@ -292,11 +279,7 @@ public class AdminUserServiceImpl implements AdminUserService { if (CollUtil.isEmpty(postIds)) { return Collections.emptyList(); } - Set userIds = convertSet(userPostMapper.selectListByPostIds(postIds), UserPostDO::getUserId); - if (CollUtil.isEmpty(userIds)) { - return Collections.emptyList(); - } - return userMapper.selectByIds(userIds); + return userMapper.selectListByPositionIds(postIds); } @Override @@ -312,7 +295,7 @@ public class AdminUserServiceImpl implements AdminUserService { if (CollUtil.isEmpty(ids)) { return; } - // 获得岗位信息 + // 获得用户信息 List users = userMapper.selectByIds(ids); Map userMap = CollectionUtils.convertMap(users, AdminUserDO::getId); // 校验 @@ -321,9 +304,12 @@ public class AdminUserServiceImpl implements AdminUserService { if (user == null) { throw exception(USER_NOT_EXISTS); } - if (!CommonStatusEnum.ENABLE.getStatus().equals(user.getStatus())) { + if (CommonStatusEnum.isDisable(user.getStatus())) { throw exception(USER_IS_DISABLE, user.getNickname()); } + if (isUserResigned(user)) { + throw exception(USER_IS_RESIGNED, user.getNickname()); + } }); } @@ -342,13 +328,13 @@ public class AdminUserServiceImpl implements AdminUserService { if (deptId == null) { return Collections.emptySet(); } - Set deptIds = convertSet(deptService.getChildDeptList(deptId), DeptDO::getId); + Set deptIds = CollectionUtils.convertSet(deptService.getChildDeptList(deptId), DeptDO::getId); deptIds.add(deptId); // 包括自身 return deptIds; } private AdminUserDO validateUserForCreateOrUpdate(Long id, String username, String mobile, String email, - Long deptId, Set postIds) { + Long deptId, Long positionId) { // 校验用户存在 AdminUserDO user = validateUserExists(id); // 校验用户名唯一 @@ -358,9 +344,9 @@ public class AdminUserServiceImpl implements AdminUserService { // 校验邮箱唯一 validateEmailUnique(id, email); // 校验部门处于开启状态 - deptService.validateDeptList(CollectionUtils.singleton(deptId)); - // 校验岗位处于开启状态 - postService.validatePostList(postIds); + deptService.validateDeptList(singleton(deptId)); + // 校验主岗位处于开启状态 + postService.validatePostList(singleton(positionId)); return user; } @@ -386,10 +372,7 @@ public class AdminUserServiceImpl implements AdminUserService { return; } // 如果 id 为空,说明不用比较是否为相同 id 的用户 - if (id == null) { - throw exception(USER_USERNAME_EXISTS); - } - if (!user.getId().equals(id)) { + if (id == null || !user.getId().equals(id)) { throw exception(USER_USERNAME_EXISTS); } } @@ -404,10 +387,7 @@ public class AdminUserServiceImpl implements AdminUserService { return; } // 如果 id 为空,说明不用比较是否为相同 id 的用户 - if (id == null) { - throw exception(USER_EMAIL_EXISTS); - } - if (!user.getId().equals(id)) { + if (id == null || !user.getId().equals(id)) { throw exception(USER_EMAIL_EXISTS); } } @@ -422,10 +402,7 @@ public class AdminUserServiceImpl implements AdminUserService { return; } // 如果 id 为空,说明不用比较是否为相同 id 的用户 - if (id == null) { - throw exception(USER_MOBILE_EXISTS); - } - if (!user.getId().equals(id)) { + if (id == null || !user.getId().equals(id)) { throw exception(USER_MOBILE_EXISTS); } } @@ -433,7 +410,7 @@ public class AdminUserServiceImpl implements AdminUserService { /** * 校验旧密码 * - * @param id 用户 id + * @param id 用户 ID * @param oldPassword 旧密码 */ @VisibleForTesting @@ -448,43 +425,44 @@ public class AdminUserServiceImpl implements AdminUserService { } @Override - @Transactional(rollbackFor = Exception.class) // 添加事务,异常则回滚所有导入 + @Transactional(rollbackFor = Exception.class) public UserImportRespVO importUserList(List importUsers, boolean isUpdateSupport) { // 1.1 参数校验 if (CollUtil.isEmpty(importUsers)) { throw exception(USER_IMPORT_LIST_IS_EMPTY); } // 1.2 初始化密码不能为空 - String initPassword = configApi.getConfigValueByKey(USER_INIT_PASSWORD_KEY).getCheckedData(); + String initPassword = getConfigValue(USER_INIT_PASSWORD_KEY); if (StrUtil.isEmpty(initPassword)) { throw exception(USER_IMPORT_INIT_PASSWORD); } - - // 2. 遍历,逐个创建 or 更新 + // 2. 遍历,逐个创建或更新 UserImportRespVO respVO = UserImportRespVO.builder().createUsernames(new ArrayList<>()) .updateUsernames(new ArrayList<>()).failureUsernames(new LinkedHashMap<>()).build(); + AtomicInteger index = new AtomicInteger(1); importUsers.forEach(importUser -> { + int currentIndex = index.getAndIncrement(); // 2.1.1 校验字段是否符合要求 try { ValidationUtils.validate(BeanUtils.toBean(importUser, UserSaveReqVO.class).setPassword(initPassword)); } catch (ConstraintViolationException ex) { - respVO.getFailureUsernames().put(importUser.getUsername(), ex.getMessage()); + String key = StrUtil.blankToDefault(importUser.getUsername(), "第 " + currentIndex + " 行"); + respVO.getFailureUsernames().put(key, ex.getMessage()); return; } - // 2.1.2 校验,判断是否有不符合的原因 + // 2.1.2 校验业务约束 try { validateUserForCreateOrUpdate(null, null, importUser.getMobile(), importUser.getEmail(), - importUser.getDeptId(), null); + importUser.getDeptId(), importUser.getPositionId()); } catch (ServiceException ex) { respVO.getFailureUsernames().put(importUser.getUsername(), ex.getMessage()); return; } - - // 2.2.1 判断如果不存在,在进行插入 + // 2.2.1 判断如果不存在,则插入 AdminUserDO existUser = userMapper.selectByUsername(importUser.getUsername()); if (existUser == null) { userMapper.insert(BeanUtils.toBean(importUser, AdminUserDO.class) - .setPassword(encodePassword(initPassword)).setPostIds(new HashSet<>())); // 设置默认密码及空岗位编号数组 + .setPassword(encodePassword(initPassword))); respVO.getCreateUsernames().add(importUser.getUsername()); return; } @@ -511,6 +489,21 @@ public class AdminUserServiceImpl implements AdminUserService { return passwordEncoder.matches(rawPassword, encodedPassword); } + @Override + public boolean isUserResigned(AdminUserDO user) { + if (user == null || user.getResignedAt() == null) { + return false; + } + return !user.getResignedAt().isAfter(LocalDateTime.now()); + } + + @Override + public boolean isUserAvailable(AdminUserDO user) { + return user != null + && CommonStatusEnum.ENABLE.getStatus().equals(user.getStatus()) + && !isUserResigned(user); + } + /** * 对密码进行加密 * @@ -521,4 +514,23 @@ public class AdminUserServiceImpl implements AdminUserService { return passwordEncoder.encode(password); } + /** + * 读取 system 模块内部参数配置,避免同服务自调用 Feign。 + * + * @param key 配置键 + * @return 配置值 + */ + private String getConfigValue(String key) { + ConfigDO config = configService.getConfigByKey(key); + return config != null ? config.getValue() : null; + } + + private AdminUserDO buildAvailabilityUser(AdminUserDO user, LocalDateTime resignedAt, Integer status) { + return new AdminUserDO() + .setId(user.getId()) + .setNickname(user.getNickname()) + .setStatus(status) + .setResignedAt(resignedAt); + } + } diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/util/oauth2/OAuth2Utils.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/util/oauth2/OAuth2Utils.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/util/oauth2/OAuth2Utils.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/util/oauth2/OAuth2Utils.java diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/util/package-info.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/util/package-info.java similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/java/com/njcn/msgpush/module/system/util/package-info.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/util/package-info.java diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/websocket/DemoWebSocketMessageListener.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/websocket/DemoWebSocketMessageListener.java similarity index 90% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/websocket/DemoWebSocketMessageListener.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/websocket/DemoWebSocketMessageListener.java index 97c7189..75b3596 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/websocket/DemoWebSocketMessageListener.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/websocket/DemoWebSocketMessageListener.java @@ -1,11 +1,11 @@ -package com.njcn.msgpush.module.infra.websocket; +package com.njcn.msgpush.module.system.websocket; import com.njcn.msgpush.framework.common.enums.UserTypeEnum; import com.njcn.msgpush.framework.websocket.core.listener.WebSocketMessageListener; import com.njcn.msgpush.framework.websocket.core.sender.WebSocketMessageSender; import com.njcn.msgpush.framework.websocket.core.util.WebSocketFrameworkUtils; -import com.njcn.msgpush.module.infra.websocket.message.DemoReceiveMessage; -import com.njcn.msgpush.module.infra.websocket.message.DemoSendMessage; +import com.njcn.msgpush.module.system.websocket.message.DemoReceiveMessage; +import com.njcn.msgpush.module.system.websocket.message.DemoSendMessage; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.web.socket.WebSocketSession; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/websocket/message/DemoReceiveMessage.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/websocket/message/DemoReceiveMessage.java similarity index 85% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/websocket/message/DemoReceiveMessage.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/websocket/message/DemoReceiveMessage.java index 1d22213..7cf8b57 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/websocket/message/DemoReceiveMessage.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/websocket/message/DemoReceiveMessage.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.infra.websocket.message; +package com.njcn.msgpush.module.system.websocket.message; import lombok.Data; diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/websocket/message/DemoSendMessage.java b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/websocket/message/DemoSendMessage.java similarity index 84% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/websocket/message/DemoSendMessage.java rename to msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/websocket/message/DemoSendMessage.java index a10fd79..f187af5 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/java/com/njcn/msgpush/module/infra/websocket/message/DemoSendMessage.java +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/java/com/njcn/msgpush/module/system/websocket/message/DemoSendMessage.java @@ -1,4 +1,4 @@ -package com.njcn.msgpush.module.infra.websocket.message; +package com.njcn.msgpush.module.system.websocket.message; import lombok.Data; diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/application-dev.yaml b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/application-dev.yaml similarity index 83% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/application-dev.yaml rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/application-dev.yaml index 3617d0e..fe5775b 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/resources/application-dev.yaml +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/application-dev.yaml @@ -1,4 +1,4 @@ ---- #################### 注册中心 + 配置中心相关配置 #################### +#################### 注册中心 + 配置中心相关配置 #################### spring: cloud: @@ -7,16 +7,15 @@ spring: username: # Nacos 账号 password: # Nacos 密码 discovery: # 【配置中心】配置项 - namespace: dev # 命名空间。这里使用 dev 开发环境 + namespace: 7e15dd2b-2aa2-487d-9e80-1c01c7b9f742 # 命名空间。这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP metadata: version: 1.0.0 # 服务实例的版本号,可用于灰度发布 config: # 【注册中心】配置项 - namespace: dev # 命名空间。这里使用 dev 开发环境 + namespace: 7e15dd2b-2aa2-487d-9e80-1c01c7b9f742 # 命名空间。这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP ---- #################### 数据库相关配置 #################### -spring: +#################### 数据库相关配置 #################### # 数据源配置项 autoconfigure: exclude: @@ -60,18 +59,16 @@ spring: url: jdbc:mysql://192.168.1.22:13306/msgpush?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 username: root password: njcnpqs - - # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 data: redis: - host: 127.0.0.1 # 地址 + host: 192.168.1.22 # 地址 port: 16379 # 端口 database: 1 # 数据库索引 # password: njcnpqs # 密码,建议生产环境开启 ---- #################### 监控相关配置 #################### +#################### 监控相关配置 #################### # Actuator 监控端点的配置项 management: @@ -82,7 +79,13 @@ management: include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。 ---- #################### 灿能相关配置 #################### + +# 日志文件配置 +logging: + file: + name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径 + +#################### 灿能相关配置 #################### # 灿能配置项,设置当前项目所有自定义的配置 msgpush: diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/application-local.yaml b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/application-local.yaml similarity index 81% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/application-local.yaml rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/application-local.yaml index ead5fb6..9a56bee 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/resources/application-local.yaml +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/application-local.yaml @@ -1,4 +1,4 @@ -#################### 注册中心 + 配置中心相关配置 #################### +#################### 注册中心 + 配置中心相关配置 #################### spring: cloud: nacos: @@ -6,12 +6,12 @@ spring: username: # Nacos 账号 password: # Nacos 密码 discovery: # 【配置中心】配置项 - namespace: dev # 命名空间。这里使用 dev 开发环境 + namespace: 7e15dd2b-2aa2-487d-9e80-1c01c7b9f742 # 命名空间。这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP metadata: version: 1.0.0 # 服务实例的版本号,可用于灰度发布 config: # 【注册中心】配置项 - namespace: dev # 命名空间。这里使用 dev 开发环境 + namespace: 7e15dd2b-2aa2-487d-9e80-1c01c7b9f742 # 命名空间。这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP #################### 数据库相关配置 #################### @@ -39,8 +39,8 @@ spring: multi-statement-allow: true dynamic: # 多数据源配置 druid: # Druid 【连接池】相关的全局配置 - initial-size: 1 # 初始连接数 - min-idle: 1 # 最小连接池数量 + initial-size: 5 # 初始连接数 + min-idle: 10 # 最小连接池数量 max-active: 20 # 最大连接池数量 max-wait: 60000 # 配置获取连接等待超时的时间,单位:毫秒(1 分钟) time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒(1 分钟) @@ -64,7 +64,7 @@ spring: redis: host: 127.0.0.1 # 地址 port: 16379 # 端口 - database: 0 # 数据库索引 + database: 1 # 数据库索引 # password: njcnpqs # 密码,建议生产环境开启 @@ -84,23 +84,17 @@ logging: level: # 配置自己写的 MyBatis Mapper 打印日志 com.njcn.msgpush.module.system.dal.mysql: debug - com.njcn.msgpush.module.system.dal.mysql.sms.SmsChannelMapper: INFO # 配置 SmsChannelMapper 的日志级别为 info - org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # TODO 芋艿:先禁用,Spring Boot 3.X 存在部分错误的 WARN 提示 - - - -#################### 灿能相关配置 #################### + com.njcn.msgpush.module.system.dal.mysql.logger.ApiErrorLogMapper: INFO # 配置 ApiErrorLogMapper 的日志级别为 info,避免和 GlobalExceptionHandler 重复打印 + com.njcn.msgpush.module.system.dal.mysql.file.FileConfigMapper: INFO # 配置 FileConfigMapper 的日志级别为 info + org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # 灿能配置项,设置当前项目所有自定义的配置 msgpush: env: # 多环境的配置项 tag: ${HOSTNAME} captcha: - enable: false # 本地环境,暂时关闭图片验证码,方便登录等接口的测试 + enable: false security: - mock-enable: true # 开启安全模拟,方便本地测试(跳过部分校验) + mock-enable: true access-log: # 访问日志的配置项 enable: true - - - diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/application.yaml b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/application.yaml similarity index 62% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/application.yaml rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/application.yaml index 81a9f57..20fda09 100644 --- a/msgpush-module-system/msgpush-module-system-server/src/main/resources/application.yaml +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/application.yaml @@ -1,6 +1,6 @@ -spring: +spring: application: - name: system-server + name: msgpush-system-server profiles: active: local main: @@ -28,20 +28,19 @@ spring: type: REDIS redis: time-to-live: 1h # 设置过期时间为 1 小时 - # Spring Data Redis 配置 data: redis: repositories: enabled: false # 项目未使用到 Spring Data Redis 的 Repository,所以直接禁用,保证启动速度 - server: port: 48081 logging: file: name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径 -# 接口文档配置 +--- #################### 接口文档配置 #################### + springdoc: api-docs: enabled: true # 1. 是否开启 Swagger 接文档的元数据 @@ -61,16 +60,16 @@ mybatis-plus: map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。 global-config: db-config: - id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。 + id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,使用雪花算法时,需要去除实体类上的 @KeySequence 注解 + # id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。 # id-type: AUTO # 自增 ID,适合 MySQL 等直接自增的数据库 # id-type: INPUT # 用户输入 ID,适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库 - # id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解 logic-delete-value: 1 # 逻辑已删除值(默认为 1) logic-not-delete-value: 0 # 逻辑未删除值(默认为 0) banner: false # 关闭控制台的 Banner 打印 type-aliases-package: ${msgpush.info.base-package}.dal.dataobject encryptor: - password: XDV71a+xqStEA3WH # 加解密的秘钥,可使用 https://www.imaegoo.com/2020/aes-key-generator/ 网站生成 + password: cDHvwsYb9eyLNBHp # 加解密的秘钥,可使用 https://www.imaegoo.com/2020/aes-key-generator/ 网站生成。数据库存密文,业务代码透明拿到明文(@EncryptField 注解字段自动加解密)。秘钥一旦变更,历史密文将无法解密,生产环境务必通过 Nacos 注入,切勿硬编码。 mybatis-plus-join: banner: false # 关闭控制台的 Banner 打印 @@ -108,7 +107,7 @@ msgpush: base-package: com.njcn.msgpush.module.system web: admin-ui: - url: http://localhost # Admin 管理后台 UI 的地址 + url: https://www.baidu.com # Admin 管理后台 UI 的地址,等项目开发完毕后,切换到实际的前端访问地址 xss: enable: false exclude-urls: # 如下 url,仅仅是为了演示,去掉配置也没关系 @@ -117,6 +116,13 @@ msgpush: title: 管理后台 description: 提供管理员管理的所有功能 version: ${msgpush.info.version} - + websocket: + enable: true # 是否开启 WebSocket + path: /system/ws # WebSocket 路径 + api-encrypt: + enable: true # 启用密码相关接口的请求解密能力 + header: X-Api-Encrypt # 请求加密标记头 + algorithm: RSA # 密码相关接口的请求体采用 RSA 非对称加密 + request-key: 'MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC/aShtWjlpINa+ZZkgp4sbt2jA4tPCN1YjDLv5SZMHDd7q8lbkE0SOudbuSKp5P3tVCPZXowyZom5+l56AAIYCaG5OcbzeRUtB6JcvmuU9SZ008zw7z2BIzeIzMtJSGf6u8BocVeMo27bGyyh1ifUXbpKVU7V7DBLzYADAQ9Jqi0vsqrxDGDu+Zm3LpFwSOnv85pgC0d+9re57CIYynXVmTLAo+V5DedPsceNCAByRs1kUyFMwyoPNbmgjcpKbewD6laxR9GtnFR/bCzfnz8Up7ANtuHCPe7vfU1teU75ZR+/cW9t2GS1e1T/XkULRv5PH5gchSGQ1NHO4imIbv5dzAgMBAAECggEACTjSS051BKUh44N2mLWpxJiWEfD7vdg3rLGg3tZWIJlg+5XYbN2myG+YtNtIZ1YRJZwsbjV7Vm2WgD/i0Yz05+nLIrllHZpeEVtY6WC/ma/RxKrRZJpNq8RLmSbiLjV1aU1FHMdgjefkCvjfxqXyaoIXyt0BGeAPi6087AZ4fUyKVYgPyGr53RnD8+4nCDaRhZYMCv6zpb+YVF3llZZNhvK7+hDLZX0WhUgIAzStzFsPZhDfJxW8MQFB4FNtmnJ4kpInkgIAROlfVvKIwRKwoCH+sveGjYdlZR/wTYt6HQoKudG9Qx2IssUcVGFwAsCiWM+81rfBDd5pMUwzyGQ9OQKBgQDHOp7Eio4M6LaPO1Uz6Ozlp28evWBVPaU+wk50p5SQl//pF0VgDkmrrt3Wu9IppBL6VObIzjOsZJrEVHXheA/1qqOVYm/m6nel1EUAqbIqxREtw+GJPoKp3Ql1CxK6pvm/KxOhJvCDIUNCZ4in+rvsCvquF784iIbQ33ED3hWi2wKBgQD19DbAL1Y6/XHXX17t6yZJVsIijmSOo5tjeNHouOSP5emgc8i2ESaW4WPIzkgi7EJ2aertgUkwIOpunYvMWYfn6zrYNaSuvCCZF+6oIiYPPXEVZJTnzGA/KsJtHeH6xtiGuettw6RnPxXvNZibJhfLdOqQvZmRDRTXh/MiRuelSQKBgQC154IbNd7pTnmRYb0zvlK+hRfiW0rfyX9dRBBaVsBBHWedrY+8Wo9NYEZQ0ADd4F8rjeWCJzPrDZh59hwDl5oK1pixxsUhc6d3E89FAawZfQFoZddBdn/bFGSUJ14camTR9UTg+SrUr8Q3l0yhA0AeDxA/cJM5zP47LCiGPXpHzQKBgQDV00sGKiE9h7nBFBjjntvaRqLgiArEN1iQUimruZJ7x9YkuIR2RNLXuXuWyD/OnLfrWonzkcKfJP6qzC0Nq4iMB+VQstJJVyS/9B537bhI55G4l4kdPIEwaWw+kQw1iUoVVu1mr//uAtp+7ImP2L43E54Z17v6bvT/rCGkWyBogQKBgQC6pqnciYteAE5KmWnPM9LWoEorSBPCzbWCVwuja7NbVoADUPvAnUeDgvKs8KpWvL+X3eRGSZXOBqjBMsdDPBnQzr5yZCI3Mv6Svg9RxBfuWw1mF1w2GAwK1r7+6ZDwxFqRUiVUACRRJ8S1kBa+CvNWm7UFi/7V1D4UDyKKmBU6Sw==' debug: false diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/resources/file/erweima.jpg b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/file/erweima.jpg similarity index 100% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/resources/file/erweima.jpg rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/file/erweima.jpg diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/original/bg1.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/original/bg1.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/original/bg1.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/original/bg1.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/original/bg2.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/original/bg2.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/original/bg2.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/original/bg2.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/original/bg3.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/original/bg3.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/original/bg3.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/original/bg3.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/original/bg4.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/original/bg4.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/original/bg4.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/original/bg4.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/original/bg5.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/original/bg5.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/original/bg5.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/original/bg5.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/original/bg6.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/original/bg6.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/original/bg6.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/original/bg6.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/original/bg7.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/original/bg7.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/original/bg7.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/original/bg7.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/original/bg8.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/original/bg8.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/original/bg8.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/original/bg8.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/original/bg9.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/original/bg9.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/original/bg9.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/original/bg9.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/1.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/1.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/1.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/1.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/11/10.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/11/10.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/11/10.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/11/10.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/11/11.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/11/11.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/11/11.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/11/11.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/11/12.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/11/12.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/11/12.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/11/12.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/11/13.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/11/13.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/11/13.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/11/13.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/11/14.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/11/14.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/11/14.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/11/14.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/11/15.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/11/15.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/11/15.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/11/15.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/11/16.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/11/16.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/11/16.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/11/16.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/11/17.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/11/17.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/11/17.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/11/17.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/11/18.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/11/18.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/11/18.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/11/18.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/11/19.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/11/19.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/11/19.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/11/19.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/11/8.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/11/8.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/11/8.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/11/8.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/11/9.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/11/9.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/11/9.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/11/9.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/2.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/2.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/2.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/2.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/3.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/3.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/3.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/3.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/4.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/4.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/jigsaw/slidingBlock/4.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/jigsaw/slidingBlock/4.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/pic-click/bg1.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/pic-click/bg1.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/pic-click/bg1.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/pic-click/bg1.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/pic-click/bg10.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/pic-click/bg10.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/pic-click/bg10.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/pic-click/bg10.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/pic-click/bg2.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/pic-click/bg2.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/pic-click/bg2.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/pic-click/bg2.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/pic-click/bg3.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/pic-click/bg3.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/pic-click/bg3.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/pic-click/bg3.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/pic-click/bg4.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/pic-click/bg4.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/pic-click/bg4.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/pic-click/bg4.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/pic-click/bg5.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/pic-click/bg5.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/pic-click/bg5.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/pic-click/bg5.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/pic-click/bg6.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/pic-click/bg6.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/pic-click/bg6.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/pic-click/bg6.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/pic-click/bg7.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/pic-click/bg7.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/pic-click/bg7.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/pic-click/bg7.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/pic-click/bg8.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/pic-click/bg8.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/pic-click/bg8.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/pic-click/bg8.png diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/images/pic-click/bg9.png b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/pic-click/bg9.png similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/images/pic-click/bg9.png rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/images/pic-click/bg9.png diff --git a/msgpush-module-infra/msgpush-module-infra-server/src/main/resources/logback-spring.xml b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/logback-spring.xml similarity index 83% rename from msgpush-module-infra/msgpush-module-infra-server/src/main/resources/logback-spring.xml rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/logback-spring.xml index 15b28cf..7a49046 100644 --- a/msgpush-module-infra/msgpush-module-infra-server/src/main/resources/logback-spring.xml +++ b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/logback-spring.xml @@ -34,16 +34,6 @@ - - diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/META-INF/services/com.anji.captcha.service.CaptchaCacheService b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/services/com.anji.captcha.service.CaptchaCacheService similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/META-INF/services/com.anji.captcha.service.CaptchaCacheService rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/services/com.anji.captcha.service.CaptchaCacheService diff --git a/msgpush-module-system/msgpush-module-system-server/src/main/resources/META-INF/services/com.anji.captcha.service.CaptchaService b/msgpush-module-system/msgpush-module-system-boot/src/main/resources/services/com.anji.captcha.service.CaptchaService similarity index 100% rename from msgpush-module-system/msgpush-module-system-server/src/main/resources/META-INF/services/com.anji.captcha.service.CaptchaService rename to msgpush-module-system/msgpush-module-system-boot/src/main/resources/services/com.anji.captcha.service.CaptchaService diff --git a/msgpush-module-system/pom.xml b/msgpush-module-system/pom.xml index 96a8f67..da47990 100644 --- a/msgpush-module-system/pom.xml +++ b/msgpush-module-system/pom.xml @@ -27,11 +27,5 @@ 17 UTF-8 - - - com.njcn - msgpush-common - - \ No newline at end of file