sendMessageWithAttachment(String to, String subject, String text, String filePath) {
MailUtils.sendText(to, subject, text, new File(filePath));
return R.ok();
}
diff --git a/ruoyi-example/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisCacheController.java b/ruoyi-example/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisCacheController.java
index eda77c54..290b64f3 100644
--- a/ruoyi-example/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisCacheController.java
+++ b/ruoyi-example/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisCacheController.java
@@ -2,8 +2,6 @@ package com.ruoyi.demo.controller;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.redis.utils.RedisUtils;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
@@ -21,7 +19,6 @@ import java.time.Duration;
*/
// 类级别 缓存统一配置
//@CacheConfig(cacheNames = "redissonCacheMap")
-@Api(value = "spring-cache 演示案例", tags = {"spring-cache 演示案例"})
@RequiredArgsConstructor
@RestController
@RequestMapping("/demo/cache")
@@ -41,7 +38,6 @@ public class RedisCacheController {
*
* cacheNames 为配置文件内 groupId
*/
- @ApiOperation("测试 @Cacheable")
@Cacheable(cacheNames = "redissonCacheMap", key = "#key", condition = "#key != null")
@GetMapping("/test1")
public R test1(String key, String value) {
@@ -56,7 +52,6 @@ public class RedisCacheController {
*
* cacheNames 为 配置文件内 groupId
*/
- @ApiOperation("测试 @CachePut")
@CachePut(cacheNames = "redissonCacheMap", key = "#key", condition = "#key != null")
@GetMapping("/test2")
public R test2(String key, String value) {
@@ -71,7 +66,6 @@ public class RedisCacheController {
*
* cacheNames 为 配置文件内 groupId
*/
- @ApiOperation("测试 @CacheEvict")
@CacheEvict(cacheNames = "redissonCacheMap", key = "#key", condition = "#key != null")
@GetMapping("/test3")
public R test3(String key, String value) {
@@ -83,7 +77,6 @@ public class RedisCacheController {
* 手动设置过期时间10秒
* 11秒后获取 判断是否相等
*/
- @ApiOperation("测试设置过期时间")
@GetMapping("/test6")
public R test6(String key, String value) {
RedisUtils.setCacheObject(key, value);
diff --git a/ruoyi-example/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisLockController.java b/ruoyi-example/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisLockController.java
index c31925a5..ebc923d1 100644
--- a/ruoyi-example/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisLockController.java
+++ b/ruoyi-example/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisLockController.java
@@ -5,8 +5,6 @@ import com.baomidou.lock.LockTemplate;
import com.baomidou.lock.annotation.Lock4j;
import com.baomidou.lock.executor.RedissonLockExecutor;
import com.ruoyi.common.core.domain.R;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@@ -21,7 +19,6 @@ import java.time.LocalTime;
*
* @author shenxinquan
*/
-@Api(value = "测试分布式锁的样例", tags = {"测试分布式锁的样例"})
@Slf4j
@RestController
@RequestMapping("/demo/redisLock")
@@ -33,7 +30,6 @@ public class RedisLockController {
/**
* 测试lock4j 注解
*/
- @ApiOperation("测试lock4j 注解")
@Lock4j(keys = {"#key"})
@GetMapping("/testLock4j")
public R testLock4j(String key, String value) {
@@ -50,7 +46,6 @@ public class RedisLockController {
/**
* 测试lock4j 工具
*/
- @ApiOperation("测试lock4j 工具")
@GetMapping("/testLock4jLockTemplate")
public R testLock4jLockTemplate(String key, String value) {
final LockInfo lockInfo = lockTemplate.lock(key, 30000L, 5000L, RedissonLockExecutor.class);
diff --git a/ruoyi-example/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisPubSubController.java b/ruoyi-example/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisPubSubController.java
index 80dc615a..6f3c18c2 100644
--- a/ruoyi-example/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisPubSubController.java
+++ b/ruoyi-example/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisPubSubController.java
@@ -2,9 +2,6 @@ package com.ruoyi.demo.controller;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.redis.utils.RedisUtils;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -15,24 +12,32 @@ import org.springframework.web.bind.annotation.RestController;
*
* @author Lion Li
*/
-@Api(value = "Redis发布订阅 演示案例", tags = {"Redis发布订阅"})
@RequiredArgsConstructor
@RestController
@RequestMapping("/demo/redis/pubsub")
public class RedisPubSubController {
- @ApiOperation("发布消息")
+ /**
+ * 发布消息
+ *
+ * @param key 通道Key
+ * @param value 发送内容
+ */
@GetMapping("/pub")
- public R pub(@ApiParam("通道Key") String key, @ApiParam("发送内容") String value) {
+ public R pub(String key, String value) {
RedisUtils.publish(key, value, consumer -> {
System.out.println("发布通道 => " + key + ", 发送值 => " + value);
});
return R.ok("操作成功");
}
- @ApiOperation("订阅消息")
+ /**
+ * 订阅消息
+ *
+ * @param key 通道Key
+ */
@GetMapping("/sub")
- public R sub(@ApiParam("通道Key") String key) {
+ public R sub(String key) {
RedisUtils.subscribe(key, String.class, msg -> {
System.out.println("订阅通道 => " + key + ", 接收值 => " + msg);
});
diff --git a/ruoyi-example/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/SmsController.java b/ruoyi-example/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/SmsController.java
index 375cc482..95e12168 100644
--- a/ruoyi-example/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/SmsController.java
+++ b/ruoyi-example/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/SmsController.java
@@ -4,9 +4,6 @@ import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.utils.SpringUtils;
import com.ruoyi.common.sms.config.properties.SmsProperties;
import com.ruoyi.common.sms.core.SmsTemplate;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
@@ -24,7 +21,6 @@ import java.util.Map;
* @version 4.2.0
*/
@Validated
-@Api(value = "短信演示案例", tags = {"短信演示案例"})
@RequiredArgsConstructor
@RestController
@RequestMapping("/demo/sms")
@@ -34,10 +30,14 @@ public class SmsController {
// private final SmsTemplate smsTemplate; // 可以使用spring注入
// private final AliyunSmsTemplate smsTemplate; // 也可以注入某个厂家的模板工具
- @ApiOperation("发送短信Aliyun")
+ /**
+ * 发送短信Aliyun
+ *
+ * @param phones 电话号
+ * @param templateId 模板ID
+ */
@GetMapping("/sendAliyun")
- public R