From 583cb9388aa3e012b7dbbdab69018f219f39a0cc Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 25 Nov 2022 21:07:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E4=BA=91=E7=89=87=E7=9F=AD?= =?UTF-8?q?=E4=BF=A1=E6=B8=A0=E9=81=93=EF=BC=8C=E8=A7=A3=E5=86=B3=E4=BA=91?= =?UTF-8?q?=E7=89=87=E7=9A=84=E5=AE=89=E5=85=A8=E9=A3=8E=E9=99=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao-spring-boot-starter-biz-sms/pom.xml | 2 +- .../core/client/impl/SmsClientFactoryImpl.java | 2 -- .../framework/sms/core/enums/SmsChannelEnum.java | 1 - .../enums/SmsFrameworkErrorCodeConstants.java | 1 - .../admin/sms/SmsCallbackController.java | 11 ----------- .../service/sms/SmsServiceIntegrationTest.java | 16 ---------------- 归档/mall-dependencies/pom.xml | 8 +------- 归档/moved/product/product-biz/pom.xml | 6 +----- 8 files changed, 3 insertions(+), 44 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/pom.xml b/yudao-framework/yudao-spring-boot-starter-biz-sms/pom.xml index 87a239437..97faba3b9 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/pom.xml @@ -12,7 +12,7 @@ jar ${project.artifactId} - 短信拓展,支持阿里云、云片、腾讯云 + 短信拓展,支持阿里云、腾讯云 https://github.com/YunaiV/ruoyi-vue-pro diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/SmsClientFactoryImpl.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/SmsClientFactoryImpl.java index eaaa4b27a..abb7dda1b 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/SmsClientFactoryImpl.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/SmsClientFactoryImpl.java @@ -5,7 +5,6 @@ import cn.iocoder.yudao.framework.sms.core.client.SmsClientFactory; import cn.iocoder.yudao.framework.sms.core.client.impl.aliyun.AliyunSmsClient; import cn.iocoder.yudao.framework.sms.core.client.impl.debug.DebugDingTalkSmsClient; import cn.iocoder.yudao.framework.sms.core.client.impl.tencent.TencentSmsClient; -import cn.iocoder.yudao.framework.sms.core.client.impl.yunpian.YunpianSmsClient; import cn.iocoder.yudao.framework.sms.core.enums.SmsChannelEnum; import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties; import lombok.extern.slf4j.Slf4j; @@ -80,7 +79,6 @@ public class SmsClientFactoryImpl implements SmsClientFactory { // 创建客户端 switch (channelEnum) { case ALIYUN: return new AliyunSmsClient(properties); - case YUN_PIAN: return new YunpianSmsClient(properties); case DEBUG_DING_TALK: return new DebugDingTalkSmsClient(properties); case TENCENT: return new TencentSmsClient(properties); } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/enums/SmsChannelEnum.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/enums/SmsChannelEnum.java index b1b386b98..66410bd2c 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/enums/SmsChannelEnum.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/enums/SmsChannelEnum.java @@ -15,7 +15,6 @@ import lombok.Getter; public enum SmsChannelEnum { DEBUG_DING_TALK("DEBUG_DING_TALK", "调试(钉钉)"), - YUN_PIAN("YUN_PIAN", "云片"), ALIYUN("ALIYUN", "阿里云"), TENCENT("TENCENT", "腾讯云"), // HUA_WEI("HUA_WEI", "华为云"), diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/enums/SmsFrameworkErrorCodeConstants.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/enums/SmsFrameworkErrorCodeConstants.java index 7af1dd21c..852f4e29b 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/enums/SmsFrameworkErrorCodeConstants.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/enums/SmsFrameworkErrorCodeConstants.java @@ -16,7 +16,6 @@ public interface SmsFrameworkErrorCodeConstants { // ========== 权限 / 限流等相关 2001000100 ========== ErrorCode SMS_PERMISSION_DENY = new ErrorCode(2001000100, "没有发送短信的权限"); - // 云片:可以配置 IP 白名单,只有在白名单中才可以发送短信 ErrorCode SMS_IP_DENY = new ErrorCode(2001000100, "IP 不允许发送短信"); // 阿里云:将短信发送频率限制在正常的业务限流范围内。默认短信验证码:使用同一签名,对同一个手机号验证码,支持 1 条 / 分钟,5 条 / 小时,累计 10 条 / 天。 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsCallbackController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsCallbackController.java index ed32e00cf..b717eb8d9 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsCallbackController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsCallbackController.java @@ -28,17 +28,6 @@ public class SmsCallbackController { @Resource private SmsSendService smsSendService; - @PostMapping("/yunpian") - @PermitAll - @ApiOperation(value = "云片短信的回调", notes = "参见 https://www.yunpian.com/official/document/sms/zh_cn/domestic_push_report 文档") - @ApiImplicitParam(name = "sms_status", value = "发送状态", required = true, example = "[{具体内容}]", dataTypeClass = String.class) - @OperateLog(enable = false) - public String receiveYunpianSmsStatus(@RequestParam("sms_status") String smsStatus) throws Throwable { - String text = URLUtil.decode(smsStatus); // decode 解码参数,因为它被 encode - smsSendService.receiveSmsStatus(SmsChannelEnum.YUN_PIAN.getCode(), text); - return "SUCCESS"; // 约定返回 SUCCESS 为成功 - } - @PostMapping("/aliyun") @PermitAll @ApiOperation(value = "阿里云短信的回调", notes = "参见 https://help.aliyun.com/document_detail/120998.html 文档") diff --git a/yudao-module-system/yudao-module-system-biz/src/test-integration/java/cn/iocoder/yudao/module/system/service/sms/SmsServiceIntegrationTest.java b/yudao-module-system/yudao-module-system-biz/src/test-integration/java/cn/iocoder/yudao/module/system/service/sms/SmsServiceIntegrationTest.java index b3ae5cde4..a8e57ccb5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test-integration/java/cn/iocoder/yudao/module/system/service/sms/SmsServiceIntegrationTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test-integration/java/cn/iocoder/yudao/module/system/service/sms/SmsServiceIntegrationTest.java @@ -30,22 +30,6 @@ public class SmsServiceIntegrationTest extends BaseDbAndRedisIntegrationTest { @MockBean private AdminUserService userService; - @Test - public void testSendSingleSms_yunpianSuccess() { - // 参数准备 - String mobile = "15601691399"; - Long userId = 1L; - Integer userType = UserTypeEnum.ADMIN.getValue(); - String templateCode = "test_01"; - Map templateParams = MapUtil.builder() - .put("operation", "登录").put("code", "1234").build(); - // 调用 - smsService.sendSingleSms(mobile, userId, userType, templateCode, templateParams); - - // 等待 MQ 消费 - ThreadUtil.sleep(1, TimeUnit.HOURS); - } - @Test public void testSendSingleSms_aliyunSuccess() { // 参数准备 diff --git a/归档/mall-dependencies/pom.xml b/归档/mall-dependencies/pom.xml index 290336ba9..c934a2f6c 100644 --- a/归档/mall-dependencies/pom.xml +++ b/归档/mall-dependencies/pom.xml @@ -51,7 +51,6 @@ 1.1.0 7.2.18 - 1.2.7 4.1.0 8.0.1 @@ -316,14 +315,9 @@ ${qiniu.version} - - com.yunpian.sdk - yunpian-java-sdk - ${yunpian-java-sdk.version} - com.aliyun - aliyun-java-sdk-core + aliyun-java-sdk-core ${aliyun-java-sdk-core.version} diff --git a/归档/moved/product/product-biz/pom.xml b/归档/moved/product/product-biz/pom.xml index 1bb098eb3..366cac7ce 100644 --- a/归档/moved/product/product-biz/pom.xml +++ b/归档/moved/product/product-biz/pom.xml @@ -50,11 +50,7 @@ 1.0-SNAPSHOT - - - com.yunpian.sdk - yunpian-java-sdk - + com.aliyun aliyun-java-sdk-core