| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | 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; |
| | |
| | | return AjaxResult.success("操作成功", value); |
| | | } |
| | | |
| | | /** |
| | | * 测试spring-cache注解 |
| | | */ |
| | | @ApiOperation("测试spring-cache注解") |
| | | @Cacheable(value = "test", key = "#key") |
| | | @GetMapping("/testCache") |
| | | public AjaxResult<String> testCache(String key) { |
| | | return AjaxResult.success("操作成功", key); |
| | | } |
| | | } |