From ccfa89d640c28c694dfd4a3dec91b2a0d6ba663a Mon Sep 17 00:00:00 2001 From: donghyunkim Date: Wed, 13 Mar 2024 16:46:15 +0900 Subject: [PATCH 1/4] =?UTF-8?q?docs/rename:=20=EC=B9=B4=ED=8E=98=20?= =?UTF-8?q?=EB=AA=A9=EB=A1=9D/=EC=A0=95=EB=B3=B4=20=EC=A1=B0=ED=9A=8C=20ap?= =?UTF-8?q?i=20=EB=AC=B8=EC=84=9C=20=EC=88=98=EC=A0=95=20=EB=B0=8F=20id=20?= =?UTF-8?q?=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/example/demo/dto/CafeBasicInfoResponse.java | 2 +- src/main/java/com/example/demo/dto/CafeSearchResponse.java | 2 +- src/main/java/com/example/demo/dto/ReviewResponse.java | 2 +- .../java/com/example/demo/dto/StudyOnceForCafeResponse.java | 2 +- src/main/java/com/example/demo/dto/WriterResponse.java | 2 +- .../java/com/example/demo/service/CafeQueryServiceImpl.java | 4 ++-- .../java/com/example/demo/service/ReviewQueryServiceImpl.java | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/example/demo/dto/CafeBasicInfoResponse.java b/src/main/java/com/example/demo/dto/CafeBasicInfoResponse.java index 86df6423..17127930 100644 --- a/src/main/java/com/example/demo/dto/CafeBasicInfoResponse.java +++ b/src/main/java/com/example/demo/dto/CafeBasicInfoResponse.java @@ -9,7 +9,7 @@ @RequiredArgsConstructor public class CafeBasicInfoResponse { - private final long id; + private final long cafeId; private final String name; private final String address; private final List businessHours; diff --git a/src/main/java/com/example/demo/dto/CafeSearchResponse.java b/src/main/java/com/example/demo/dto/CafeSearchResponse.java index b2430343..91f62e95 100644 --- a/src/main/java/com/example/demo/dto/CafeSearchResponse.java +++ b/src/main/java/com/example/demo/dto/CafeSearchResponse.java @@ -9,7 +9,7 @@ @RequiredArgsConstructor public class CafeSearchResponse { - private final long id; + private final long cafeId; private final String name; private final String address; private final List businessHours; diff --git a/src/main/java/com/example/demo/dto/ReviewResponse.java b/src/main/java/com/example/demo/dto/ReviewResponse.java index 315ab417..e86c06cc 100644 --- a/src/main/java/com/example/demo/dto/ReviewResponse.java +++ b/src/main/java/com/example/demo/dto/ReviewResponse.java @@ -7,7 +7,7 @@ @Builder public class ReviewResponse { - private final long id; + private final long reviewId; private final WriterResponse writer; private final double rate; private final String content; diff --git a/src/main/java/com/example/demo/dto/StudyOnceForCafeResponse.java b/src/main/java/com/example/demo/dto/StudyOnceForCafeResponse.java index e600c102..06252b3e 100644 --- a/src/main/java/com/example/demo/dto/StudyOnceForCafeResponse.java +++ b/src/main/java/com/example/demo/dto/StudyOnceForCafeResponse.java @@ -9,7 +9,7 @@ @Builder public class StudyOnceForCafeResponse { private long cafeId; - private long id; + private long studyOnceId; private String name; private LocalDateTime startDateTime; private LocalDateTime endDateTime; diff --git a/src/main/java/com/example/demo/dto/WriterResponse.java b/src/main/java/com/example/demo/dto/WriterResponse.java index ed2ad82a..11aeb543 100644 --- a/src/main/java/com/example/demo/dto/WriterResponse.java +++ b/src/main/java/com/example/demo/dto/WriterResponse.java @@ -7,7 +7,7 @@ @RequiredArgsConstructor public class WriterResponse { - private final long id; + private final long memberId; private final String name; private final String thumbnailImg; diff --git a/src/main/java/com/example/demo/service/CafeQueryServiceImpl.java b/src/main/java/com/example/demo/service/CafeQueryServiceImpl.java index ad23ceea..4202b0b6 100644 --- a/src/main/java/com/example/demo/service/CafeQueryServiceImpl.java +++ b/src/main/java/com/example/demo/service/CafeQueryServiceImpl.java @@ -183,7 +183,7 @@ private List mapToReviewResponseList(CafeImpl findCafe) { return findCafe.getReviews().stream() .map(review -> ReviewResponse.builder() - .id(review.getId()) + .reviewId(review.getId()) .writer( new WriterResponse(review.getMember().getId(), review.getMember().getName(), @@ -201,7 +201,7 @@ private List mapToStudyOnceForCafeResponse(CafeImpl fi .map(studyOnce -> StudyOnceForCafeResponse.builder() .cafeId(findCafe.getId()) - .id(studyOnce.getId()) + .studyOnceId(studyOnce.getId()) .name(studyOnce.getName()) .startDateTime(studyOnce.getStartDateTime()) .endDateTime(studyOnce.getEndDateTime()) diff --git a/src/main/java/com/example/demo/service/ReviewQueryServiceImpl.java b/src/main/java/com/example/demo/service/ReviewQueryServiceImpl.java index 66cf243c..7305215c 100644 --- a/src/main/java/com/example/demo/service/ReviewQueryServiceImpl.java +++ b/src/main/java/com/example/demo/service/ReviewQueryServiceImpl.java @@ -52,7 +52,7 @@ private ReviewImpl findReviewById(Long reviewId) { private ReviewResponse mapToReviewResponse(ReviewImpl findReview) { return ReviewResponse.builder() - .id(findReview.getId()) + .reviewId(findReview.getId()) .writer( new WriterResponse(findReview.getMember().getId(), findReview.getMember().getName(), From 8d5c5bcc3450a99d0535e7ade704c35669ea7577 Mon Sep 17 00:00:00 2001 From: donghyunkim Date: Wed, 13 Mar 2024 16:57:39 +0900 Subject: [PATCH 2/4] =?UTF-8?q?docs/rename:=20=EB=A6=AC=EB=B7=B0CRUD=20api?= =?UTF-8?q?=20=EB=AC=B8=EC=84=9C=20=EC=88=98=EC=A0=95=20=EB=B0=8F=20id=20?= =?UTF-8?q?=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/example/demo/dto/ReviewSearchResponse.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/example/demo/dto/ReviewSearchResponse.java b/src/main/java/com/example/demo/dto/ReviewSearchResponse.java index 0ce2adc9..1461d730 100644 --- a/src/main/java/com/example/demo/dto/ReviewSearchResponse.java +++ b/src/main/java/com/example/demo/dto/ReviewSearchResponse.java @@ -7,7 +7,7 @@ @RequiredArgsConstructor public class ReviewSearchResponse { - private final long id; + private final long reviewId; private final WriterResponse writer; private final double rate; private final String content; From 378df498596cf98e67c493b1364291718414a01b Mon Sep 17 00:00:00 2001 From: donghyunkim Date: Wed, 13 Mar 2024 17:19:09 +0900 Subject: [PATCH 3/4] =?UTF-8?q?docs/rename:=20=EC=B9=B4=EA=B3=B5=EB=AA=A8?= =?UTF-8?q?=EC=A7=91=20api=EB=AC=B8=EC=84=9C=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?=EB=B0=8F=20id=20=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/example/demo/dto/StudyOnceSearchResponse.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/example/demo/dto/StudyOnceSearchResponse.java b/src/main/java/com/example/demo/dto/StudyOnceSearchResponse.java index 712d1fbb..cba8008b 100644 --- a/src/main/java/com/example/demo/dto/StudyOnceSearchResponse.java +++ b/src/main/java/com/example/demo/dto/StudyOnceSearchResponse.java @@ -9,7 +9,7 @@ @Data public class StudyOnceSearchResponse { private long cafeId; - private long id; + private long studyOnceId; private String name; private LocalDateTime startDateTime; private LocalDateTime endDateTime; From c367bcfed07d554ded338420fc858b603ef5113a Mon Sep 17 00:00:00 2001 From: donghyunkim Date: Wed, 13 Mar 2024 17:27:10 +0900 Subject: [PATCH 4/4] =?UTF-8?q?rename:=20id=EB=A5=BC=20studyOnceId?= =?UTF-8?q?=EB=A1=9C=20=EC=9D=B4=EB=A6=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../demo/service/StudyOnceServiceImpl.java | 2 +- .../service/StudyOnceServiceImplTest.java | 28 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/example/demo/service/StudyOnceServiceImpl.java b/src/main/java/com/example/demo/service/StudyOnceServiceImpl.java index c67dbe60..0e6f46d3 100644 --- a/src/main/java/com/example/demo/service/StudyOnceServiceImpl.java +++ b/src/main/java/com/example/demo/service/StudyOnceServiceImpl.java @@ -208,7 +208,7 @@ private static StudyOnceImpl makeNewStudyOnce(StudyOnceCreateRequest studyOnceCr private static StudyOnceSearchResponse makeStudyOnceSearchResponse(StudyOnceImpl saved, boolean canJoin) { return StudyOnceSearchResponse.builder() .cafeId(saved.getCafe().getId()) - .id(saved.getId()) + .studyOnceId(saved.getId()) .name(saved.getName()) .startDateTime(saved.getStartDateTime()) .endDateTime(saved.getEndDateTime()) diff --git a/src/test/java/com/example/demo/service/StudyOnceServiceImplTest.java b/src/test/java/com/example/demo/service/StudyOnceServiceImplTest.java index 249edf74..0634db13 100644 --- a/src/test/java/com/example/demo/service/StudyOnceServiceImplTest.java +++ b/src/test/java/com/example/demo/service/StudyOnceServiceImplTest.java @@ -113,8 +113,8 @@ void searchByStudyId() { long leaderId = initMember(); StudyOnceCreateRequest studyOnceCreateRequest = makeStudyOnceCreateRequest(start, end, cafeId); StudyOnceSearchResponse result = studyOnceService.createStudy(leaderId, studyOnceCreateRequest); - StudyOnceSearchResponse studyOnceSearchResponse = studyOnceService.searchByStudyId(result.getId()); - assertThat(studyOnceSearchResponse.getId()).isEqualTo(result.getId()); + StudyOnceSearchResponse studyOnceSearchResponse = studyOnceService.searchByStudyId(result.getStudyOnceId()); + assertThat(studyOnceSearchResponse.getStudyOnceId()).isEqualTo(result.getStudyOnceId()); } @Test @@ -181,7 +181,7 @@ private static StudyOnceSearchResponse makeExpectedStudyOnceCreateResult(long ca boolean isEnd = false; return StudyOnceSearchResponse.builder() .cafeId(cafeId) - .id(result.getId()) + .studyOnceId(result.getStudyOnceId()) .name(studyOnceCreateRequest.getName()) .startDateTime(studyOnceCreateRequest.getStartDateTime()) .endDateTime(studyOnceCreateRequest.getEndDateTime()) @@ -226,7 +226,7 @@ void createFailByAlreadyStudyMember(LocalDateTime start, LocalDateTime end, Loca long memberId = initMember(); StudyOnceCreateRequest studyOnceCreateRequest = makeStudyOnceCreateRequest(start, end, cafeId); StudyOnceSearchResponse study = studyOnceService.createStudy(leaderId, studyOnceCreateRequest); - studyOnceService.tryJoin(memberId, study.getId()); + studyOnceService.tryJoin(memberId, study.getStudyOnceId()); // 오른쪽 끝에서 겹침 StudyOnceCreateRequest needToFailStudyOnceCreateRequest = makeStudyOnceCreateRequest(left, right, cafeId); assertThatThrownBy(() -> studyOnceService.createStudy(memberId, needToFailStudyOnceCreateRequest)) @@ -267,7 +267,7 @@ void tryJoin() { StudyOnceCreateRequest studyOnceCreateRequest = makeStudyOnceCreateRequest(LocalDateTime.now().plusHours(4), LocalDateTime.now().plusHours(7), cafeId); StudyOnceSearchResponse study = studyOnceService.createStudy(firstMemberId, studyOnceCreateRequest); - studyOnceService.tryJoin(secondMemberId, study.getId()); + studyOnceService.tryJoin(secondMemberId, study.getStudyOnceId()); } @Test @@ -280,9 +280,9 @@ void tryJoinFailCauseDuplicate() { LocalDateTime.now().plusHours(7), cafeId); StudyOnceSearchResponse study = studyOnceService.createStudy(firstMemberId, studyOnceCreateRequest); //when - studyOnceService.tryJoin(secondMemberId, study.getId()); + studyOnceService.tryJoin(secondMemberId, study.getStudyOnceId()); //then - assertThatThrownBy(() -> studyOnceService.tryJoin(secondMemberId, study.getId())) + assertThatThrownBy(() -> studyOnceService.tryJoin(secondMemberId, study.getStudyOnceId())) .isInstanceOf(CafegoryException.class) .hasMessage(STUDY_ONCE_DUPLICATE.getErrorMessage()); } @@ -299,14 +299,14 @@ void tryJoinFailCauseConflict(LocalDateTime start, LocalDateTime end, LocalDateT long cafeId = initCafe(); StudyOnceCreateRequest studyOnceCreateRequest = makeStudyOnceCreateRequest(start, end, cafeId); StudyOnceSearchResponse study = studyOnceService.createStudy(firstMemberId, studyOnceCreateRequest); - studyOnceService.tryJoin(secondMemberId, study.getId()); + studyOnceService.tryJoin(secondMemberId, study.getStudyOnceId()); //when StudyOnceCreateRequest conflictStudyOnceCreateRequest = makeStudyOnceCreateRequest(conflictStart, conflictEnd, cafeId); StudyOnceSearchResponse conflictStudy = studyOnceService.createStudy(thirdMemberId, conflictStudyOnceCreateRequest); //then - assertThatThrownBy(() -> studyOnceService.tryJoin(secondMemberId, conflictStudy.getId())) + assertThatThrownBy(() -> studyOnceService.tryJoin(secondMemberId, conflictStudy.getStudyOnceId())) .isInstanceOf(CafegoryException.class) .hasMessage(STUDY_ONCE_CONFLICT_TIME.getErrorMessage()); } @@ -328,8 +328,8 @@ void tryQuit() { long cafeId = initCafe(); StudyOnceCreateRequest studyOnceCreateRequest = makeStudyOnceCreateRequest(start, end, cafeId); StudyOnceSearchResponse study = studyOnceService.createStudy(firstMemberId, studyOnceCreateRequest); - studyOnceService.tryJoin(secondMemberId, study.getId()); - studyOnceService.tryQuit(secondMemberId, study.getId()); + studyOnceService.tryJoin(secondMemberId, study.getStudyOnceId()); + studyOnceService.tryQuit(secondMemberId, study.getStudyOnceId()); } @Test @@ -342,7 +342,7 @@ void tryQuitFailCauseNotJoin() { long cafeId = initCafe(); StudyOnceCreateRequest studyOnceCreateRequest = makeStudyOnceCreateRequest(start, end, cafeId); StudyOnceSearchResponse study = studyOnceService.createStudy(firstMemberId, studyOnceCreateRequest); - assertThatThrownBy(() -> studyOnceService.tryQuit(secondMemberId, study.getId())) + assertThatThrownBy(() -> studyOnceService.tryQuit(secondMemberId, study.getStudyOnceId())) .isInstanceOf(CafegoryException.class) .hasMessage(STUDY_ONCE_TRY_QUIT_NOT_JOIN.getErrorMessage()); } @@ -357,8 +357,8 @@ void tryQuitFailCauseNotOnlyLeader() { long cafeId = initCafe(); StudyOnceCreateRequest studyOnceCreateRequest = makeStudyOnceCreateRequest(start, end, cafeId); StudyOnceSearchResponse study = studyOnceService.createStudy(firstMemberId, studyOnceCreateRequest); - studyOnceService.tryJoin(secondMemberId, study.getId()); - assertThatThrownBy(() -> studyOnceService.tryQuit(firstMemberId, study.getId())) + studyOnceService.tryJoin(secondMemberId, study.getStudyOnceId()); + assertThatThrownBy(() -> studyOnceService.tryQuit(firstMemberId, study.getStudyOnceId())) .isInstanceOf(CafegoryException.class) .hasMessage(STUDY_ONCE_LEADER_QUIT_FAIL.getErrorMessage()); }