update spring-cache 整合 redisson

This commit is contained in:
疯狂的狮子li
2021-06-10 20:23:15 +08:00
parent 35f607f9a5
commit 57df2690da
2 changed files with 26 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisLockManager;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -62,4 +63,13 @@ public class RedisLockController {
}
return AjaxResult.success();
}
/**
* 测试spring-cache注解
*/
@Cacheable(value = "test", key = "#key")
@GetMapping("/testCache")
public AjaxResult<String> testCache(String key) {
return AjaxResult.success("操作成功", key);
}
}