Skip to content

Commit

Permalink
add: user 테스트 응답 데이터 조회에 캐싱 기능 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
pandahwang committed Oct 7, 2024
1 parent fe8c1fb commit af8ec28
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.*;

Expand All @@ -27,6 +28,7 @@ public ResponseEntity<UUID> createUser(@RequestBody UserDto userDto) {
return ResponseEntity.ok(newUser.getId());
}

@Cacheable(cacheNames = "getUser", key = "'users:id' + #id", cacheManager = "cacheManager")
@GetMapping("/{id}")
public ResponseEntity<User> getUser(@PathVariable UUID id) {
// id로 User 객체를 찾아 반환
Expand Down

0 comments on commit af8ec28

Please sign in to comment.