mirror of
https://gitee.com/xiaonuobase/snowy.git
synced 2026-10-06 06:52:58 +08:00
【底座】短信、邮件、消息、推送四个控制器的发送接口加上CommonNoRepeat注解,对接口限流,重复提交提示请求过于频繁,防止短信/邮件炸弹,满足安全性
This commit is contained in:
@@ -59,7 +59,8 @@
|
||||
// 默认要校验的
|
||||
const formRules = {
|
||||
subject: [required('请输入主题')],
|
||||
category: [required('请选择站内信分类')]
|
||||
category: [required('请选择站内信分类')],
|
||||
receiverIdList: [required('请选择接收人')],
|
||||
}
|
||||
// 站内信分类字典
|
||||
const categoryOptions = tool.dictList('MESSAGE_CATEGORY')
|
||||
|
||||
+11
@@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import vip.xiaonuo.common.annotation.CommonLog;
|
||||
import vip.xiaonuo.common.annotation.CommonNoRepeat;
|
||||
import vip.xiaonuo.common.pojo.CommonResult;
|
||||
import vip.xiaonuo.dev.modular.email.entity.DevEmail;
|
||||
import vip.xiaonuo.dev.modular.email.param.*;
|
||||
@@ -53,6 +54,7 @@ public class DevEmailController {
|
||||
*/
|
||||
@Operation(summary = "动态发送TXT邮件")
|
||||
@CommonLog("动态发送TXT邮件")
|
||||
@CommonNoRepeat
|
||||
@PostMapping("/dev/email/sendDynamicTxt")
|
||||
public CommonResult<String> sendDynamic(@RequestBody @Valid DevEmailSendDynamicTxtParam devEmailSendDynamicTxtParam) {
|
||||
devEmailService.sendDynamicTxt(devEmailSendDynamicTxtParam);
|
||||
@@ -67,6 +69,7 @@ public class DevEmailController {
|
||||
*/
|
||||
@Operation(summary = "动态发送HTML邮件")
|
||||
@CommonLog("动态发送HTML邮件")
|
||||
@CommonNoRepeat
|
||||
@PostMapping("/dev/email/sendDynamicHtml")
|
||||
public CommonResult<String> sendDynamic(@RequestBody @Valid DevEmailSendDynamicHtmlParam devEmailSendDynamicHtmlParam) {
|
||||
devEmailService.sendDynamicHtml(devEmailSendDynamicHtmlParam);
|
||||
@@ -81,6 +84,7 @@ public class DevEmailController {
|
||||
*/
|
||||
@Operation(summary = "发送本地文本邮件")
|
||||
@CommonLog("发送本地文本邮件")
|
||||
@CommonNoRepeat
|
||||
@PostMapping("/dev/email/sendLocalTxt")
|
||||
public CommonResult<String> sendLocal(@RequestBody @Valid DevEmailSendLocalTxtParam devEmailSendLocalTxtParam) {
|
||||
devEmailService.sendLocal(devEmailSendLocalTxtParam);
|
||||
@@ -95,6 +99,7 @@ public class DevEmailController {
|
||||
*/
|
||||
@Operation(summary = "发送本地HTML邮件")
|
||||
@CommonLog("发送本地HTML邮件")
|
||||
@CommonNoRepeat
|
||||
@PostMapping("/dev/email/sendLocalHtml")
|
||||
public CommonResult<String> sendLocal(@RequestBody @Valid DevEmailSendLocalHtmlParam devEmailSendLocalHtmlParam) {
|
||||
devEmailService.sendLocal(devEmailSendLocalHtmlParam);
|
||||
@@ -109,6 +114,7 @@ public class DevEmailController {
|
||||
*/
|
||||
@Operation(summary = "发送阿里云文本邮件")
|
||||
@CommonLog("发送阿里云文本邮件")
|
||||
@CommonNoRepeat
|
||||
@PostMapping("/dev/email/sendAliyunTxt")
|
||||
public CommonResult<String> sendAliyun(@RequestBody @Valid DevEmailSendAliyunTxtParam devEmailSendAliyunTxtParam) {
|
||||
devEmailService.sendAliyun(devEmailSendAliyunTxtParam);
|
||||
@@ -123,6 +129,7 @@ public class DevEmailController {
|
||||
*/
|
||||
@Operation(summary = "发送阿里云HTML邮件")
|
||||
@CommonLog("发送阿里云HTML邮件")
|
||||
@CommonNoRepeat
|
||||
@PostMapping("/dev/email/sendAliyunHtml")
|
||||
public CommonResult<String> sendAliyun(@RequestBody @Valid DevEmailSendAliyunHtmlParam devEmailSendAliyunHtmlParam) {
|
||||
devEmailService.sendAliyun(devEmailSendAliyunHtmlParam);
|
||||
@@ -137,6 +144,7 @@ public class DevEmailController {
|
||||
*/
|
||||
@Operation(summary = "发送阿里云模板邮件")
|
||||
@CommonLog("发送阿里云模板邮件")
|
||||
@CommonNoRepeat
|
||||
@PostMapping("/dev/email/sendAliyunTmp")
|
||||
public CommonResult<String> sendAliyun(@RequestBody @Valid DevEmailSendAliyunTmpParam devEmailSendAliyunTmpParam) {
|
||||
devEmailService.sendAliyun(devEmailSendAliyunTmpParam);
|
||||
@@ -151,6 +159,7 @@ public class DevEmailController {
|
||||
*/
|
||||
@Operation(summary = "发送腾讯云文本邮件")
|
||||
@CommonLog("发送腾讯云文本邮件")
|
||||
@CommonNoRepeat
|
||||
@PostMapping("/dev/email/sendTencentTxt")
|
||||
public CommonResult<String> sendTencent(@RequestBody @Valid DevEmailSendTencentTxtParam devEmailSendTencentTxtParam) {
|
||||
devEmailService.sendTencent(devEmailSendTencentTxtParam);
|
||||
@@ -165,6 +174,7 @@ public class DevEmailController {
|
||||
*/
|
||||
@Operation(summary = "发送腾讯云HTML邮件")
|
||||
@CommonLog("发送腾讯云HTML邮件")
|
||||
@CommonNoRepeat
|
||||
@PostMapping("/dev/email/sentTencentHtml")
|
||||
public CommonResult<String> sendTencent(@RequestBody @Valid DevEmailSendTencentHtmlParam devEmailSendTencentHtmlParam) {
|
||||
devEmailService.sendTencent(devEmailSendTencentHtmlParam);
|
||||
@@ -179,6 +189,7 @@ public class DevEmailController {
|
||||
*/
|
||||
@Operation(summary = "发送腾讯云模板邮件")
|
||||
@CommonLog("发送腾讯云模板邮件")
|
||||
@CommonNoRepeat
|
||||
@PostMapping("/dev/email/sentTencentTmp")
|
||||
public CommonResult<String> sendTencent(@RequestBody @Valid DevEmailSendTencentTmpParam devEmailSendTencentTmpParam) {
|
||||
devEmailService.sendTencent(devEmailSendTencentTmpParam);
|
||||
|
||||
+2
@@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import vip.xiaonuo.common.annotation.CommonLog;
|
||||
import vip.xiaonuo.common.annotation.CommonNoRepeat;
|
||||
import vip.xiaonuo.common.pojo.CommonResult;
|
||||
import vip.xiaonuo.dev.modular.message.entity.DevMessage;
|
||||
import vip.xiaonuo.dev.modular.message.param.DevMessageIdParam;
|
||||
@@ -56,6 +57,7 @@ public class DevMessageController {
|
||||
*/
|
||||
@Operation(summary = "发送站内信")
|
||||
@CommonLog("发送站内信")
|
||||
@CommonNoRepeat
|
||||
@PostMapping("/dev/message/send")
|
||||
public CommonResult<String> send(@RequestBody @Valid DevMessageSendParam devMessageSendParam) {
|
||||
devMessageService.send(devMessageSendParam);
|
||||
|
||||
+9
@@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import vip.xiaonuo.common.annotation.CommonLog;
|
||||
import vip.xiaonuo.common.annotation.CommonNoRepeat;
|
||||
import vip.xiaonuo.common.pojo.CommonResult;
|
||||
import vip.xiaonuo.dev.modular.push.entity.DevPush;
|
||||
import vip.xiaonuo.dev.modular.push.param.*;
|
||||
@@ -53,6 +54,7 @@ public class DevPushController {
|
||||
*/
|
||||
@Operation(summary = "动态推送TEXT消息")
|
||||
@CommonLog("动态推送TEXT消息")
|
||||
@CommonNoRepeat
|
||||
@PostMapping("/dev/push/pushDynamicText")
|
||||
public CommonResult<String> pushDynamicText(@RequestBody @Valid DevPushDynamicTextParam devPushDynamicTextParam) {
|
||||
devPushService.pushDynamicText(devPushDynamicTextParam);
|
||||
@@ -67,6 +69,7 @@ public class DevPushController {
|
||||
*/
|
||||
@Operation(summary = "推送飞书TEXT消息")
|
||||
@CommonLog("推送飞书TEXT消息")
|
||||
@CommonNoRepeat
|
||||
@PostMapping("/dev/push/pushFeiShuText")
|
||||
public CommonResult<String> pushFeiShuText(@RequestBody @Valid DevPushFeiShuTextParam devPushFeiShuTextParam) {
|
||||
devPushService.pushFeiShuText(devPushFeiShuTextParam);
|
||||
@@ -81,6 +84,7 @@ public class DevPushController {
|
||||
*/
|
||||
@Operation(summary = "推送钉钉TEXT消息")
|
||||
@CommonLog("推送钉钉TEXT消息")
|
||||
@CommonNoRepeat
|
||||
@PostMapping("/dev/push/pushDingTalkText")
|
||||
public CommonResult<String> pushDingTalkText(@RequestBody @Valid DevPushDingTalkTextParam devPushDingTalkTextParam) {
|
||||
devPushService.pushDingTalkText(devPushDingTalkTextParam);
|
||||
@@ -95,6 +99,7 @@ public class DevPushController {
|
||||
*/
|
||||
@Operation(summary = "推送钉钉MARKDOWN消息")
|
||||
@CommonLog("推送钉钉MARKDOWN消息")
|
||||
@CommonNoRepeat
|
||||
@PostMapping("/dev/push/pushDingTalkMarkdown")
|
||||
public CommonResult<String> pushDingTalkMarkdown(@RequestBody @Valid DevPushDingTalkMarkdownParam devPushDingTalkMarkdownParam) {
|
||||
devPushService.pushDingTalkMarkdown(devPushDingTalkMarkdownParam);
|
||||
@@ -109,6 +114,7 @@ public class DevPushController {
|
||||
*/
|
||||
@Operation(summary = "推送钉钉LINK消息")
|
||||
@CommonLog("推送钉钉LINK消息")
|
||||
@CommonNoRepeat
|
||||
@PostMapping("/dev/push/pushDingTalkLink")
|
||||
public CommonResult<String> pushDingTalkLink(@RequestBody @Valid DevPushDingTalkLinkParam devPushDingTalkLinkParam) {
|
||||
devPushService.pushDingTalkLink(devPushDingTalkLinkParam);
|
||||
@@ -123,6 +129,7 @@ public class DevPushController {
|
||||
*/
|
||||
@Operation(summary = "推送企业微信TEXT消息")
|
||||
@CommonLog("推送企业微信TEXT消息")
|
||||
@CommonNoRepeat
|
||||
@PostMapping("/dev/push/pushWorkWechatText")
|
||||
public CommonResult<String> pushWorkWechatText(@RequestBody @Valid DevPushWorkWechatTextParam devPushWorkWechatTextParam) {
|
||||
devPushService.pushWorkWechatText(devPushWorkWechatTextParam);
|
||||
@@ -137,6 +144,7 @@ public class DevPushController {
|
||||
*/
|
||||
@Operation(summary = "推送企业微信MARKDOWN消息")
|
||||
@CommonLog("推送企业微信MARKDOWN消息")
|
||||
@CommonNoRepeat
|
||||
@PostMapping("/dev/push/pushWorkWechatMarkdown")
|
||||
public CommonResult<String> pushWorkWechatMarkdown(@RequestBody @Valid DevPushWorkWechatMarkdownParam devPushWorkWechatMarkdownParam) {
|
||||
devPushService.pushWorkWechatMarkdown(devPushWorkWechatMarkdownParam);
|
||||
@@ -151,6 +159,7 @@ public class DevPushController {
|
||||
*/
|
||||
@Operation(summary = "推送企业微信NEWS消息")
|
||||
@CommonLog("推送企业微信NEWS消息")
|
||||
@CommonNoRepeat
|
||||
@PostMapping("/dev/push/pushWorkWechatNews")
|
||||
public CommonResult<String> pushWorkWechatNews(@RequestBody @Valid DevPushWorkWechatNewsParam devPushWorkWechatNewsParam) {
|
||||
devPushService.pushWorkWechatNews(devPushWorkWechatNewsParam);
|
||||
|
||||
+4
@@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import vip.xiaonuo.common.annotation.CommonLog;
|
||||
import vip.xiaonuo.common.annotation.CommonNoRepeat;
|
||||
import vip.xiaonuo.common.pojo.CommonResult;
|
||||
import vip.xiaonuo.dev.modular.sms.entity.DevSms;
|
||||
import vip.xiaonuo.dev.modular.sms.param.*;
|
||||
@@ -53,6 +54,7 @@ public class DevSmsController {
|
||||
*/
|
||||
@Operation(summary = "动态发送短信")
|
||||
@CommonLog("动态发送短信")
|
||||
@CommonNoRepeat
|
||||
@PostMapping("/dev/sms/sendDynamic")
|
||||
public CommonResult<String> sendDynamic(@RequestBody @Valid DevSmsSendDynamicParam devSmsSendDynamicParam) {
|
||||
devSmsService.sendDynamic(devSmsSendDynamicParam);
|
||||
@@ -67,6 +69,7 @@ public class DevSmsController {
|
||||
*/
|
||||
@Operation(summary = "发送阿里云短信")
|
||||
@CommonLog("发送阿里云短信")
|
||||
@CommonNoRepeat
|
||||
@PostMapping("/dev/sms/sendAliyun")
|
||||
public CommonResult<String> sendAliyun(@RequestBody @Valid DevSmsSendAliyunParam devSmsSendAliyunParam) {
|
||||
devSmsService.sendAliyun(devSmsSendAliyunParam);
|
||||
@@ -81,6 +84,7 @@ public class DevSmsController {
|
||||
*/
|
||||
@Operation(summary = "发送腾讯云短信")
|
||||
@CommonLog("发送腾讯云短信")
|
||||
@CommonNoRepeat
|
||||
@PostMapping("/dev/sms/sendTencent")
|
||||
public CommonResult<String> sendTencent(@RequestBody @Valid DevSmsSendTencentParam devSmsSendTencentParam) {
|
||||
devSmsService.sendTencent(devSmsSendTencentParam);
|
||||
|
||||
Reference in New Issue
Block a user