From 1943e71e3fb418ef0c496151e837ecc69f263f46 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 28 Jan 2023 22:59:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=99=E5=86=85=E4=BF=A1=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=EF=BC=9A=E5=AE=8C=E5=96=84=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/notify/NotifyMessageSendApi.java | 8 ++--- .../api/notify/NotifyMessageSendApiImpl.java | 32 ++++++++----------- .../dal/mysql/notify/NotifyMessageMapper.java | 2 +- .../src/layout/components/Message/index.vue | 2 +- .../src/views/system/notify/message/index.vue | 2 +- .../src/views/system/notify/my/index.vue | 2 ++ .../views/system/notify/template/index.vue | 10 +++--- .../src/views/system/oauth2/client/index.vue | 1 + .../src/views/system/oauth2/token/index.vue | 2 ++ 9 files changed, 29 insertions(+), 32 deletions(-) diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/notify/NotifyMessageSendApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/notify/NotifyMessageSendApi.java index b5885e7ef..facedfade 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/notify/NotifyMessageSendApi.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/notify/NotifyMessageSendApi.java @@ -13,21 +13,17 @@ public interface NotifyMessageSendApi { /** * 发送单条站内信给 Admin 用户 - *

- * 在 mobile 为空时,使用 userId 加载对应 Admin 的手机号 * * @param reqDTO 发送请求 - * @return 发送消息ID + * @return 发送消息 ID */ Long sendSingleMessageToAdmin(@Valid NotifySendSingleToUserReqDTO reqDTO); /** * 发送单条站内信给 Member 用户 - *

- * 在 mobile 为空时,使用 userId 加载对应 Member 的手机号 * * @param reqDTO 发送请求 - * @return 发送消息ID + * @return 发送消息 ID */ Long sendSingleMessageToMember(@Valid NotifySendSingleToUserReqDTO reqDTO); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/notify/NotifyMessageSendApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/notify/NotifyMessageSendApiImpl.java index 6861ff8c5..fc5ba1d12 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/notify/NotifyMessageSendApiImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/notify/NotifyMessageSendApiImpl.java @@ -1,39 +1,33 @@ package cn.iocoder.yudao.module.system.api.notify; import cn.iocoder.yudao.module.system.api.notify.dto.NotifySendSingleToUserReqDTO; +import cn.iocoder.yudao.module.system.service.notify.NotifyMessageService; +import cn.iocoder.yudao.module.system.service.notify.NotifySendService; import org.springframework.stereotype.Service; +import javax.annotation.Resource; + /** - * 站内信发送 API 接口 + * 站内信发送 API 实现类 * * @author xrcoder */ @Service public class NotifyMessageSendApiImpl implements NotifyMessageSendApi { - /** - * 发送单条站内信给 Admin 用户 - *

- * 在 mobile 为空时,使用 userId 加载对应 Admin 的手机号 - * - * @param reqDTO 发送请求 - * @return 发送消息ID - */ + @Resource + private NotifySendService notifySendService; + @Override public Long sendSingleMessageToAdmin(NotifySendSingleToUserReqDTO reqDTO) { - return null; + return notifySendService.sendSingleNotifyToAdmin(reqDTO.getUserId(), + reqDTO.getTemplateCode(), reqDTO.getTemplateParams()); } - /** - * 发送单条站内信给 Member 用户 - *

- * 在 mobile 为空时,使用 userId 加载对应 Member 的手机号 - * - * @param reqDTO 发送请求 - * @return 发送消息ID - */ @Override public Long sendSingleMessageToMember(NotifySendSingleToUserReqDTO reqDTO) { - return null; + return notifySendService.sendSingleNotifyToMember(reqDTO.getUserId(), + reqDTO.getTemplateCode(), reqDTO.getTemplateParams()); } + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/notify/NotifyMessageMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/notify/NotifyMessageMapper.java index 52e2c641e..e9ce6d719 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/notify/NotifyMessageMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/notify/NotifyMessageMapper.java @@ -28,7 +28,7 @@ public interface NotifyMessageMapper extends BaseMapperX { default PageResult selectPage(NotifyMessageMyPageReqVO reqVO, Long userId, Integer userType) { return selectPage(reqVO, new LambdaQueryWrapperX() - .eq(NotifyMessageDO::getReadStatus, reqVO.getReadStatus()) + .eqIfPresent(NotifyMessageDO::getReadStatus, reqVO.getReadStatus()) .betweenIfPresent(NotifyMessageDO::getCreateTime, reqVO.getCreateTime()) .eq(NotifyMessageDO::getUserId, userId) .eq(NotifyMessageDO::getUserType, userType) diff --git a/yudao-ui-admin/src/layout/components/Message/index.vue b/yudao-ui-admin/src/layout/components/Message/index.vue index 1d40b8caa..347242cbe 100644 --- a/yudao-ui-admin/src/layout/components/Message/index.vue +++ b/yudao-ui-admin/src/layout/components/Message/index.vue @@ -8,7 +8,7 @@ - +