From 9c6d0ed96c4f4b3f772f6504a3f05cc718b42a91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=86=90=ED=99=8D=EC=84=9D?= <78216059+bayy1216@users.noreply.github.com> Date: Sun, 1 Sep 2024 17:56:58 +0900 Subject: [PATCH] =?UTF-8?q?[Feat]:=20=EC=B1=8C=EB=A6=B0=EC=A7=80=20?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=20=ED=8C=A8=ED=82=A4=EC=A7=80=20=EB=B6=84?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ChallengeReviewController.java | 9 +++++---- .../controller/ChallengeReviewRes.java | 8 ++++---- .../domain/ChallengeReview.java | 3 ++- .../domain}/ChallengeReviewModel.java | 3 +-- .../domain}/ChallengeReviewReader.java | 4 ++-- .../domain}/ChallengeReviewService.java | 5 +---- .../challengereview/domain/ChallengeReviewStore.java | 8 ++++++++ .../infrastructure}/ChallengeReviewReaderImpl.java | 9 ++++----- .../infrastructure/ChallengeReviewRepository.java | 4 ++-- .../infrastructure}/ChallengeReviewStoreImpl.java | 7 +++---- .../domain/application/UserChallengeService.java | 2 +- .../userchallenge/domain/port/ChallengeReviewStore.java | 9 --------- .../domain/application/RecordServiceTest.java | 7 +++++-- .../domain/application/UserRecordServiceTest.java | 2 +- 14 files changed, 39 insertions(+), 41 deletions(-) rename zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/{userchallenge => challengereview}/controller/ChallengeReviewController.java (90%) rename zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/{userchallenge => challengereview}/controller/ChallengeReviewRes.java (86%) rename zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/{userchallenge => challengereview}/domain/ChallengeReview.java (92%) rename zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/{userchallenge/domain/application => challengereview/domain}/ChallengeReviewModel.java (96%) rename zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/{userchallenge/domain/port => challengereview/domain}/ChallengeReviewReader.java (85%) rename zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/{userchallenge/domain/application => challengereview/domain}/ChallengeReviewService.java (91%) create mode 100644 zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReviewStore.java rename zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/{userchallenge/infrastructure/adapter => challengereview/infrastructure}/ChallengeReviewReaderImpl.java (91%) rename zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/{userchallenge => challengereview}/infrastructure/ChallengeReviewRepository.java (74%) rename zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/{userchallenge/infrastructure/adapter => challengereview/infrastructure}/ChallengeReviewStoreImpl.java (59%) delete mode 100644 zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/port/ChallengeReviewStore.java diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/controller/ChallengeReviewController.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/controller/ChallengeReviewController.java similarity index 90% rename from zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/controller/ChallengeReviewController.java rename to zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/controller/ChallengeReviewController.java index d46dea3..6ff9321 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/controller/ChallengeReviewController.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/controller/ChallengeReviewController.java @@ -1,4 +1,4 @@ -package org.haedal.zzansuni.userchallenge.controller; +package org.haedal.zzansuni.challengereview.controller; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; @@ -7,9 +7,10 @@ import org.haedal.zzansuni.common.controller.PagingRequest; import org.haedal.zzansuni.common.controller.PagingResponse; import org.haedal.zzansuni.core.api.ApiResponse; -import org.haedal.zzansuni.userchallenge.domain.application.ChallengeReviewModel.ChallengeReviewWithChallenge; -import org.haedal.zzansuni.userchallenge.domain.application.ChallengeReviewModel.ChallengeReviewWithUserInfo; -import org.haedal.zzansuni.userchallenge.domain.application.ChallengeReviewService; +import org.haedal.zzansuni.userchallenge.controller.ChallengeReq; +import org.haedal.zzansuni.challengereview.domain.ChallengeReviewModel.ChallengeReviewWithChallenge; +import org.haedal.zzansuni.challengereview.domain.ChallengeReviewModel.ChallengeReviewWithUserInfo; +import org.haedal.zzansuni.challengereview.domain.ChallengeReviewService; import org.haedal.zzansuni.global.jwt.JwtUser; import org.springframework.data.domain.Page; import org.springframework.http.HttpStatus; diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/controller/ChallengeReviewRes.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/controller/ChallengeReviewRes.java similarity index 86% rename from zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/controller/ChallengeReviewRes.java rename to zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/controller/ChallengeReviewRes.java index 506202c..94d0579 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/controller/ChallengeReviewRes.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/controller/ChallengeReviewRes.java @@ -1,11 +1,11 @@ -package org.haedal.zzansuni.userchallenge.controller; +package org.haedal.zzansuni.challengereview.controller; import java.util.Map; import lombok.Builder; import org.haedal.zzansuni.user.controller.UserRes; -import org.haedal.zzansuni.userchallenge.domain.application.ChallengeReviewModel; -import org.haedal.zzansuni.userchallenge.domain.application.ChallengeReviewModel.ChallengeReviewWithChallenge; -import org.haedal.zzansuni.userchallenge.domain.application.ChallengeReviewModel.ChallengeReviewWithUserInfo; +import org.haedal.zzansuni.challengereview.domain.ChallengeReviewModel; +import org.haedal.zzansuni.challengereview.domain.ChallengeReviewModel.ChallengeReviewWithChallenge; +import org.haedal.zzansuni.challengereview.domain.ChallengeReviewModel.ChallengeReviewWithUserInfo; public class ChallengeReviewRes { diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/ChallengeReview.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReview.java similarity index 92% rename from zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/ChallengeReview.java rename to zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReview.java index 49eeeca..1265323 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/ChallengeReview.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReview.java @@ -1,4 +1,4 @@ -package org.haedal.zzansuni.userchallenge.domain; +package org.haedal.zzansuni.challengereview.domain; import jakarta.persistence.*; import lombok.AccessLevel; @@ -8,6 +8,7 @@ import lombok.NoArgsConstructor; import org.haedal.zzansuni.common.domain.BaseTimeEntity; import org.haedal.zzansuni.challengegroup.domain.ChallengeCommand; +import org.haedal.zzansuni.userchallenge.domain.UserChallenge; @Entity @AllArgsConstructor diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/application/ChallengeReviewModel.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReviewModel.java similarity index 96% rename from zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/application/ChallengeReviewModel.java rename to zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReviewModel.java index 6460a4e..ebc0cb8 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/application/ChallengeReviewModel.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReviewModel.java @@ -1,4 +1,4 @@ -package org.haedal.zzansuni.userchallenge.domain.application; +package org.haedal.zzansuni.challengereview.domain; import java.util.HashMap; import java.util.List; @@ -7,7 +7,6 @@ import org.haedal.zzansuni.challengegroup.domain.ChallengeGroup; import org.haedal.zzansuni.challengegroup.domain.Challenge; import org.haedal.zzansuni.user.domain.UserModel; -import org.haedal.zzansuni.userchallenge.domain.ChallengeReview; import org.haedal.zzansuni.userchallenge.domain.UserChallenge; public class ChallengeReviewModel { diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/port/ChallengeReviewReader.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReviewReader.java similarity index 85% rename from zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/port/ChallengeReviewReader.java rename to zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReviewReader.java index de90e0e..c1a1355 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/port/ChallengeReviewReader.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReviewReader.java @@ -1,10 +1,10 @@ -package org.haedal.zzansuni.userchallenge.domain.port; +package org.haedal.zzansuni.challengereview.domain; import java.util.List; import java.util.Map; import java.util.Optional; -import org.haedal.zzansuni.userchallenge.domain.ChallengeReview; + import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/application/ChallengeReviewService.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReviewService.java similarity index 91% rename from zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/application/ChallengeReviewService.java rename to zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReviewService.java index 5c37270..2f56398 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/application/ChallengeReviewService.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReviewService.java @@ -1,12 +1,9 @@ -package org.haedal.zzansuni.userchallenge.domain.application; +package org.haedal.zzansuni.challengereview.domain; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.haedal.zzansuni.challengegroup.domain.ChallengeCommand; -import org.haedal.zzansuni.userchallenge.domain.port.ChallengeReviewReader; -import org.haedal.zzansuni.userchallenge.domain.port.ChallengeReviewStore; import org.haedal.zzansuni.userchallenge.domain.port.UserChallengeReader; -import org.haedal.zzansuni.userchallenge.domain.ChallengeReview; import org.haedal.zzansuni.userchallenge.domain.UserChallenge; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReviewStore.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReviewStore.java new file mode 100644 index 0000000..1c9800b --- /dev/null +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/domain/ChallengeReviewStore.java @@ -0,0 +1,8 @@ +package org.haedal.zzansuni.challengereview.domain; + + +public interface ChallengeReviewStore { + + ChallengeReview store(ChallengeReview challengeReview); + +} diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/infrastructure/adapter/ChallengeReviewReaderImpl.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/infrastructure/ChallengeReviewReaderImpl.java similarity index 91% rename from zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/infrastructure/adapter/ChallengeReviewReaderImpl.java rename to zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/infrastructure/ChallengeReviewReaderImpl.java index 26c5b6b..96db0e5 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/infrastructure/adapter/ChallengeReviewReaderImpl.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/infrastructure/ChallengeReviewReaderImpl.java @@ -1,10 +1,9 @@ -package org.haedal.zzansuni.userchallenge.infrastructure.adapter; +package org.haedal.zzansuni.challengereview.infrastructure; import com.querydsl.jpa.impl.JPAQueryFactory; import lombok.RequiredArgsConstructor; -import org.haedal.zzansuni.userchallenge.domain.port.ChallengeReviewReader; -import org.haedal.zzansuni.userchallenge.domain.ChallengeReview; -import org.haedal.zzansuni.userchallenge.infrastructure.ChallengeReviewRepository; +import org.haedal.zzansuni.challengereview.domain.ChallengeReview; +import org.haedal.zzansuni.challengereview.domain.ChallengeReviewReader; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.Pageable; @@ -12,7 +11,7 @@ import java.util.*; -import static org.haedal.zzansuni.userchallenge.domain.QChallengeReview.challengeReview; +import static org.haedal.zzansuni.challengereview.domain.QChallengeReview.challengeReview; @Component diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/infrastructure/ChallengeReviewRepository.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/infrastructure/ChallengeReviewRepository.java similarity index 74% rename from zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/infrastructure/ChallengeReviewRepository.java rename to zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/infrastructure/ChallengeReviewRepository.java index ba4d63d..fe88eb6 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/infrastructure/ChallengeReviewRepository.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/infrastructure/ChallengeReviewRepository.java @@ -1,6 +1,6 @@ -package org.haedal.zzansuni.userchallenge.infrastructure; +package org.haedal.zzansuni.challengereview.infrastructure; -import org.haedal.zzansuni.userchallenge.domain.ChallengeReview; +import org.haedal.zzansuni.challengereview.domain.ChallengeReview; import org.springframework.data.jpa.repository.JpaRepository; import java.util.List; diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/infrastructure/adapter/ChallengeReviewStoreImpl.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/infrastructure/ChallengeReviewStoreImpl.java similarity index 59% rename from zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/infrastructure/adapter/ChallengeReviewStoreImpl.java rename to zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/infrastructure/ChallengeReviewStoreImpl.java index bbbe4fb..ce8eb4f 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/infrastructure/adapter/ChallengeReviewStoreImpl.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/challengereview/infrastructure/ChallengeReviewStoreImpl.java @@ -1,9 +1,8 @@ -package org.haedal.zzansuni.userchallenge.infrastructure.adapter; +package org.haedal.zzansuni.challengereview.infrastructure; import lombok.RequiredArgsConstructor; -import org.haedal.zzansuni.userchallenge.domain.ChallengeReview; -import org.haedal.zzansuni.userchallenge.domain.port.ChallengeReviewStore; -import org.haedal.zzansuni.userchallenge.infrastructure.ChallengeReviewRepository; +import org.haedal.zzansuni.challengereview.domain.ChallengeReviewStore; +import org.haedal.zzansuni.challengereview.domain.ChallengeReview; import org.springframework.stereotype.Component; @Component diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/application/UserChallengeService.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/application/UserChallengeService.java index 26ae219..385d20b 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/application/UserChallengeService.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/application/UserChallengeService.java @@ -4,6 +4,7 @@ import java.util.Map; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.haedal.zzansuni.challengereview.domain.ChallengeReviewReader; import org.haedal.zzansuni.userchallenge.domain.port.UserChallengeReader; import org.haedal.zzansuni.userchallenge.domain.port.UserChallengeStore; import org.haedal.zzansuni.userchallenge.domain.port.ChallengeGroupUserExpStore; @@ -11,7 +12,6 @@ import org.haedal.zzansuni.challengegroup.domain.ChallengeCommand; import org.haedal.zzansuni.challengegroup.domain.application.ChallengeModel; import org.haedal.zzansuni.challengegroup.domain.port.ChallengeReader; -import org.haedal.zzansuni.userchallenge.domain.port.ChallengeReviewReader; import org.haedal.zzansuni.user.domain.User; import org.haedal.zzansuni.user.domain.UserReader; import org.haedal.zzansuni.userchallenge.domain.ChallengeGroupUserExp; diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/port/ChallengeReviewStore.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/port/ChallengeReviewStore.java deleted file mode 100644 index c766ddc..0000000 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/userchallenge/domain/port/ChallengeReviewStore.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.haedal.zzansuni.userchallenge.domain.port; - -import org.haedal.zzansuni.userchallenge.domain.ChallengeReview; - -public interface ChallengeReviewStore { - - ChallengeReview store(ChallengeReview challengeReview); - -} diff --git a/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/userchallenge/domain/application/RecordServiceTest.java b/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/userchallenge/domain/application/RecordServiceTest.java index 33c24ba..8d0c6d8 100644 --- a/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/userchallenge/domain/application/RecordServiceTest.java +++ b/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/userchallenge/domain/application/RecordServiceTest.java @@ -4,9 +4,12 @@ import org.haedal.zzansuni.challengegroup.domain.*; import org.haedal.zzansuni.challengegroup.domain.port.ChallengeReader; +import org.haedal.zzansuni.challengereview.domain.ChallengeReview; +import org.haedal.zzansuni.challengereview.domain.ChallengeReviewModel; +import org.haedal.zzansuni.challengereview.domain.ChallengeReviewService; import org.haedal.zzansuni.userchallenge.domain.*; -import org.haedal.zzansuni.userchallenge.domain.port.ChallengeReviewReader; -import org.haedal.zzansuni.userchallenge.domain.port.ChallengeReviewStore; +import org.haedal.zzansuni.challengereview.domain.ChallengeReviewReader; +import org.haedal.zzansuni.challengereview.domain.ChallengeReviewStore; import org.haedal.zzansuni.userchallenge.domain.port.ChallengeVerificationReader; import org.haedal.zzansuni.userchallenge.domain.port.UserChallengeReader; import org.haedal.zzansuni.user.domain.User; diff --git a/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/userchallenge/domain/application/UserRecordServiceTest.java b/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/userchallenge/domain/application/UserRecordServiceTest.java index b711d25..ec8aaa6 100644 --- a/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/userchallenge/domain/application/UserRecordServiceTest.java +++ b/zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/userchallenge/domain/application/UserRecordServiceTest.java @@ -11,7 +11,7 @@ import org.haedal.zzansuni.userchallenge.domain.ChallengeStatus; import org.haedal.zzansuni.userchallenge.domain.UserChallenge; import org.haedal.zzansuni.userchallenge.domain.port.ChallengeGroupUserExpStore; -import org.haedal.zzansuni.userchallenge.domain.port.ChallengeReviewReader; +import org.haedal.zzansuni.challengereview.domain.ChallengeReviewReader; import org.haedal.zzansuni.userchallenge.domain.port.UserChallengeReader; import org.haedal.zzansuni.userchallenge.domain.port.UserChallengeStore; import org.junit.jupiter.api.BeforeEach;