From b0046a2cac18cf727f8e9e5163a7665ef48f67f6 Mon Sep 17 00:00:00 2001 From: AprilWind <2100166581@qq.com> Date: Thu, 18 Jan 2024 10:52:47 +0800 Subject: [PATCH] update sms 3.1.0 => 3.1.1 --- pom.xml | 2 +- .../common/sms/core/dao/PlusSmsDao.java | 13 ++++++++++ .../demo/controller/SmsController.java | 24 +++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 40de637e..a3b165bb 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 4.10.0 - 3.1.0 + 3.1.1 3.11.0 diff --git a/ruoyi-common/ruoyi-common-sms/src/main/java/org/dromara/common/sms/core/dao/PlusSmsDao.java b/ruoyi-common/ruoyi-common-sms/src/main/java/org/dromara/common/sms/core/dao/PlusSmsDao.java index 73c9a37b..91d8d243 100644 --- a/ruoyi-common/ruoyi-common-sms/src/main/java/org/dromara/common/sms/core/dao/PlusSmsDao.java +++ b/ruoyi-common/ruoyi-common-sms/src/main/java/org/dromara/common/sms/core/dao/PlusSmsDao.java @@ -48,6 +48,19 @@ public class PlusSmsDao implements SmsDao { return RedisUtils.getCacheObject(GlobalConstants.GLOBAL_REDIS_KEY + key); } + /** + * remove + *

根据key移除缓存 + * + * @param key 缓存键 + * @return 被删除的value + * @author :Wind + */ + @Override + public Object remove(String key) { + return RedisUtils.deleteObject(GlobalConstants.GLOBAL_REDIS_KEY + key); + } + /** * 清空 */ diff --git a/ruoyi-example/ruoyi-demo/src/main/java/org/dromara/demo/controller/SmsController.java b/ruoyi-example/ruoyi-demo/src/main/java/org/dromara/demo/controller/SmsController.java index fb809f3f..256c4383 100644 --- a/ruoyi-example/ruoyi-demo/src/main/java/org/dromara/demo/controller/SmsController.java +++ b/ruoyi-example/ruoyi-demo/src/main/java/org/dromara/demo/controller/SmsController.java @@ -55,4 +55,28 @@ public class SmsController { return R.ok(smsResponse); } + /** + * 加入黑名单 + * + * @param phone 手机号 + */ + @GetMapping("/joinInBlacklist") + public R joinInBlacklist(String phone){ + SmsBlend smsBlend = SmsFactory.getSmsBlend("tx1"); + smsBlend.joinInBlacklist(phone); + return R.ok(); + } + + /** + * 移除黑名单 + * + * @param phone 手机号 + */ + @GetMapping("/removeFromBlacklist") + public R removeFromBlacklist(String phone){ + SmsBlend smsBlend = SmsFactory.getSmsBlend("tx1"); + smsBlend.removeFromBlacklist(phone); + return R.ok(); + } + }