From fd8affdc8a8575ca1445faee39c38ee507b8c5a1 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期五, 03 九月 2021 16:21:23 +0800 Subject: [PATCH] update 补全演示案例 接口文档 --- ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisCacheController.java | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisCacheController.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisCacheController.java index 4588f13..6877aed 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisCacheController.java +++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisCacheController.java @@ -1,6 +1,8 @@ package com.ruoyi.demo.controller; import com.ruoyi.common.core.domain.AjaxResult; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.annotation.CacheEvict; @@ -17,6 +19,7 @@ */ // 绫荤骇鍒� 缂撳瓨缁熶竴閰嶇疆 //@CacheConfig(cacheNames = "redissonCacheMap") +@Api(value = "spring-cache 婕旂ず妗堜緥", tags = {"spring-cache 婕旂ず妗堜緥"}) @RequiredArgsConstructor(onConstructor_ = @Autowired) @RestController @RequestMapping("/demo/cache") @@ -33,6 +36,7 @@ * * cacheNames 涓洪厤缃枃浠跺唴 groupId */ + @ApiOperation("娴嬭瘯 @Cacheable") @Cacheable(cacheNames = "redissonCacheMap", key = "#key", condition = "#key != null") @GetMapping("/test1") public AjaxResult<String> test1(String key, String value){ @@ -47,6 +51,7 @@ * * cacheNames 涓� 閰嶇疆鏂囦欢鍐� groupId */ + @ApiOperation("娴嬭瘯 @CachePut") @CachePut(cacheNames = "redissonCacheMap", key = "#key", condition = "#key != null") @GetMapping("/test2") public AjaxResult<String> test2(String key, String value){ @@ -61,6 +66,7 @@ * * cacheNames 涓� 閰嶇疆鏂囦欢鍐� groupId */ + @ApiOperation("娴嬭瘯 @CacheEvict") @CacheEvict(cacheNames = "redissonCacheMap", key = "#key", condition = "#key != null") @GetMapping("/test3") public AjaxResult<String> test3(String key, String value){ -- Gitblit v1.9.3