|
|
|
@ -1,5 +1,6 @@
|
|
|
|
package cn.iocoder.yudao.module.system.controller.admin.notify;
|
|
|
|
package cn.iocoder.yudao.module.system.controller.admin.notify;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
import cn.iocoder.yudao.module.system.controller.admin.notify.vo.template.*;
|
|
|
|
import cn.iocoder.yudao.module.system.controller.admin.notify.vo.template.*;
|
|
|
|
@ -7,9 +8,9 @@ import cn.iocoder.yudao.module.system.convert.notify.NotifyTemplateConvert;
|
|
|
|
import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyTemplateDO;
|
|
|
|
import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyTemplateDO;
|
|
|
|
import cn.iocoder.yudao.module.system.service.notify.NotifySendService;
|
|
|
|
import cn.iocoder.yudao.module.system.service.notify.NotifySendService;
|
|
|
|
import cn.iocoder.yudao.module.system.service.notify.NotifyTemplateService;
|
|
|
|
import cn.iocoder.yudao.module.system.service.notify.NotifyTemplateService;
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
|
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
|
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
|
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
|
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
@ -76,8 +77,13 @@ public class NotifyTemplateController {
|
|
|
|
@Operation(summary = "发送站内信")
|
|
|
|
@Operation(summary = "发送站内信")
|
|
|
|
@PreAuthorize("@ss.hasPermission('system:notify-template:send-notify')")
|
|
|
|
@PreAuthorize("@ss.hasPermission('system:notify-template:send-notify')")
|
|
|
|
public CommonResult<Long> sendNotify(@Valid @RequestBody NotifyTemplateSendReqVO sendReqVO) {
|
|
|
|
public CommonResult<Long> sendNotify(@Valid @RequestBody NotifyTemplateSendReqVO sendReqVO) {
|
|
|
|
|
|
|
|
if (UserTypeEnum.MEMBER.getValue().equals(sendReqVO.getUserType())) {
|
|
|
|
|
|
|
|
return success(notifySendService.sendSingleNotifyToMember(sendReqVO.getUserId(),
|
|
|
|
|
|
|
|
sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams()));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
return success(notifySendService.sendSingleNotifyToAdmin(sendReqVO.getUserId(),
|
|
|
|
return success(notifySendService.sendSingleNotifyToAdmin(sendReqVO.getUserId(),
|
|
|
|
sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams()));
|
|
|
|
sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|