diff --git a/src/main/java/com/mookive/mookive_backend/record/application/service/RecordGetService.java b/src/main/java/com/mookive/mookive_backend/record/application/service/RecordGetService.java index ff6ba9c..925dc55 100644 --- a/src/main/java/com/mookive/mookive_backend/record/application/service/RecordGetService.java +++ b/src/main/java/com/mookive/mookive_backend/record/application/service/RecordGetService.java @@ -29,12 +29,14 @@ public class RecordGetService { private static final int HOME_RECORDS_BY_USER = 5; private static final int HOME_RECORDS = 10; - public RecordResponse.RecordDetailResponse getRecord(Long userId, Long movieId) { - Optional record = recordQueryService.findByUserIdAndMovieId(userId, movieId); + public RecordResponse.RecordDetailResponse getRecord(Long userId, String tmdbId) { + Movie movie = movieQueryService.findByTmdbId(tmdbId); + Optional record = recordQueryService.findByUserIdAndMovieId(userId, movie.getId()); if(record.isEmpty()) { + List keyword = new ArrayList<>(); return RecordResponse.RecordDetailResponse.builder() .date(null) - .keywords(null) + .keywords(keyword) .rating(null) .review(null) .build(); diff --git a/src/main/java/com/mookive/mookive_backend/record/presentation/RecordController.java b/src/main/java/com/mookive/mookive_backend/record/presentation/RecordController.java index 1b22045..ae7da13 100644 --- a/src/main/java/com/mookive/mookive_backend/record/presentation/RecordController.java +++ b/src/main/java/com/mookive/mookive_backend/record/presentation/RecordController.java @@ -24,8 +24,8 @@ public void createRecord(@RequestBody RecordRequest.RecordCreateRequest recordCr } @GetMapping("/record") - public RecordResponse.RecordDetailResponse getRecord(@RequestParam Long userId, @RequestParam Long movieId) { - return recordGetService.getRecord(userId, movieId); + public RecordResponse.RecordDetailResponse getRecord(@RequestParam Long userId, @RequestParam String tmdbId) { + return recordGetService.getRecord(userId, tmdbId); } @DeleteMapping("/record")