Commit 8fd814e0c1a3e89259e5f3b2b90ae01176c7f64d

Authored by 芋道源码
Committed by Gitee
2 parents 3110e427 5a5f92d2

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

Merge pull request !636 from 风狗/feature/mall_product
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/NotifyTemplateController.java
1 1 package cn.iocoder.yudao.module.system.controller.admin.notify;
2 2  
  3 +import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
3 4 import cn.iocoder.yudao.framework.common.pojo.CommonResult;
4 5 import cn.iocoder.yudao.framework.common.pojo.PageResult;
5 6 import cn.iocoder.yudao.module.system.controller.admin.notify.vo.template.*;
... ... @@ -76,8 +77,12 @@ public class NotifyTemplateController {
76 77 @Operation(summary = "发送站内信")
77 78 @PreAuthorize("@ss.hasPermission('system:notify-template:send-notify')")
78 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 15 @NotNull(message = "用户id不能为空")
16 16 private Long userId;
17 17  
  18 + @Schema(description = "用户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
  19 + @NotNull(message = "用户类型不能为空")
  20 + private Integer userType;
  21 +
18 22 @Schema(description = "模板编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "01")
19 23 @NotEmpty(message = "模板编码不能为空")
20 24 private String templateCode;
... ...