Commit 5a5f92d2e9e158665f99a46735c9aef532a7a065

Authored by 绮梦
1 parent 437185cb

feat: 测试站内信接口增加Member 用户类型的支持。

yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/NotifyTemplateController.java
1 package cn.iocoder.yudao.module.system.controller.admin.notify; 1 package cn.iocoder.yudao.module.system.controller.admin.notify;
2 2
  3 +import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
3 import cn.iocoder.yudao.framework.common.pojo.CommonResult; 4 import cn.iocoder.yudao.framework.common.pojo.CommonResult;
4 import cn.iocoder.yudao.framework.common.pojo.PageResult; 5 import cn.iocoder.yudao.framework.common.pojo.PageResult;
5 import cn.iocoder.yudao.module.system.controller.admin.notify.vo.template.*; 6 import cn.iocoder.yudao.module.system.controller.admin.notify.vo.template.*;
@@ -76,8 +77,12 @@ public class NotifyTemplateController { @@ -76,8 +77,12 @@ public class NotifyTemplateController {
76 @Operation(summary = "发送站内信") 77 @Operation(summary = "发送站内信")
77 @PreAuthorize("@ss.hasPermission('system:notify-template:send-notify')") 78 @PreAuthorize("@ss.hasPermission('system:notify-template:send-notify')")
78 public CommonResult<Long> sendNotify(@Valid @RequestBody NotifyTemplateSendReqVO sendReqVO) { 79 public CommonResult<Long> sendNotify(@Valid @RequestBody NotifyTemplateSendReqVO sendReqVO) {
79 - return success(notifySendService.sendSingleNotifyToAdmin(sendReqVO.getUserId(),  
80 - sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams())); 80 + if (UserTypeEnum.MEMBER.getValue().equals(sendReqVO.getUserType())) {
  81 + return success(notifySendService.sendSingleNotifyToMember(sendReqVO.getUserId(),
  82 + sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams()));
  83 + } else {
  84 + return success(notifySendService.sendSingleNotifyToAdmin(sendReqVO.getUserId(),
  85 + sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams()));
  86 + }
81 } 87 }
82 -  
83 } 88 }
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateSendReqVO.java
@@ -15,6 +15,10 @@ public class NotifyTemplateSendReqVO { @@ -15,6 +15,10 @@ public class NotifyTemplateSendReqVO {
15 @NotNull(message = "用户id不能为空") 15 @NotNull(message = "用户id不能为空")
16 private Long userId; 16 private Long userId;
17 17
  18 + @Schema(description = "用户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
  19 + @NotNull(message = "用户类型不能为空")
  20 + private Integer userType;
  21 +
18 @Schema(description = "模板编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "01") 22 @Schema(description = "模板编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "01")
19 @NotEmpty(message = "模板编码不能为空") 23 @NotEmpty(message = "模板编码不能为空")
20 private String templateCode; 24 private String templateCode;