From 2f55cebbad3dea187a5f91d16ec80a9677dab699 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期三, 13 十一月 2024 11:16:53 +0800 Subject: [PATCH] 1 --- src/main/java/com/yssh/controller/LocationController.java | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/yssh/controller/LocationController.java b/src/main/java/com/yssh/controller/LocationController.java index 833ff01..3d839ae 100644 --- a/src/main/java/com/yssh/controller/LocationController.java +++ b/src/main/java/com/yssh/controller/LocationController.java @@ -1,5 +1,6 @@ package com.yssh.controller; +import com.yssh.utils.CacheUtils; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -20,13 +21,6 @@ import javax.annotation.Resource; -/** - * @author wMeng - * @ClassName YsshLocationController - * @Description YsshLocationController - * @date 2022/10/30 13:21 - * @Version 1.0 - */ @Api(tags="鍘傚尯鐑偣鐐逛綅") @RestController @RequestMapping("/location") @@ -48,10 +42,16 @@ @GetMapping("/list") @ApiOperation(value = "鏌ヨ鎵�鏈夌偣浣嶆暟鎹�", notes = "鏌ヨ鎵�鏈夊巶鍖虹儹鐐圭偣浣嶆暟鎹�") public Result list() { - List<Location> list = locationService.getAll(); + //List<Location> list = locationService.getAll(); + String key = "locationService.getAll"; + List<Location> list = CacheUtils.getListByKey(key); + if (null == list) { + list = locationService.getAll(); + CacheUtils.putListByKey(key, list); + } + return Result.OK(list); } - @ApiOperation(value = "鏂板鐐逛綅鏁版嵁", notes = "鏂板鐐逛綅璇︽儏鏁版嵁") @PostMapping -- Gitblit v1.9.3