From af8ec28f676e70100e9125d38814cf359ed779c3 Mon Sep 17 00:00:00 2001 From: pandahwang Date: Mon, 7 Oct 2024 20:22:09 +0900 Subject: [PATCH] =?UTF-8?q?add:=20user=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=9D=91=EB=8B=B5=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=EC=97=90=20=EC=BA=90=EC=8B=B1=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/TeamNull/LostArk/LostArk/controller/UserController.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/TeamNull/LostArk/LostArk/controller/UserController.java b/src/main/java/com/TeamNull/LostArk/LostArk/controller/UserController.java index 4932919..46214cd 100644 --- a/src/main/java/com/TeamNull/LostArk/LostArk/controller/UserController.java +++ b/src/main/java/com/TeamNull/LostArk/LostArk/controller/UserController.java @@ -6,6 +6,7 @@ import com.TeamNull.LostArk.LostArk.service.UserService; import lombok.Getter; import lombok.RequiredArgsConstructor; +import org.springframework.cache.annotation.Cacheable; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @@ -27,6 +28,7 @@ public ResponseEntity createUser(@RequestBody UserDto userDto) { return ResponseEntity.ok(newUser.getId()); } + @Cacheable(cacheNames = "getUser", key = "'users:id' + #id", cacheManager = "cacheManager") @GetMapping("/{id}") public ResponseEntity getUser(@PathVariable UUID id) { // id로 User 객체를 찾아 반환