From 32b6eb967e975885c2177c0004e5ee2c745188ac Mon Sep 17 00:00:00 2001 From: syyling Date: Wed, 29 May 2024 15:20:44 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20=EB=A6=AC=EB=B7=B0=20=EC=A1=B0=ED=9A=8C?= =?UTF-8?q?=20=EC=BF=BC=EB=A6=AC=ED=8C=8C=EB=9D=BC=EB=AF=B8=EB=9F=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95,=20=EA=B8=B0=EB=A1=9D=20=EC=97=86=EC=9D=84?= =?UTF-8?q?=20=EB=95=8C=20=ED=82=A4=EC=9B=8C=EB=93=9C=20=EB=B9=88=20?= =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EB=B0=98=ED=99=98=ED=95=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../record/application/service/RecordGetService.java | 8 +++++--- .../record/presentation/RecordController.java | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) 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")