diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/comment/application/CommentEditor.java b/src/main/java/donggi/dev/kkeuroolryo/comment/application/CommentEditor.java similarity index 82% rename from src/main/java/donggi/dev/kkeuroolryo/core/comment/application/CommentEditor.java rename to src/main/java/donggi/dev/kkeuroolryo/comment/application/CommentEditor.java index f06bfa3..b6cb1b1 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/comment/application/CommentEditor.java +++ b/src/main/java/donggi/dev/kkeuroolryo/comment/application/CommentEditor.java @@ -1,7 +1,7 @@ -package donggi.dev.kkeuroolryo.core.comment.application; +package donggi.dev.kkeuroolryo.comment.application; -import donggi.dev.kkeuroolryo.core.comment.application.dto.CommentDto; -import donggi.dev.kkeuroolryo.web.comment.dto.CommentRegisterDto; +import donggi.dev.kkeuroolryo.comment.application.dto.CommentDto; +import donggi.dev.kkeuroolryo.comment.presentation.dto.CommentRegisterDto; public interface CommentEditor { diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/comment/application/CommentFinder.java b/src/main/java/donggi/dev/kkeuroolryo/comment/application/CommentFinder.java similarity index 61% rename from src/main/java/donggi/dev/kkeuroolryo/core/comment/application/CommentFinder.java rename to src/main/java/donggi/dev/kkeuroolryo/comment/application/CommentFinder.java index bd073ba..38fe791 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/comment/application/CommentFinder.java +++ b/src/main/java/donggi/dev/kkeuroolryo/comment/application/CommentFinder.java @@ -1,7 +1,7 @@ -package donggi.dev.kkeuroolryo.core.comment.application; +package donggi.dev.kkeuroolryo.comment.application; -import donggi.dev.kkeuroolryo.core.comment.application.dto.CommentPaginationDto; -import donggi.dev.kkeuroolryo.web.comment.dto.NoOffsetPageCommand; +import donggi.dev.kkeuroolryo.comment.application.dto.CommentPaginationDto; +import donggi.dev.kkeuroolryo.comment.presentation.dto.NoOffsetPageCommand; public interface CommentFinder { diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/comment/application/CommentService.java b/src/main/java/donggi/dev/kkeuroolryo/comment/application/CommentService.java similarity index 74% rename from src/main/java/donggi/dev/kkeuroolryo/core/comment/application/CommentService.java rename to src/main/java/donggi/dev/kkeuroolryo/comment/application/CommentService.java index 82cb113..86d79de 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/comment/application/CommentService.java +++ b/src/main/java/donggi/dev/kkeuroolryo/comment/application/CommentService.java @@ -1,15 +1,15 @@ -package donggi.dev.kkeuroolryo.core.comment.application; - -import donggi.dev.kkeuroolryo.core.comment.application.dto.CommentDto; -import donggi.dev.kkeuroolryo.core.comment.application.dto.CommentPaginationDto; -import donggi.dev.kkeuroolryo.core.comment.domain.Comment; -import donggi.dev.kkeuroolryo.core.comment.domain.CommentRepository; -import donggi.dev.kkeuroolryo.core.comment.domain.exception.CommentNotFoundException; -import donggi.dev.kkeuroolryo.core.comment.domain.exception.NoOffsetPageInvalidException; -import donggi.dev.kkeuroolryo.core.question.domain.QuestionRepository; -import donggi.dev.kkeuroolryo.core.question.domain.exception.QuestionNotFoundException; -import donggi.dev.kkeuroolryo.web.comment.dto.CommentRegisterDto; -import donggi.dev.kkeuroolryo.web.comment.dto.NoOffsetPageCommand; +package donggi.dev.kkeuroolryo.comment.application; + +import donggi.dev.kkeuroolryo.comment.application.dto.CommentDto; +import donggi.dev.kkeuroolryo.comment.application.dto.CommentPaginationDto; +import donggi.dev.kkeuroolryo.comment.domain.Comment; +import donggi.dev.kkeuroolryo.comment.domain.CommentRepository; +import donggi.dev.kkeuroolryo.comment.domain.exception.CommentNotFoundException; +import donggi.dev.kkeuroolryo.comment.domain.exception.NoOffsetPageInvalidException; +import donggi.dev.kkeuroolryo.question.domain.QuestionRepository; +import donggi.dev.kkeuroolryo.question.domain.exception.QuestionNotFoundException; +import donggi.dev.kkeuroolryo.comment.presentation.dto.CommentRegisterDto; +import donggi.dev.kkeuroolryo.comment.presentation.dto.NoOffsetPageCommand; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Slice; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/comment/application/dto/CommentDto.java b/src/main/java/donggi/dev/kkeuroolryo/comment/application/dto/CommentDto.java similarity index 79% rename from src/main/java/donggi/dev/kkeuroolryo/core/comment/application/dto/CommentDto.java rename to src/main/java/donggi/dev/kkeuroolryo/comment/application/dto/CommentDto.java index 11f5628..df6933e 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/comment/application/dto/CommentDto.java +++ b/src/main/java/donggi/dev/kkeuroolryo/comment/application/dto/CommentDto.java @@ -1,6 +1,6 @@ -package donggi.dev.kkeuroolryo.core.comment.application.dto; +package donggi.dev.kkeuroolryo.comment.application.dto; -import donggi.dev.kkeuroolryo.core.comment.domain.Comment; +import donggi.dev.kkeuroolryo.comment.domain.Comment; import lombok.Getter; @Getter diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/comment/application/dto/CommentPaginationDto.java b/src/main/java/donggi/dev/kkeuroolryo/comment/application/dto/CommentPaginationDto.java similarity index 85% rename from src/main/java/donggi/dev/kkeuroolryo/core/comment/application/dto/CommentPaginationDto.java rename to src/main/java/donggi/dev/kkeuroolryo/comment/application/dto/CommentPaginationDto.java index 9a1a62d..ecc7c81 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/comment/application/dto/CommentPaginationDto.java +++ b/src/main/java/donggi/dev/kkeuroolryo/comment/application/dto/CommentPaginationDto.java @@ -1,7 +1,7 @@ -package donggi.dev.kkeuroolryo.core.comment.application.dto; +package donggi.dev.kkeuroolryo.comment.application.dto; -import donggi.dev.kkeuroolryo.core.comment.domain.Comment; -import donggi.dev.kkeuroolryo.core.common.PageDto; +import donggi.dev.kkeuroolryo.comment.domain.Comment; +import donggi.dev.kkeuroolryo.common.PageDto; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/Comment.java b/src/main/java/donggi/dev/kkeuroolryo/comment/domain/Comment.java similarity index 87% rename from src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/Comment.java rename to src/main/java/donggi/dev/kkeuroolryo/comment/domain/Comment.java index ab1da2c..e8308c0 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/Comment.java +++ b/src/main/java/donggi/dev/kkeuroolryo/comment/domain/Comment.java @@ -1,7 +1,7 @@ -package donggi.dev.kkeuroolryo.core.comment.domain; +package donggi.dev.kkeuroolryo.comment.domain; -import donggi.dev.kkeuroolryo.core.comment.domain.exception.CommentUnauthorizedException; -import donggi.dev.kkeuroolryo.web.comment.dto.CommentRegisterDto; +import donggi.dev.kkeuroolryo.comment.domain.exception.CommentUnauthorizedException; +import donggi.dev.kkeuroolryo.comment.presentation.dto.CommentRegisterDto; import jakarta.persistence.Embedded; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/CommentContent.java b/src/main/java/donggi/dev/kkeuroolryo/comment/domain/CommentContent.java similarity index 83% rename from src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/CommentContent.java rename to src/main/java/donggi/dev/kkeuroolryo/comment/domain/CommentContent.java index 1ca91ce..13d2bdc 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/CommentContent.java +++ b/src/main/java/donggi/dev/kkeuroolryo/comment/domain/CommentContent.java @@ -1,6 +1,6 @@ -package donggi.dev.kkeuroolryo.core.comment.domain; +package donggi.dev.kkeuroolryo.comment.domain; -import donggi.dev.kkeuroolryo.core.comment.domain.exception.CommentInvalidContentException; +import donggi.dev.kkeuroolryo.comment.domain.exception.CommentInvalidContentException; import jakarta.persistence.Column; import jakarta.persistence.Embeddable; import java.util.Objects; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/CommentPassword.java b/src/main/java/donggi/dev/kkeuroolryo/comment/domain/CommentPassword.java similarity index 85% rename from src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/CommentPassword.java rename to src/main/java/donggi/dev/kkeuroolryo/comment/domain/CommentPassword.java index 0f74849..ff3d9b7 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/CommentPassword.java +++ b/src/main/java/donggi/dev/kkeuroolryo/comment/domain/CommentPassword.java @@ -1,6 +1,6 @@ -package donggi.dev.kkeuroolryo.core.comment.domain; +package donggi.dev.kkeuroolryo.comment.domain; -import donggi.dev.kkeuroolryo.core.comment.domain.exception.CommentInvalidPasswordException; +import donggi.dev.kkeuroolryo.comment.domain.exception.CommentInvalidPasswordException; import jakarta.persistence.Column; import jakarta.persistence.Embeddable; import java.util.Objects; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/CommentRepository.java b/src/main/java/donggi/dev/kkeuroolryo/comment/domain/CommentRepository.java similarity index 96% rename from src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/CommentRepository.java rename to src/main/java/donggi/dev/kkeuroolryo/comment/domain/CommentRepository.java index df6806e..7f186b2 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/CommentRepository.java +++ b/src/main/java/donggi/dev/kkeuroolryo/comment/domain/CommentRepository.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.comment.domain; +package donggi.dev.kkeuroolryo.comment.domain; import java.util.Optional; import org.springframework.data.domain.Pageable; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/CommentUsername.java b/src/main/java/donggi/dev/kkeuroolryo/comment/domain/CommentUsername.java similarity index 83% rename from src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/CommentUsername.java rename to src/main/java/donggi/dev/kkeuroolryo/comment/domain/CommentUsername.java index e1e6047..c156fd7 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/CommentUsername.java +++ b/src/main/java/donggi/dev/kkeuroolryo/comment/domain/CommentUsername.java @@ -1,6 +1,6 @@ -package donggi.dev.kkeuroolryo.core.comment.domain; +package donggi.dev.kkeuroolryo.comment.domain; -import donggi.dev.kkeuroolryo.core.comment.domain.exception.CommentInvalidUsernameException; +import donggi.dev.kkeuroolryo.comment.domain.exception.CommentInvalidUsernameException; import jakarta.persistence.Column; import jakarta.persistence.Embeddable; import java.util.Objects; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/exception/CommentInvalidContentException.java b/src/main/java/donggi/dev/kkeuroolryo/comment/domain/exception/CommentInvalidContentException.java similarity index 83% rename from src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/exception/CommentInvalidContentException.java rename to src/main/java/donggi/dev/kkeuroolryo/comment/domain/exception/CommentInvalidContentException.java index 0a02b54..18b1ce8 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/exception/CommentInvalidContentException.java +++ b/src/main/java/donggi/dev/kkeuroolryo/comment/domain/exception/CommentInvalidContentException.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.comment.domain.exception; +package donggi.dev.kkeuroolryo.comment.domain.exception; import donggi.dev.kkeuroolryo.common.exception.ErrorCodeAndMessage; import donggi.dev.kkeuroolryo.common.exception.GolrabaException; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/exception/CommentInvalidPasswordException.java b/src/main/java/donggi/dev/kkeuroolryo/comment/domain/exception/CommentInvalidPasswordException.java similarity index 83% rename from src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/exception/CommentInvalidPasswordException.java rename to src/main/java/donggi/dev/kkeuroolryo/comment/domain/exception/CommentInvalidPasswordException.java index ba860d4..ea2a5fd 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/exception/CommentInvalidPasswordException.java +++ b/src/main/java/donggi/dev/kkeuroolryo/comment/domain/exception/CommentInvalidPasswordException.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.comment.domain.exception; +package donggi.dev.kkeuroolryo.comment.domain.exception; import donggi.dev.kkeuroolryo.common.exception.ErrorCodeAndMessage; import donggi.dev.kkeuroolryo.common.exception.GolrabaException; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/exception/CommentInvalidUsernameException.java b/src/main/java/donggi/dev/kkeuroolryo/comment/domain/exception/CommentInvalidUsernameException.java similarity index 83% rename from src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/exception/CommentInvalidUsernameException.java rename to src/main/java/donggi/dev/kkeuroolryo/comment/domain/exception/CommentInvalidUsernameException.java index b1a87b0..37d68ea 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/exception/CommentInvalidUsernameException.java +++ b/src/main/java/donggi/dev/kkeuroolryo/comment/domain/exception/CommentInvalidUsernameException.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.comment.domain.exception; +package donggi.dev.kkeuroolryo.comment.domain.exception; import donggi.dev.kkeuroolryo.common.exception.ErrorCodeAndMessage; import donggi.dev.kkeuroolryo.common.exception.GolrabaException; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/exception/CommentNotFoundException.java b/src/main/java/donggi/dev/kkeuroolryo/comment/domain/exception/CommentNotFoundException.java similarity index 83% rename from src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/exception/CommentNotFoundException.java rename to src/main/java/donggi/dev/kkeuroolryo/comment/domain/exception/CommentNotFoundException.java index f080879..204d05f 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/exception/CommentNotFoundException.java +++ b/src/main/java/donggi/dev/kkeuroolryo/comment/domain/exception/CommentNotFoundException.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.comment.domain.exception; +package donggi.dev.kkeuroolryo.comment.domain.exception; import donggi.dev.kkeuroolryo.common.exception.ErrorCodeAndMessage; import donggi.dev.kkeuroolryo.common.exception.GolrabaException; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/exception/CommentUnauthorizedException.java b/src/main/java/donggi/dev/kkeuroolryo/comment/domain/exception/CommentUnauthorizedException.java similarity index 83% rename from src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/exception/CommentUnauthorizedException.java rename to src/main/java/donggi/dev/kkeuroolryo/comment/domain/exception/CommentUnauthorizedException.java index f61326d..f371697 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/exception/CommentUnauthorizedException.java +++ b/src/main/java/donggi/dev/kkeuroolryo/comment/domain/exception/CommentUnauthorizedException.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.comment.domain.exception; +package donggi.dev.kkeuroolryo.comment.domain.exception; import donggi.dev.kkeuroolryo.common.exception.ErrorCodeAndMessage; import donggi.dev.kkeuroolryo.common.exception.GolrabaException; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/exception/NoOffsetPageInvalidException.java b/src/main/java/donggi/dev/kkeuroolryo/comment/domain/exception/NoOffsetPageInvalidException.java similarity index 87% rename from src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/exception/NoOffsetPageInvalidException.java rename to src/main/java/donggi/dev/kkeuroolryo/comment/domain/exception/NoOffsetPageInvalidException.java index aba1a44..35226b6 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/comment/domain/exception/NoOffsetPageInvalidException.java +++ b/src/main/java/donggi/dev/kkeuroolryo/comment/domain/exception/NoOffsetPageInvalidException.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.comment.domain.exception; +package donggi.dev.kkeuroolryo.comment.domain.exception; import donggi.dev.kkeuroolryo.common.exception.ErrorCodeAndMessage; import donggi.dev.kkeuroolryo.common.exception.GolrabaException; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/comment/infrastructure/CommentJpaRepository.java b/src/main/java/donggi/dev/kkeuroolryo/comment/infrastructure/CommentJpaRepository.java similarity index 76% rename from src/main/java/donggi/dev/kkeuroolryo/core/comment/infrastructure/CommentJpaRepository.java rename to src/main/java/donggi/dev/kkeuroolryo/comment/infrastructure/CommentJpaRepository.java index ae56f53..41fe288 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/comment/infrastructure/CommentJpaRepository.java +++ b/src/main/java/donggi/dev/kkeuroolryo/comment/infrastructure/CommentJpaRepository.java @@ -1,8 +1,8 @@ -package donggi.dev.kkeuroolryo.core.comment.infrastructure; +package donggi.dev.kkeuroolryo.comment.infrastructure; -import donggi.dev.kkeuroolryo.core.comment.domain.Comment; -import donggi.dev.kkeuroolryo.core.comment.domain.CommentRepository; -import donggi.dev.kkeuroolryo.core.comment.domain.exception.CommentNotFoundException; +import donggi.dev.kkeuroolryo.comment.domain.Comment; +import donggi.dev.kkeuroolryo.comment.domain.CommentRepository; +import donggi.dev.kkeuroolryo.comment.domain.exception.CommentNotFoundException; import java.util.Optional; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Slice; diff --git a/src/main/java/donggi/dev/kkeuroolryo/web/comment/CommentRestController.java b/src/main/java/donggi/dev/kkeuroolryo/comment/presentation/CommentRestController.java similarity index 82% rename from src/main/java/donggi/dev/kkeuroolryo/web/comment/CommentRestController.java rename to src/main/java/donggi/dev/kkeuroolryo/comment/presentation/CommentRestController.java index e92c9ff..b80a134 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/web/comment/CommentRestController.java +++ b/src/main/java/donggi/dev/kkeuroolryo/comment/presentation/CommentRestController.java @@ -1,13 +1,13 @@ -package donggi.dev.kkeuroolryo.web.comment; +package donggi.dev.kkeuroolryo.comment.presentation; import donggi.dev.kkeuroolryo.common.response.ApiResponse; -import donggi.dev.kkeuroolryo.core.comment.application.CommentEditor; -import donggi.dev.kkeuroolryo.core.comment.application.CommentFinder; -import donggi.dev.kkeuroolryo.core.comment.application.dto.CommentDto; -import donggi.dev.kkeuroolryo.core.comment.application.dto.CommentPaginationDto; -import donggi.dev.kkeuroolryo.web.comment.dto.CommentDeleteCommand; -import donggi.dev.kkeuroolryo.web.comment.dto.CommentRegisterDto; -import donggi.dev.kkeuroolryo.web.comment.dto.NoOffsetPageCommand; +import donggi.dev.kkeuroolryo.comment.application.CommentEditor; +import donggi.dev.kkeuroolryo.comment.application.CommentFinder; +import donggi.dev.kkeuroolryo.comment.application.dto.CommentDto; +import donggi.dev.kkeuroolryo.comment.application.dto.CommentPaginationDto; +import donggi.dev.kkeuroolryo.comment.presentation.dto.CommentDeleteCommand; +import donggi.dev.kkeuroolryo.comment.presentation.dto.CommentRegisterDto; +import donggi.dev.kkeuroolryo.comment.presentation.dto.NoOffsetPageCommand; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; diff --git a/src/main/java/donggi/dev/kkeuroolryo/web/comment/dto/CommentDeleteCommand.java b/src/main/java/donggi/dev/kkeuroolryo/comment/presentation/dto/CommentDeleteCommand.java similarity index 81% rename from src/main/java/donggi/dev/kkeuroolryo/web/comment/dto/CommentDeleteCommand.java rename to src/main/java/donggi/dev/kkeuroolryo/comment/presentation/dto/CommentDeleteCommand.java index f0bea35..cb537cb 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/web/comment/dto/CommentDeleteCommand.java +++ b/src/main/java/donggi/dev/kkeuroolryo/comment/presentation/dto/CommentDeleteCommand.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.web.comment.dto; +package donggi.dev.kkeuroolryo.comment.presentation.dto; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/src/main/java/donggi/dev/kkeuroolryo/web/comment/dto/CommentRegisterDto.java b/src/main/java/donggi/dev/kkeuroolryo/comment/presentation/dto/CommentRegisterDto.java similarity index 82% rename from src/main/java/donggi/dev/kkeuroolryo/web/comment/dto/CommentRegisterDto.java rename to src/main/java/donggi/dev/kkeuroolryo/comment/presentation/dto/CommentRegisterDto.java index f28b18e..534a4c8 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/web/comment/dto/CommentRegisterDto.java +++ b/src/main/java/donggi/dev/kkeuroolryo/comment/presentation/dto/CommentRegisterDto.java @@ -1,6 +1,6 @@ -package donggi.dev.kkeuroolryo.web.comment.dto; +package donggi.dev.kkeuroolryo.comment.presentation.dto; -import donggi.dev.kkeuroolryo.core.comment.domain.Comment; +import donggi.dev.kkeuroolryo.comment.domain.Comment; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/src/main/java/donggi/dev/kkeuroolryo/web/comment/dto/NoOffsetPageCommand.java b/src/main/java/donggi/dev/kkeuroolryo/comment/presentation/dto/NoOffsetPageCommand.java similarity index 80% rename from src/main/java/donggi/dev/kkeuroolryo/web/comment/dto/NoOffsetPageCommand.java rename to src/main/java/donggi/dev/kkeuroolryo/comment/presentation/dto/NoOffsetPageCommand.java index e2fdb34..c8fef7f 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/web/comment/dto/NoOffsetPageCommand.java +++ b/src/main/java/donggi/dev/kkeuroolryo/comment/presentation/dto/NoOffsetPageCommand.java @@ -1,6 +1,6 @@ -package donggi.dev.kkeuroolryo.web.comment.dto; +package donggi.dev.kkeuroolryo.comment.presentation.dto; -import donggi.dev.kkeuroolryo.core.comment.domain.exception.NoOffsetPageInvalidException; +import donggi.dev.kkeuroolryo.comment.domain.exception.NoOffsetPageInvalidException; import lombok.Getter; @Getter diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/common/PageDto.java b/src/main/java/donggi/dev/kkeuroolryo/common/PageDto.java similarity index 87% rename from src/main/java/donggi/dev/kkeuroolryo/core/common/PageDto.java rename to src/main/java/donggi/dev/kkeuroolryo/common/PageDto.java index 75a2b80..e5b9e95 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/common/PageDto.java +++ b/src/main/java/donggi/dev/kkeuroolryo/common/PageDto.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.common; +package donggi.dev.kkeuroolryo.common; import lombok.Getter; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/question/application/QuestionEditor.java b/src/main/java/donggi/dev/kkeuroolryo/question/application/QuestionEditor.java similarity index 73% rename from src/main/java/donggi/dev/kkeuroolryo/core/question/application/QuestionEditor.java rename to src/main/java/donggi/dev/kkeuroolryo/question/application/QuestionEditor.java index 92724fd..a58ce79 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/question/application/QuestionEditor.java +++ b/src/main/java/donggi/dev/kkeuroolryo/question/application/QuestionEditor.java @@ -1,9 +1,8 @@ -package donggi.dev.kkeuroolryo.core.question.application; +package donggi.dev.kkeuroolryo.question.application; -import donggi.dev.kkeuroolryo.core.question.application.dto.QuestionDto; -import donggi.dev.kkeuroolryo.web.question.dto.QuestionActiveUpdateDto; -import donggi.dev.kkeuroolryo.web.question.dto.QuestionRegisterDto; -import donggi.dev.kkeuroolryo.web.question.dto.QuestionResultCommand; +import donggi.dev.kkeuroolryo.question.application.dto.QuestionDto; +import donggi.dev.kkeuroolryo.question.dto.QuestionRegisterDto; +import donggi.dev.kkeuroolryo.question.dto.QuestionResultCommand; public interface QuestionEditor { diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/question/application/QuestionFinder.java b/src/main/java/donggi/dev/kkeuroolryo/question/application/QuestionFinder.java similarity index 82% rename from src/main/java/donggi/dev/kkeuroolryo/core/question/application/QuestionFinder.java rename to src/main/java/donggi/dev/kkeuroolryo/question/application/QuestionFinder.java index 4512080..1d30a09 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/question/application/QuestionFinder.java +++ b/src/main/java/donggi/dev/kkeuroolryo/question/application/QuestionFinder.java @@ -1,10 +1,10 @@ -package donggi.dev.kkeuroolryo.core.question.application; +package donggi.dev.kkeuroolryo.question.application; -import donggi.dev.kkeuroolryo.core.question.application.dto.QuestionDto; -import donggi.dev.kkeuroolryo.core.question.application.dto.QuestionPaginationDto; -import donggi.dev.kkeuroolryo.core.question.application.dto.RandomQuestionsDto; -import donggi.dev.kkeuroolryo.core.question.domain.Category; -import donggi.dev.kkeuroolryo.web.comment.dto.NoOffsetPageCommand; +import donggi.dev.kkeuroolryo.question.application.dto.QuestionDto; +import donggi.dev.kkeuroolryo.question.application.dto.QuestionPaginationDto; +import donggi.dev.kkeuroolryo.question.application.dto.RandomQuestionsDto; +import donggi.dev.kkeuroolryo.question.domain.Category; +import donggi.dev.kkeuroolryo.comment.presentation.dto.NoOffsetPageCommand; public interface QuestionFinder { diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/question/application/QuestionService.java b/src/main/java/donggi/dev/kkeuroolryo/question/application/QuestionService.java similarity index 80% rename from src/main/java/donggi/dev/kkeuroolryo/core/question/application/QuestionService.java rename to src/main/java/donggi/dev/kkeuroolryo/question/application/QuestionService.java index 252f482..f9c7267 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/question/application/QuestionService.java +++ b/src/main/java/donggi/dev/kkeuroolryo/question/application/QuestionService.java @@ -1,24 +1,19 @@ -package donggi.dev.kkeuroolryo.core.question.application; - -import static donggi.dev.kkeuroolryo.core.question.domain.Category.COUPLE; -import static donggi.dev.kkeuroolryo.core.question.domain.Category.FRIEND; -import static donggi.dev.kkeuroolryo.core.question.domain.Category.RANDOM; -import static donggi.dev.kkeuroolryo.core.question.domain.Category.SELF; - -import donggi.dev.kkeuroolryo.core.comment.domain.exception.NoOffsetPageInvalidException; -import donggi.dev.kkeuroolryo.core.question.application.dto.QuestionDto; -import donggi.dev.kkeuroolryo.core.question.application.dto.QuestionPaginationDto; -import donggi.dev.kkeuroolryo.core.question.application.dto.RandomQuestionsDto; -import donggi.dev.kkeuroolryo.core.question.domain.Category; -import donggi.dev.kkeuroolryo.core.question.domain.Question; -import donggi.dev.kkeuroolryo.core.question.domain.QuestionRepository; -import donggi.dev.kkeuroolryo.core.question.domain.QuestionResult; -import donggi.dev.kkeuroolryo.core.question.domain.QuestionResultRepository; -import donggi.dev.kkeuroolryo.core.question.domain.exception.QuestionInvalidChoiceException; -import donggi.dev.kkeuroolryo.core.question.domain.exception.QuestionNotFoundException; -import donggi.dev.kkeuroolryo.web.comment.dto.NoOffsetPageCommand; -import donggi.dev.kkeuroolryo.web.question.dto.QuestionRegisterDto; -import donggi.dev.kkeuroolryo.web.question.dto.QuestionResultCommand; +package donggi.dev.kkeuroolryo.question.application; + +import donggi.dev.kkeuroolryo.comment.domain.exception.NoOffsetPageInvalidException; +import donggi.dev.kkeuroolryo.question.application.dto.QuestionDto; +import donggi.dev.kkeuroolryo.question.application.dto.QuestionPaginationDto; +import donggi.dev.kkeuroolryo.question.application.dto.RandomQuestionsDto; +import donggi.dev.kkeuroolryo.question.domain.Category; +import donggi.dev.kkeuroolryo.question.domain.Question; +import donggi.dev.kkeuroolryo.question.domain.QuestionRepository; +import donggi.dev.kkeuroolryo.question.domain.QuestionResult; +import donggi.dev.kkeuroolryo.question.domain.QuestionResultRepository; +import donggi.dev.kkeuroolryo.question.domain.exception.QuestionInvalidChoiceException; +import donggi.dev.kkeuroolryo.question.domain.exception.QuestionNotFoundException; +import donggi.dev.kkeuroolryo.comment.presentation.dto.NoOffsetPageCommand; +import donggi.dev.kkeuroolryo.question.dto.QuestionRegisterDto; +import donggi.dev.kkeuroolryo.question.dto.QuestionResultCommand; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -101,8 +96,8 @@ public RandomQuestionsDto getRandomQuestionsByCategory(Category category) { private List retrieveQuestionIdsByCategory(Category category) { List categories; - if (category.equals(RANDOM)) { - categories = Arrays.asList(FRIEND, SELF, COUPLE); + if (category.equals(Category.RANDOM)) { + categories = Arrays.asList(Category.FRIEND, Category.SELF, Category.COUPLE); } else { categories = Collections.singletonList(category); } diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/question/application/dto/QuestionDto.java b/src/main/java/donggi/dev/kkeuroolryo/question/application/dto/QuestionDto.java similarity index 87% rename from src/main/java/donggi/dev/kkeuroolryo/core/question/application/dto/QuestionDto.java rename to src/main/java/donggi/dev/kkeuroolryo/question/application/dto/QuestionDto.java index 78231a7..5143fa6 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/question/application/dto/QuestionDto.java +++ b/src/main/java/donggi/dev/kkeuroolryo/question/application/dto/QuestionDto.java @@ -1,8 +1,8 @@ -package donggi.dev.kkeuroolryo.core.question.application.dto; +package donggi.dev.kkeuroolryo.question.application.dto; -import donggi.dev.kkeuroolryo.core.question.domain.Category; -import donggi.dev.kkeuroolryo.core.question.domain.Question; -import donggi.dev.kkeuroolryo.core.question.domain.QuestionResult; +import donggi.dev.kkeuroolryo.question.domain.Category; +import donggi.dev.kkeuroolryo.question.domain.Question; +import donggi.dev.kkeuroolryo.question.domain.QuestionResult; import lombok.Getter; @Getter diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/question/application/dto/QuestionPaginationDto.java b/src/main/java/donggi/dev/kkeuroolryo/question/application/dto/QuestionPaginationDto.java similarity index 82% rename from src/main/java/donggi/dev/kkeuroolryo/core/question/application/dto/QuestionPaginationDto.java rename to src/main/java/donggi/dev/kkeuroolryo/question/application/dto/QuestionPaginationDto.java index eb6732a..7e4c114 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/question/application/dto/QuestionPaginationDto.java +++ b/src/main/java/donggi/dev/kkeuroolryo/question/application/dto/QuestionPaginationDto.java @@ -1,7 +1,7 @@ -package donggi.dev.kkeuroolryo.core.question.application.dto; +package donggi.dev.kkeuroolryo.question.application.dto; -import donggi.dev.kkeuroolryo.core.common.PageDto; -import donggi.dev.kkeuroolryo.core.question.domain.Question; +import donggi.dev.kkeuroolryo.common.PageDto; +import donggi.dev.kkeuroolryo.question.domain.Question; import java.util.List; import lombok.Getter; import org.springframework.data.domain.Slice; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/question/application/dto/RandomQuestionsDto.java b/src/main/java/donggi/dev/kkeuroolryo/question/application/dto/RandomQuestionsDto.java similarity index 80% rename from src/main/java/donggi/dev/kkeuroolryo/core/question/application/dto/RandomQuestionsDto.java rename to src/main/java/donggi/dev/kkeuroolryo/question/application/dto/RandomQuestionsDto.java index 7cc8af0..0a3dd78 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/question/application/dto/RandomQuestionsDto.java +++ b/src/main/java/donggi/dev/kkeuroolryo/question/application/dto/RandomQuestionsDto.java @@ -1,6 +1,6 @@ -package donggi.dev.kkeuroolryo.core.question.application.dto; +package donggi.dev.kkeuroolryo.question.application.dto; -import donggi.dev.kkeuroolryo.core.question.domain.Category; +import donggi.dev.kkeuroolryo.question.domain.Category; import java.util.ArrayList; import java.util.List; import lombok.Getter; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/question/domain/Category.java b/src/main/java/donggi/dev/kkeuroolryo/question/domain/Category.java similarity index 58% rename from src/main/java/donggi/dev/kkeuroolryo/core/question/domain/Category.java rename to src/main/java/donggi/dev/kkeuroolryo/question/domain/Category.java index 7e2b098..46b7a4a 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/question/domain/Category.java +++ b/src/main/java/donggi/dev/kkeuroolryo/question/domain/Category.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.question.domain; +package donggi.dev.kkeuroolryo.question.domain; public enum Category { SELF, COUPLE, FRIEND, RANDOM, USERMADE diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/question/domain/Question.java b/src/main/java/donggi/dev/kkeuroolryo/question/domain/Question.java similarity index 94% rename from src/main/java/donggi/dev/kkeuroolryo/core/question/domain/Question.java rename to src/main/java/donggi/dev/kkeuroolryo/question/domain/Question.java index 9e18d08..2754268 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/question/domain/Question.java +++ b/src/main/java/donggi/dev/kkeuroolryo/question/domain/Question.java @@ -1,6 +1,6 @@ -package donggi.dev.kkeuroolryo.core.question.domain; +package donggi.dev.kkeuroolryo.question.domain; -import donggi.dev.kkeuroolryo.web.question.dto.QuestionRegisterDto; +import donggi.dev.kkeuroolryo.question.dto.QuestionRegisterDto; import jakarta.persistence.AttributeOverride; import jakarta.persistence.AttributeOverrides; import jakarta.persistence.CascadeType; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/question/domain/QuestionChoice.java b/src/main/java/donggi/dev/kkeuroolryo/question/domain/QuestionChoice.java similarity index 81% rename from src/main/java/donggi/dev/kkeuroolryo/core/question/domain/QuestionChoice.java rename to src/main/java/donggi/dev/kkeuroolryo/question/domain/QuestionChoice.java index ee135a7..d403b08 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/question/domain/QuestionChoice.java +++ b/src/main/java/donggi/dev/kkeuroolryo/question/domain/QuestionChoice.java @@ -1,6 +1,6 @@ -package donggi.dev.kkeuroolryo.core.question.domain; +package donggi.dev.kkeuroolryo.question.domain; -import donggi.dev.kkeuroolryo.core.question.domain.exception.QuestionInvalidChoiceException; +import donggi.dev.kkeuroolryo.question.domain.exception.QuestionInvalidChoiceException; import jakarta.persistence.Column; import jakarta.persistence.Embeddable; import java.util.Objects; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/question/domain/QuestionContent.java b/src/main/java/donggi/dev/kkeuroolryo/question/domain/QuestionContent.java similarity index 83% rename from src/main/java/donggi/dev/kkeuroolryo/core/question/domain/QuestionContent.java rename to src/main/java/donggi/dev/kkeuroolryo/question/domain/QuestionContent.java index d42db63..4528d97 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/question/domain/QuestionContent.java +++ b/src/main/java/donggi/dev/kkeuroolryo/question/domain/QuestionContent.java @@ -1,6 +1,6 @@ -package donggi.dev.kkeuroolryo.core.question.domain; +package donggi.dev.kkeuroolryo.question.domain; -import donggi.dev.kkeuroolryo.core.question.domain.exception.QuestionInvalidContentException; +import donggi.dev.kkeuroolryo.question.domain.exception.QuestionInvalidContentException; import jakarta.persistence.Column; import jakarta.persistence.Embeddable; import java.util.Objects; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/question/domain/QuestionRepository.java b/src/main/java/donggi/dev/kkeuroolryo/question/domain/QuestionRepository.java similarity index 98% rename from src/main/java/donggi/dev/kkeuroolryo/core/question/domain/QuestionRepository.java rename to src/main/java/donggi/dev/kkeuroolryo/question/domain/QuestionRepository.java index 48a9947..b0c41ed 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/question/domain/QuestionRepository.java +++ b/src/main/java/donggi/dev/kkeuroolryo/question/domain/QuestionRepository.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.question.domain; +package donggi.dev.kkeuroolryo.question.domain; import java.util.List; import org.springframework.data.domain.Pageable; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/question/domain/QuestionResult.java b/src/main/java/donggi/dev/kkeuroolryo/question/domain/QuestionResult.java similarity index 95% rename from src/main/java/donggi/dev/kkeuroolryo/core/question/domain/QuestionResult.java rename to src/main/java/donggi/dev/kkeuroolryo/question/domain/QuestionResult.java index 3b565c6..259e21c 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/question/domain/QuestionResult.java +++ b/src/main/java/donggi/dev/kkeuroolryo/question/domain/QuestionResult.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.question.domain; +package donggi.dev.kkeuroolryo.question.domain; import jakarta.persistence.Column; import jakarta.persistence.Entity; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/question/domain/QuestionResultRepository.java b/src/main/java/donggi/dev/kkeuroolryo/question/domain/QuestionResultRepository.java similarity index 91% rename from src/main/java/donggi/dev/kkeuroolryo/core/question/domain/QuestionResultRepository.java rename to src/main/java/donggi/dev/kkeuroolryo/question/domain/QuestionResultRepository.java index 41fe6b5..2ceb275 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/question/domain/QuestionResultRepository.java +++ b/src/main/java/donggi/dev/kkeuroolryo/question/domain/QuestionResultRepository.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.question.domain; +package donggi.dev.kkeuroolryo.question.domain; import java.util.Optional; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/question/domain/exception/QuestionInvalidCategoryException.java b/src/main/java/donggi/dev/kkeuroolryo/question/domain/exception/QuestionInvalidCategoryException.java similarity index 83% rename from src/main/java/donggi/dev/kkeuroolryo/core/question/domain/exception/QuestionInvalidCategoryException.java rename to src/main/java/donggi/dev/kkeuroolryo/question/domain/exception/QuestionInvalidCategoryException.java index 064f5e4..c8fb3d8 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/question/domain/exception/QuestionInvalidCategoryException.java +++ b/src/main/java/donggi/dev/kkeuroolryo/question/domain/exception/QuestionInvalidCategoryException.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.question.domain.exception; +package donggi.dev.kkeuroolryo.question.domain.exception; import donggi.dev.kkeuroolryo.common.exception.ErrorCodeAndMessage; import donggi.dev.kkeuroolryo.common.exception.GolrabaException; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/question/domain/exception/QuestionInvalidChoiceException.java b/src/main/java/donggi/dev/kkeuroolryo/question/domain/exception/QuestionInvalidChoiceException.java similarity index 83% rename from src/main/java/donggi/dev/kkeuroolryo/core/question/domain/exception/QuestionInvalidChoiceException.java rename to src/main/java/donggi/dev/kkeuroolryo/question/domain/exception/QuestionInvalidChoiceException.java index a76b6e1..57df0f9 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/question/domain/exception/QuestionInvalidChoiceException.java +++ b/src/main/java/donggi/dev/kkeuroolryo/question/domain/exception/QuestionInvalidChoiceException.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.question.domain.exception; +package donggi.dev.kkeuroolryo.question.domain.exception; import donggi.dev.kkeuroolryo.common.exception.ErrorCodeAndMessage; import donggi.dev.kkeuroolryo.common.exception.GolrabaException; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/question/domain/exception/QuestionInvalidContentException.java b/src/main/java/donggi/dev/kkeuroolryo/question/domain/exception/QuestionInvalidContentException.java similarity index 83% rename from src/main/java/donggi/dev/kkeuroolryo/core/question/domain/exception/QuestionInvalidContentException.java rename to src/main/java/donggi/dev/kkeuroolryo/question/domain/exception/QuestionInvalidContentException.java index a609378..a8bd588 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/question/domain/exception/QuestionInvalidContentException.java +++ b/src/main/java/donggi/dev/kkeuroolryo/question/domain/exception/QuestionInvalidContentException.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.question.domain.exception; +package donggi.dev.kkeuroolryo.question.domain.exception; import donggi.dev.kkeuroolryo.common.exception.ErrorCodeAndMessage; import donggi.dev.kkeuroolryo.common.exception.GolrabaException; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/question/domain/exception/QuestionNotFoundException.java b/src/main/java/donggi/dev/kkeuroolryo/question/domain/exception/QuestionNotFoundException.java similarity index 82% rename from src/main/java/donggi/dev/kkeuroolryo/core/question/domain/exception/QuestionNotFoundException.java rename to src/main/java/donggi/dev/kkeuroolryo/question/domain/exception/QuestionNotFoundException.java index ccfa44c..b041f52 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/question/domain/exception/QuestionNotFoundException.java +++ b/src/main/java/donggi/dev/kkeuroolryo/question/domain/exception/QuestionNotFoundException.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.question.domain.exception; +package donggi.dev.kkeuroolryo.question.domain.exception; import donggi.dev.kkeuroolryo.common.exception.ErrorCodeAndMessage; import donggi.dev.kkeuroolryo.common.exception.GolrabaException; diff --git a/src/main/java/donggi/dev/kkeuroolryo/web/question/dto/QuestionActiveUpdateDto.java b/src/main/java/donggi/dev/kkeuroolryo/question/dto/QuestionActiveUpdateDto.java similarity index 56% rename from src/main/java/donggi/dev/kkeuroolryo/web/question/dto/QuestionActiveUpdateDto.java rename to src/main/java/donggi/dev/kkeuroolryo/question/dto/QuestionActiveUpdateDto.java index a3a7aaf..28f712b 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/web/question/dto/QuestionActiveUpdateDto.java +++ b/src/main/java/donggi/dev/kkeuroolryo/question/dto/QuestionActiveUpdateDto.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.web.question.dto; +package donggi.dev.kkeuroolryo.question.dto; public record QuestionActiveUpdateDto( boolean active diff --git a/src/main/java/donggi/dev/kkeuroolryo/web/question/dto/QuestionRegisterDto.java b/src/main/java/donggi/dev/kkeuroolryo/question/dto/QuestionRegisterDto.java similarity index 58% rename from src/main/java/donggi/dev/kkeuroolryo/web/question/dto/QuestionRegisterDto.java rename to src/main/java/donggi/dev/kkeuroolryo/question/dto/QuestionRegisterDto.java index cb6b7a4..1a4206a 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/web/question/dto/QuestionRegisterDto.java +++ b/src/main/java/donggi/dev/kkeuroolryo/question/dto/QuestionRegisterDto.java @@ -1,7 +1,7 @@ -package donggi.dev.kkeuroolryo.web.question.dto; +package donggi.dev.kkeuroolryo.question.dto; -import donggi.dev.kkeuroolryo.core.question.domain.Category; -import donggi.dev.kkeuroolryo.core.question.domain.Question; +import donggi.dev.kkeuroolryo.question.domain.Category; +import donggi.dev.kkeuroolryo.question.domain.Question; public record QuestionRegisterDto( String content, diff --git a/src/main/java/donggi/dev/kkeuroolryo/web/question/dto/QuestionResultCommand.java b/src/main/java/donggi/dev/kkeuroolryo/question/dto/QuestionResultCommand.java similarity index 92% rename from src/main/java/donggi/dev/kkeuroolryo/web/question/dto/QuestionResultCommand.java rename to src/main/java/donggi/dev/kkeuroolryo/question/dto/QuestionResultCommand.java index adffe5e..3bb4e4a 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/web/question/dto/QuestionResultCommand.java +++ b/src/main/java/donggi/dev/kkeuroolryo/question/dto/QuestionResultCommand.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.web.question.dto; +package donggi.dev.kkeuroolryo.question.dto; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/question/infrastructure/QuestionJpaRepository.java b/src/main/java/donggi/dev/kkeuroolryo/question/infrastructure/QuestionJpaRepository.java similarity index 85% rename from src/main/java/donggi/dev/kkeuroolryo/core/question/infrastructure/QuestionJpaRepository.java rename to src/main/java/donggi/dev/kkeuroolryo/question/infrastructure/QuestionJpaRepository.java index ec005a9..53b5a87 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/question/infrastructure/QuestionJpaRepository.java +++ b/src/main/java/donggi/dev/kkeuroolryo/question/infrastructure/QuestionJpaRepository.java @@ -1,9 +1,9 @@ -package donggi.dev.kkeuroolryo.core.question.infrastructure; +package donggi.dev.kkeuroolryo.question.infrastructure; -import donggi.dev.kkeuroolryo.core.question.domain.Category; -import donggi.dev.kkeuroolryo.core.question.domain.Question; -import donggi.dev.kkeuroolryo.core.question.domain.QuestionRepository; -import donggi.dev.kkeuroolryo.core.question.domain.exception.QuestionNotFoundException; +import donggi.dev.kkeuroolryo.question.domain.Category; +import donggi.dev.kkeuroolryo.question.domain.Question; +import donggi.dev.kkeuroolryo.question.domain.QuestionRepository; +import donggi.dev.kkeuroolryo.question.domain.exception.QuestionNotFoundException; import java.util.List; import java.util.Optional; import org.springframework.data.domain.Pageable; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/question/infrastructure/QuestionResultJpaRepository.java b/src/main/java/donggi/dev/kkeuroolryo/question/infrastructure/QuestionResultJpaRepository.java similarity index 61% rename from src/main/java/donggi/dev/kkeuroolryo/core/question/infrastructure/QuestionResultJpaRepository.java rename to src/main/java/donggi/dev/kkeuroolryo/question/infrastructure/QuestionResultJpaRepository.java index e60dcdb..41ccb40 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/question/infrastructure/QuestionResultJpaRepository.java +++ b/src/main/java/donggi/dev/kkeuroolryo/question/infrastructure/QuestionResultJpaRepository.java @@ -1,7 +1,7 @@ -package donggi.dev.kkeuroolryo.core.question.infrastructure; +package donggi.dev.kkeuroolryo.question.infrastructure; -import donggi.dev.kkeuroolryo.core.question.domain.QuestionResult; -import donggi.dev.kkeuroolryo.core.question.domain.QuestionResultRepository; +import donggi.dev.kkeuroolryo.question.domain.QuestionResult; +import donggi.dev.kkeuroolryo.question.domain.QuestionResultRepository; import jakarta.persistence.LockModeType; import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; @@ -9,7 +9,8 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; -public interface QuestionResultJpaRepository extends QuestionResultRepository, JpaRepository { +public interface QuestionResultJpaRepository extends + QuestionResultRepository, JpaRepository { @Lock(value = LockModeType.PESSIMISTIC_WRITE) @Query("select qr from QuestionResult qr where qr.question.id = :id") diff --git a/src/main/java/donggi/dev/kkeuroolryo/question/presentation/QuestionRestController.java b/src/main/java/donggi/dev/kkeuroolryo/question/presentation/QuestionRestController.java new file mode 100644 index 0000000..8f64ef1 --- /dev/null +++ b/src/main/java/donggi/dev/kkeuroolryo/question/presentation/QuestionRestController.java @@ -0,0 +1,58 @@ +package donggi.dev.kkeuroolryo.question.presentation; + +import donggi.dev.kkeuroolryo.common.response.ApiResponse; +import donggi.dev.kkeuroolryo.question.application.QuestionEditor; +import donggi.dev.kkeuroolryo.question.application.QuestionFinder; +import donggi.dev.kkeuroolryo.question.application.dto.QuestionDto; +import donggi.dev.kkeuroolryo.question.application.dto.RandomQuestionsDto; +import donggi.dev.kkeuroolryo.question.domain.Category; +import donggi.dev.kkeuroolryo.question.dto.QuestionRegisterDto; +import donggi.dev.kkeuroolryo.question.dto.QuestionResultCommand; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +@RequestMapping("/api/golrabas") +public class QuestionRestController { + + private final QuestionFinder questionFinder; + private final QuestionEditor questionEditor; + + @PostMapping("/question") + public ApiResponse register(@RequestBody QuestionRegisterDto questionRegisterDto) { + QuestionDto questionDto = questionEditor.save(questionRegisterDto); + return ApiResponse.success(questionDto); + } + + @PutMapping("/question/{questionId}") + public ApiResponse modify(@PathVariable("questionId") Long questionId, + @RequestBody QuestionRegisterDto questionRegisterDto) { + questionEditor.modify(questionId, questionRegisterDto); + return ApiResponse.success(); + } + + @PostMapping("/result") + public ApiResponse register(@RequestBody QuestionResultCommand resultCommand) { + questionEditor.result(resultCommand); + return ApiResponse.success(); + } + + @GetMapping("/category/{category}") + public ApiResponse getQuestionIdsByCategory(@PathVariable("category") Category category) { + RandomQuestionsDto randomQuestionsDto = questionFinder.getRandomQuestionsByCategory(category); + return ApiResponse.success(randomQuestionsDto); + } + + @GetMapping("/question/{questionId}") + public ApiResponse getQuestion(@PathVariable("questionId") Long questionId) { + QuestionDto questionDto = questionFinder.getQuestion(questionId); + return ApiResponse.success(questionDto); + } +} diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/url/application/Base62Util.java b/src/main/java/donggi/dev/kkeuroolryo/url/application/Base62Util.java similarity index 93% rename from src/main/java/donggi/dev/kkeuroolryo/core/url/application/Base62Util.java rename to src/main/java/donggi/dev/kkeuroolryo/url/application/Base62Util.java index 7e33935..536eb52 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/url/application/Base62Util.java +++ b/src/main/java/donggi/dev/kkeuroolryo/url/application/Base62Util.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.url.application; +package donggi.dev.kkeuroolryo.url.application; import org.springframework.stereotype.Component; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/url/application/ShortUrlService.java b/src/main/java/donggi/dev/kkeuroolryo/url/application/ShortUrlService.java similarity index 70% rename from src/main/java/donggi/dev/kkeuroolryo/core/url/application/ShortUrlService.java rename to src/main/java/donggi/dev/kkeuroolryo/url/application/ShortUrlService.java index a68f090..a61c532 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/url/application/ShortUrlService.java +++ b/src/main/java/donggi/dev/kkeuroolryo/url/application/ShortUrlService.java @@ -1,10 +1,10 @@ -package donggi.dev.kkeuroolryo.core.url.application; +package donggi.dev.kkeuroolryo.url.application; -import donggi.dev.kkeuroolryo.core.url.domain.ShortUrlJpaRepository; -import donggi.dev.kkeuroolryo.core.url.domain.Url; -import donggi.dev.kkeuroolryo.core.url.dto.ShortUrlDto; -import donggi.dev.kkeuroolryo.core.url.dto.ShortUrlResponseDto; -import donggi.dev.kkeuroolryo.web.url.dto.ShortUrlRequestDto; +import donggi.dev.kkeuroolryo.url.infrastructure.ShortUrlJpaRepository; +import donggi.dev.kkeuroolryo.url.domain.Url; +import donggi.dev.kkeuroolryo.url.application.dto.ShortUrlDto; +import donggi.dev.kkeuroolryo.url.application.dto.ShortUrlResponseDto; +import donggi.dev.kkeuroolryo.url.presentation.dto.ShortUrlRequestDto; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/url/dto/ShortUrlDto.java b/src/main/java/donggi/dev/kkeuroolryo/url/application/dto/ShortUrlDto.java similarity index 52% rename from src/main/java/donggi/dev/kkeuroolryo/core/url/dto/ShortUrlDto.java rename to src/main/java/donggi/dev/kkeuroolryo/url/application/dto/ShortUrlDto.java index 3b6f6f9..3b6530a 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/url/dto/ShortUrlDto.java +++ b/src/main/java/donggi/dev/kkeuroolryo/url/application/dto/ShortUrlDto.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.url.dto; +package donggi.dev.kkeuroolryo.url.application.dto; public record ShortUrlDto( String originalData diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/url/dto/ShortUrlResponseDto.java b/src/main/java/donggi/dev/kkeuroolryo/url/application/dto/ShortUrlResponseDto.java similarity index 54% rename from src/main/java/donggi/dev/kkeuroolryo/core/url/dto/ShortUrlResponseDto.java rename to src/main/java/donggi/dev/kkeuroolryo/url/application/dto/ShortUrlResponseDto.java index cf91928..9d9c6de 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/url/dto/ShortUrlResponseDto.java +++ b/src/main/java/donggi/dev/kkeuroolryo/url/application/dto/ShortUrlResponseDto.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.url.dto; +package donggi.dev.kkeuroolryo.url.application.dto; public record ShortUrlResponseDto( String shortUrl diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/url/domain/Url.java b/src/main/java/donggi/dev/kkeuroolryo/url/domain/Url.java similarity index 94% rename from src/main/java/donggi/dev/kkeuroolryo/core/url/domain/Url.java rename to src/main/java/donggi/dev/kkeuroolryo/url/domain/Url.java index b4a0834..ad9f43e 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/url/domain/Url.java +++ b/src/main/java/donggi/dev/kkeuroolryo/url/domain/Url.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.url.domain; +package donggi.dev.kkeuroolryo.url.domain; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/url/domain/exception/UrlNotFoundException.java b/src/main/java/donggi/dev/kkeuroolryo/url/domain/exception/UrlNotFoundException.java similarity index 83% rename from src/main/java/donggi/dev/kkeuroolryo/core/url/domain/exception/UrlNotFoundException.java rename to src/main/java/donggi/dev/kkeuroolryo/url/domain/exception/UrlNotFoundException.java index 1c6e0f2..3da4d3a 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/url/domain/exception/UrlNotFoundException.java +++ b/src/main/java/donggi/dev/kkeuroolryo/url/domain/exception/UrlNotFoundException.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.url.domain.exception; +package donggi.dev.kkeuroolryo.url.domain.exception; import donggi.dev.kkeuroolryo.common.exception.ErrorCodeAndMessage; import donggi.dev.kkeuroolryo.common.exception.GolrabaException; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/url/domain/ShortUrlJpaRepository.java b/src/main/java/donggi/dev/kkeuroolryo/url/infrastructure/ShortUrlJpaRepository.java similarity index 59% rename from src/main/java/donggi/dev/kkeuroolryo/core/url/domain/ShortUrlJpaRepository.java rename to src/main/java/donggi/dev/kkeuroolryo/url/infrastructure/ShortUrlJpaRepository.java index 3713434..973cabe 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/url/domain/ShortUrlJpaRepository.java +++ b/src/main/java/donggi/dev/kkeuroolryo/url/infrastructure/ShortUrlJpaRepository.java @@ -1,6 +1,7 @@ -package donggi.dev.kkeuroolryo.core.url.domain; +package donggi.dev.kkeuroolryo.url.infrastructure; -import donggi.dev.kkeuroolryo.core.url.domain.exception.UrlNotFoundException; +import donggi.dev.kkeuroolryo.url.domain.Url; +import donggi.dev.kkeuroolryo.url.domain.exception.UrlNotFoundException; import org.springframework.data.jpa.repository.JpaRepository; public interface ShortUrlJpaRepository extends JpaRepository { diff --git a/src/main/java/donggi/dev/kkeuroolryo/web/url/ShortUrlRestController.java b/src/main/java/donggi/dev/kkeuroolryo/url/presentation/ShortUrlRestController.java similarity index 78% rename from src/main/java/donggi/dev/kkeuroolryo/web/url/ShortUrlRestController.java rename to src/main/java/donggi/dev/kkeuroolryo/url/presentation/ShortUrlRestController.java index de2684e..e251a39 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/web/url/ShortUrlRestController.java +++ b/src/main/java/donggi/dev/kkeuroolryo/url/presentation/ShortUrlRestController.java @@ -1,10 +1,10 @@ -package donggi.dev.kkeuroolryo.web.url; +package donggi.dev.kkeuroolryo.url.presentation; import donggi.dev.kkeuroolryo.common.response.ApiResponse; -import donggi.dev.kkeuroolryo.core.url.application.ShortUrlService; -import donggi.dev.kkeuroolryo.core.url.dto.ShortUrlDto; -import donggi.dev.kkeuroolryo.core.url.dto.ShortUrlResponseDto; -import donggi.dev.kkeuroolryo.web.url.dto.ShortUrlRequestDto; +import donggi.dev.kkeuroolryo.url.application.ShortUrlService; +import donggi.dev.kkeuroolryo.url.application.dto.ShortUrlDto; +import donggi.dev.kkeuroolryo.url.application.dto.ShortUrlResponseDto; +import donggi.dev.kkeuroolryo.url.presentation.dto.ShortUrlRequestDto; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; diff --git a/src/main/java/donggi/dev/kkeuroolryo/web/url/dto/ShortUrlRequestDto.java b/src/main/java/donggi/dev/kkeuroolryo/url/presentation/dto/ShortUrlRequestDto.java similarity index 59% rename from src/main/java/donggi/dev/kkeuroolryo/web/url/dto/ShortUrlRequestDto.java rename to src/main/java/donggi/dev/kkeuroolryo/url/presentation/dto/ShortUrlRequestDto.java index ab61cac..b21660d 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/web/url/dto/ShortUrlRequestDto.java +++ b/src/main/java/donggi/dev/kkeuroolryo/url/presentation/dto/ShortUrlRequestDto.java @@ -1,6 +1,6 @@ -package donggi.dev.kkeuroolryo.web.url.dto; +package donggi.dev.kkeuroolryo.url.presentation.dto; -import donggi.dev.kkeuroolryo.core.url.domain.Url; +import donggi.dev.kkeuroolryo.url.domain.Url; public record ShortUrlRequestDto( String originalData diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/user/JwtProvider.java b/src/main/java/donggi/dev/kkeuroolryo/user/application/JwtProvider.java similarity index 93% rename from src/main/java/donggi/dev/kkeuroolryo/core/user/JwtProvider.java rename to src/main/java/donggi/dev/kkeuroolryo/user/application/JwtProvider.java index 44bbd9c..2148d76 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/user/JwtProvider.java +++ b/src/main/java/donggi/dev/kkeuroolryo/user/application/JwtProvider.java @@ -1,6 +1,6 @@ -package donggi.dev.kkeuroolryo.core.user; +package donggi.dev.kkeuroolryo.user.application; -import donggi.dev.kkeuroolryo.core.user.application.dto.LoginTokens; +import donggi.dev.kkeuroolryo.user.application.dto.LoginTokens; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureAlgorithm; import io.jsonwebtoken.security.Keys; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/user/application/UserService.java b/src/main/java/donggi/dev/kkeuroolryo/user/application/UserService.java similarity index 65% rename from src/main/java/donggi/dev/kkeuroolryo/core/user/application/UserService.java rename to src/main/java/donggi/dev/kkeuroolryo/user/application/UserService.java index 9967eff..612a55a 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/user/application/UserService.java +++ b/src/main/java/donggi/dev/kkeuroolryo/user/application/UserService.java @@ -1,14 +1,13 @@ -package donggi.dev.kkeuroolryo.core.user.application; - -import donggi.dev.kkeuroolryo.core.user.JwtProvider; -import donggi.dev.kkeuroolryo.core.user.application.dto.LoginTokens; -import donggi.dev.kkeuroolryo.core.user.domain.RefreshToken; -import donggi.dev.kkeuroolryo.core.user.domain.RefreshTokenRepository; -import donggi.dev.kkeuroolryo.core.user.domain.User; -import donggi.dev.kkeuroolryo.core.user.domain.UserRepository; -import donggi.dev.kkeuroolryo.core.user.domain.exception.DuplicatedLoginIdException; -import donggi.dev.kkeuroolryo.web.user.dto.LoginRequestDto; -import donggi.dev.kkeuroolryo.web.user.dto.SignupRequestDto; +package donggi.dev.kkeuroolryo.user.application; + +import donggi.dev.kkeuroolryo.user.application.dto.LoginTokens; +import donggi.dev.kkeuroolryo.user.domain.RefreshToken; +import donggi.dev.kkeuroolryo.user.domain.RefreshTokenRepository; +import donggi.dev.kkeuroolryo.user.domain.User; +import donggi.dev.kkeuroolryo.user.domain.UserRepository; +import donggi.dev.kkeuroolryo.user.domain.exception.DuplicatedLoginIdException; +import donggi.dev.kkeuroolryo.user.presentation.dto.LoginRequestDto; +import donggi.dev.kkeuroolryo.user.presentation.dto.SignupRequestDto; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/user/application/dto/LoginResponseDto.java b/src/main/java/donggi/dev/kkeuroolryo/user/application/dto/LoginResponseDto.java similarity index 65% rename from src/main/java/donggi/dev/kkeuroolryo/core/user/application/dto/LoginResponseDto.java rename to src/main/java/donggi/dev/kkeuroolryo/user/application/dto/LoginResponseDto.java index b41040c..6232c3b 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/user/application/dto/LoginResponseDto.java +++ b/src/main/java/donggi/dev/kkeuroolryo/user/application/dto/LoginResponseDto.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.user.application.dto; +package donggi.dev.kkeuroolryo.user.application.dto; public record LoginResponseDto( String loginId, diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/user/application/dto/LoginTokens.java b/src/main/java/donggi/dev/kkeuroolryo/user/application/dto/LoginTokens.java similarity index 58% rename from src/main/java/donggi/dev/kkeuroolryo/core/user/application/dto/LoginTokens.java rename to src/main/java/donggi/dev/kkeuroolryo/user/application/dto/LoginTokens.java index ebc7a75..b66602c 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/user/application/dto/LoginTokens.java +++ b/src/main/java/donggi/dev/kkeuroolryo/user/application/dto/LoginTokens.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.user.application.dto; +package donggi.dev.kkeuroolryo.user.application.dto; public record LoginTokens( String accessToken, diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/user/domain/RefreshToken.java b/src/main/java/donggi/dev/kkeuroolryo/user/domain/RefreshToken.java similarity index 91% rename from src/main/java/donggi/dev/kkeuroolryo/core/user/domain/RefreshToken.java rename to src/main/java/donggi/dev/kkeuroolryo/user/domain/RefreshToken.java index ed96476..48edd73 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/user/domain/RefreshToken.java +++ b/src/main/java/donggi/dev/kkeuroolryo/user/domain/RefreshToken.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.user.domain; +package donggi.dev.kkeuroolryo.user.domain; import jakarta.persistence.Column; import jakarta.persistence.Entity; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/user/domain/RefreshTokenRepository.java b/src/main/java/donggi/dev/kkeuroolryo/user/domain/RefreshTokenRepository.java similarity index 83% rename from src/main/java/donggi/dev/kkeuroolryo/core/user/domain/RefreshTokenRepository.java rename to src/main/java/donggi/dev/kkeuroolryo/user/domain/RefreshTokenRepository.java index 5f2acff..c89cc7f 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/user/domain/RefreshTokenRepository.java +++ b/src/main/java/donggi/dev/kkeuroolryo/user/domain/RefreshTokenRepository.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.user.domain; +package donggi.dev.kkeuroolryo.user.domain; public interface RefreshTokenRepository { diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/user/domain/User.java b/src/main/java/donggi/dev/kkeuroolryo/user/domain/User.java similarity index 87% rename from src/main/java/donggi/dev/kkeuroolryo/core/user/domain/User.java rename to src/main/java/donggi/dev/kkeuroolryo/user/domain/User.java index 3490de6..e2a4267 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/user/domain/User.java +++ b/src/main/java/donggi/dev/kkeuroolryo/user/domain/User.java @@ -1,6 +1,6 @@ -package donggi.dev.kkeuroolryo.core.user.domain; +package donggi.dev.kkeuroolryo.user.domain; -import donggi.dev.kkeuroolryo.core.user.domain.exception.InvalidPasswordException; +import donggi.dev.kkeuroolryo.user.domain.exception.InvalidPasswordException; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; @@ -26,11 +26,15 @@ public class User { @Column(unique = true, length = 20) private String loginId; - @Column(length = 100, nullable = false) + + @Column(nullable = false, length = 100) private String password; + private boolean active; + @CreationTimestamp private LocalDateTime createdAt; + @UpdateTimestamp private LocalDateTime updatedAt; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/user/domain/UserRepository.java b/src/main/java/donggi/dev/kkeuroolryo/user/domain/UserRepository.java similarity index 93% rename from src/main/java/donggi/dev/kkeuroolryo/core/user/domain/UserRepository.java rename to src/main/java/donggi/dev/kkeuroolryo/user/domain/UserRepository.java index 9f5b7fd..2d6c911 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/user/domain/UserRepository.java +++ b/src/main/java/donggi/dev/kkeuroolryo/user/domain/UserRepository.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.user.domain; +package donggi.dev.kkeuroolryo.user.domain; public interface UserRepository { diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/user/domain/exception/DuplicatedLoginIdException.java b/src/main/java/donggi/dev/kkeuroolryo/user/domain/exception/DuplicatedLoginIdException.java similarity index 83% rename from src/main/java/donggi/dev/kkeuroolryo/core/user/domain/exception/DuplicatedLoginIdException.java rename to src/main/java/donggi/dev/kkeuroolryo/user/domain/exception/DuplicatedLoginIdException.java index 8a96b8a..bf23071 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/user/domain/exception/DuplicatedLoginIdException.java +++ b/src/main/java/donggi/dev/kkeuroolryo/user/domain/exception/DuplicatedLoginIdException.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.user.domain.exception; +package donggi.dev.kkeuroolryo.user.domain.exception; import donggi.dev.kkeuroolryo.common.exception.ErrorCodeAndMessage; import donggi.dev.kkeuroolryo.common.exception.GolrabaException; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/user/domain/exception/InvalidPasswordException.java b/src/main/java/donggi/dev/kkeuroolryo/user/domain/exception/InvalidPasswordException.java similarity index 83% rename from src/main/java/donggi/dev/kkeuroolryo/core/user/domain/exception/InvalidPasswordException.java rename to src/main/java/donggi/dev/kkeuroolryo/user/domain/exception/InvalidPasswordException.java index ed0cad7..6e53309 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/user/domain/exception/InvalidPasswordException.java +++ b/src/main/java/donggi/dev/kkeuroolryo/user/domain/exception/InvalidPasswordException.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.user.domain.exception; +package donggi.dev.kkeuroolryo.user.domain.exception; import donggi.dev.kkeuroolryo.common.exception.ErrorCodeAndMessage; import donggi.dev.kkeuroolryo.common.exception.GolrabaException; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/user/domain/exception/UserNotFoundException.java b/src/main/java/donggi/dev/kkeuroolryo/user/domain/exception/UserNotFoundException.java similarity index 83% rename from src/main/java/donggi/dev/kkeuroolryo/core/user/domain/exception/UserNotFoundException.java rename to src/main/java/donggi/dev/kkeuroolryo/user/domain/exception/UserNotFoundException.java index 80cdfb1..e672619 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/user/domain/exception/UserNotFoundException.java +++ b/src/main/java/donggi/dev/kkeuroolryo/user/domain/exception/UserNotFoundException.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.core.user.domain.exception; +package donggi.dev.kkeuroolryo.user.domain.exception; import donggi.dev.kkeuroolryo.common.exception.ErrorCodeAndMessage; import donggi.dev.kkeuroolryo.common.exception.GolrabaException; diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/user/infrastructure/RefreshTokenJpaRepository.java b/src/main/java/donggi/dev/kkeuroolryo/user/infrastructure/RefreshTokenJpaRepository.java similarity index 55% rename from src/main/java/donggi/dev/kkeuroolryo/core/user/infrastructure/RefreshTokenJpaRepository.java rename to src/main/java/donggi/dev/kkeuroolryo/user/infrastructure/RefreshTokenJpaRepository.java index a0bfec6..04e7e84 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/user/infrastructure/RefreshTokenJpaRepository.java +++ b/src/main/java/donggi/dev/kkeuroolryo/user/infrastructure/RefreshTokenJpaRepository.java @@ -1,7 +1,7 @@ -package donggi.dev.kkeuroolryo.core.user.infrastructure; +package donggi.dev.kkeuroolryo.user.infrastructure; -import donggi.dev.kkeuroolryo.core.user.domain.RefreshToken; -import donggi.dev.kkeuroolryo.core.user.domain.RefreshTokenRepository; +import donggi.dev.kkeuroolryo.user.domain.RefreshToken; +import donggi.dev.kkeuroolryo.user.domain.RefreshTokenRepository; import org.springframework.data.jpa.repository.JpaRepository; public interface RefreshTokenJpaRepository extends RefreshTokenRepository, JpaRepository { diff --git a/src/main/java/donggi/dev/kkeuroolryo/core/user/infrastructure/UserJpaRepository.java b/src/main/java/donggi/dev/kkeuroolryo/user/infrastructure/UserJpaRepository.java similarity index 66% rename from src/main/java/donggi/dev/kkeuroolryo/core/user/infrastructure/UserJpaRepository.java rename to src/main/java/donggi/dev/kkeuroolryo/user/infrastructure/UserJpaRepository.java index 61b9e3d..27bd6c8 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/core/user/infrastructure/UserJpaRepository.java +++ b/src/main/java/donggi/dev/kkeuroolryo/user/infrastructure/UserJpaRepository.java @@ -1,8 +1,8 @@ -package donggi.dev.kkeuroolryo.core.user.infrastructure; +package donggi.dev.kkeuroolryo.user.infrastructure; -import donggi.dev.kkeuroolryo.core.user.domain.User; -import donggi.dev.kkeuroolryo.core.user.domain.UserRepository; -import donggi.dev.kkeuroolryo.core.user.domain.exception.UserNotFoundException; +import donggi.dev.kkeuroolryo.user.domain.User; +import donggi.dev.kkeuroolryo.user.domain.UserRepository; +import donggi.dev.kkeuroolryo.user.domain.exception.UserNotFoundException; import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/donggi/dev/kkeuroolryo/web/user/UserRestController.java b/src/main/java/donggi/dev/kkeuroolryo/user/presentation/UserRestController.java similarity index 75% rename from src/main/java/donggi/dev/kkeuroolryo/web/user/UserRestController.java rename to src/main/java/donggi/dev/kkeuroolryo/user/presentation/UserRestController.java index 73c65fb..4761a12 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/web/user/UserRestController.java +++ b/src/main/java/donggi/dev/kkeuroolryo/user/presentation/UserRestController.java @@ -1,10 +1,10 @@ -package donggi.dev.kkeuroolryo.web.user; +package donggi.dev.kkeuroolryo.user.presentation; import donggi.dev.kkeuroolryo.common.response.ApiResponse; -import donggi.dev.kkeuroolryo.core.user.application.UserService; -import donggi.dev.kkeuroolryo.core.user.application.dto.LoginTokens; -import donggi.dev.kkeuroolryo.web.user.dto.LoginRequestDto; -import donggi.dev.kkeuroolryo.web.user.dto.SignupRequestDto; +import donggi.dev.kkeuroolryo.user.application.UserService; +import donggi.dev.kkeuroolryo.user.application.dto.LoginTokens; +import donggi.dev.kkeuroolryo.user.presentation.dto.LoginRequestDto; +import donggi.dev.kkeuroolryo.user.presentation.dto.SignupRequestDto; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; diff --git a/src/main/java/donggi/dev/kkeuroolryo/web/user/dto/LoginRequestDto.java b/src/main/java/donggi/dev/kkeuroolryo/user/presentation/dto/LoginRequestDto.java similarity index 59% rename from src/main/java/donggi/dev/kkeuroolryo/web/user/dto/LoginRequestDto.java rename to src/main/java/donggi/dev/kkeuroolryo/user/presentation/dto/LoginRequestDto.java index a003d95..699058c 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/web/user/dto/LoginRequestDto.java +++ b/src/main/java/donggi/dev/kkeuroolryo/user/presentation/dto/LoginRequestDto.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.web.user.dto; +package donggi.dev.kkeuroolryo.user.presentation.dto; public record LoginRequestDto( String loginId, diff --git a/src/main/java/donggi/dev/kkeuroolryo/web/user/dto/SignupRequestDto.java b/src/main/java/donggi/dev/kkeuroolryo/user/presentation/dto/SignupRequestDto.java similarity index 61% rename from src/main/java/donggi/dev/kkeuroolryo/web/user/dto/SignupRequestDto.java rename to src/main/java/donggi/dev/kkeuroolryo/user/presentation/dto/SignupRequestDto.java index 189b633..72377d5 100644 --- a/src/main/java/donggi/dev/kkeuroolryo/web/user/dto/SignupRequestDto.java +++ b/src/main/java/donggi/dev/kkeuroolryo/user/presentation/dto/SignupRequestDto.java @@ -1,6 +1,6 @@ -package donggi.dev.kkeuroolryo.web.user.dto; +package donggi.dev.kkeuroolryo.user.presentation.dto; -import donggi.dev.kkeuroolryo.core.user.domain.User; +import donggi.dev.kkeuroolryo.user.domain.User; public record SignupRequestDto( String loginId, diff --git a/src/main/java/donggi/dev/kkeuroolryo/web/question/QuestionRestController.java b/src/main/java/donggi/dev/kkeuroolryo/web/question/QuestionRestController.java deleted file mode 100644 index fb4cf86..0000000 --- a/src/main/java/donggi/dev/kkeuroolryo/web/question/QuestionRestController.java +++ /dev/null @@ -1,119 +0,0 @@ -package donggi.dev.kkeuroolryo.web.question; - -import donggi.dev.kkeuroolryo.common.response.ApiResponse; -import donggi.dev.kkeuroolryo.core.question.application.QuestionEditor; -import donggi.dev.kkeuroolryo.core.question.application.QuestionFinder; -import donggi.dev.kkeuroolryo.core.question.application.dto.QuestionDto; -import donggi.dev.kkeuroolryo.core.question.application.dto.QuestionPaginationDto; -import donggi.dev.kkeuroolryo.core.question.application.dto.RandomQuestionsDto; -import donggi.dev.kkeuroolryo.core.question.domain.Category; -import donggi.dev.kkeuroolryo.web.comment.dto.NoOffsetPageCommand; -import donggi.dev.kkeuroolryo.web.question.dto.QuestionRegisterDto; -import donggi.dev.kkeuroolryo.web.question.dto.QuestionResultCommand; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PatchMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequiredArgsConstructor -@RequestMapping("/api/golrabas") -public class QuestionRestController { - - private final QuestionFinder questionFinder; - private final QuestionEditor questionEditor; - - @PostMapping("/question") - public ApiResponse register(@RequestBody QuestionRegisterDto questionRegisterDto) { - QuestionDto questionDto = questionEditor.save(questionRegisterDto); - return ApiResponse.success(questionDto); - } - - @PutMapping("/question/{questionId}") - public ApiResponse modify(@PathVariable("questionId") Long questionId, - @RequestBody QuestionRegisterDto questionRegisterDto) { - questionEditor.modify(questionId, questionRegisterDto); - return ApiResponse.success(); - } - - @PostMapping("/result") - public ApiResponse register(@RequestBody QuestionResultCommand resultCommand) { - questionEditor.result(resultCommand); - return ApiResponse.success(); - } - - /** - * 카테고리 이름으로 해당 카테고리의 질문 id를 조회합니다. - * 질문은 랜덤한 순서로 조회합니다. - */ - @GetMapping("/category/{category}") - public ApiResponse getQuestionIdsByCategory(@PathVariable("category") Category category) { - RandomQuestionsDto randomQuestionsDto = questionFinder.getRandomQuestionsByCategory(category); - return ApiResponse.success(randomQuestionsDto); - } - - /** - * 어드민에서 카테고리로 질문 리스트를 조회합니다. - */ - @GetMapping("/category/{category}/question") - public ApiResponse getQuestionsByCategory( - @PathVariable("category") Category category, - @RequestParam(required = false, defaultValue = "0") String searchAfterId, - @RequestParam(required = false, defaultValue = "20") String size - ) { - QuestionPaginationDto questionPaginationDto = questionFinder.findAllByCategory(category, new NoOffsetPageCommand(searchAfterId, size)); - return ApiResponse.success(questionPaginationDto); - } - - /** - * 어드민에서 특정 active 상태의 카테고리 질문 리스트를 조회합니다. - */ - @GetMapping("/category/{category}/question/active/{active}") - public ApiResponse getQuestionsByCategoryAndActive( - @PathVariable("category") Category category, - @PathVariable("active") boolean active, - @RequestParam(required = false, defaultValue = "0") String searchAfterId, - @RequestParam(required = false, defaultValue = "20") String size - ) { - QuestionPaginationDto questionPaginationDto = questionFinder.findAllByCategoryAndActive(category, active, new NoOffsetPageCommand(searchAfterId, size)); - return ApiResponse.success(questionPaginationDto); - } - - @GetMapping("/question/{questionId}") - public ApiResponse getQuestion(@PathVariable("questionId") Long questionId) { - QuestionDto questionDto = questionFinder.getQuestion(questionId); - return ApiResponse.success(questionDto); - } - - @GetMapping("/question") - public ApiResponse getAll( - @RequestParam(required = false, defaultValue = "0") String searchAfterId, - @RequestParam(required = false, defaultValue = "20") String size - ) { - QuestionPaginationDto questionPaginationDto = questionFinder.findAllIdsByCategory(new NoOffsetPageCommand(searchAfterId, size)); - return ApiResponse.success(questionPaginationDto); - } - - @GetMapping("/question/search") - public ApiResponse search( - @RequestParam String keyword, - @RequestParam(required = false, defaultValue = "0") String searchAfterId, - @RequestParam(required = false, defaultValue = "20") String size - ) { - QuestionPaginationDto questionPaginationDto = questionFinder.search(keyword, new NoOffsetPageCommand(searchAfterId, size)); - return ApiResponse.success(questionPaginationDto); - } - - @PatchMapping("/question/{questionId}/active/{active}") - public ApiResponse changeActive(@PathVariable("questionId") Long questionId, - @PathVariable("active") boolean active) { - questionEditor.changeActive(questionId, active); - return ApiResponse.success(); - } -} diff --git a/src/main/resources/static/docs/index.html b/src/main/resources/static/docs/index.html index 6e5e39a..a4608e7 100644 --- a/src/main/resources/static/docs/index.html +++ b/src/main/resources/static/docs/index.html @@ -545,7 +545,7 @@
HTTP RequestPOST /api/golrabas/question HTTP/1.1 Accept: application/json Content-Type: application/json -Host: localhost:65471 +Host: localhost:54905 Content-Length: 118 { @@ -660,7 +660,7 @@
HTTP Response Vary: Access-Control-Request-Headers Content-Type: application/json Transfer-Encoding: chunked -Date: Sun, 29 Oct 2023 11:53:03 GMT +Date: Sun, 04 Feb 2024 13:03:30 GMT Keep-Alive: timeout=60 Connection: keep-alive Content-Length: 315 @@ -759,7 +759,7 @@
HTTP RequestPUT /api/golrabas/question/169 HTTP/1.1 Accept: application/json Content-Type: application/json -Host: localhost:65471 +Host: localhost:54905 Content-Length: 118 { @@ -796,7 +796,7 @@
HTTP Response Vary: Access-Control-Request-Headers Content-Type: application/json Transfer-Encoding: chunked -Date: Sun, 29 Oct 2023 11:53:03 GMT +Date: Sun, 04 Feb 2024 13:03:30 GMT Keep-Alive: timeout=60 Connection: keep-alive Content-Length: 104 @@ -851,7 +851,7 @@
HTTP RequestPATCH /api/golrabas/question/168/active/false HTTP/1.1 Accept: application/json Content-Type: application/json -Host: localhost:65471 +Host: localhost:54905 @@ -880,7 +880,7 @@
HTTP Response Vary: Access-Control-Request-Headers Content-Type: application/json Transfer-Encoding: chunked -Date: Sun, 29 Oct 2023 11:53:03 GMT +Date: Sun, 04 Feb 2024 13:03:30 GMT Keep-Alive: timeout=60 Connection: keep-alive Content-Length: 104 @@ -937,7 +937,7 @@
HTTP RequestPOST /api/golrabas/result HTTP/1.1 Accept: application/json Content-Type: application/json -Host: localhost:65471 +Host: localhost:54905 Content-Length: 320 { @@ -977,7 +977,7 @@
HTTP Response Vary: Access-Control-Request-Headers Content-Type: application/json Transfer-Encoding: chunked -Date: Sun, 29 Oct 2023 11:53:03 GMT +Date: Sun, 04 Feb 2024 13:03:31 GMT Keep-Alive: timeout=60 Connection: keep-alive Content-Length: 104 @@ -1028,7 +1028,7 @@
HTTP RequestGET /api/golrabas/category/SELF HTTP/1.1 Accept: application/json Content-Type: application/json -Host: localhost:65471 +Host: localhost:54905 @@ -1083,7 +1083,7 @@
Response Body "message" : "요청이 정상적으로 처리되었습니다.", "data" : { "category" : "SELF", - "questionIds" : [ 56, 58, 66, 64, 69, 57, 63, 59, 54, 60, 65, 67, 61, 68, 62 ] + "questionIds" : [ 60, 61, 64, 56, 63, 68, 62, 55, 69, 59, 57, 54, 65, 67, 58 ] } } @@ -1099,7 +1099,7 @@
HTTP Response Vary: Access-Control-Request-Headers Content-Type: application/json Transfer-Encoding: chunked -Date: Sun, 29 Oct 2023 11:53:02 GMT +Date: Sun, 04 Feb 2024 13:03:30 GMT Keep-Alive: timeout=60 Connection: keep-alive Content-Length: 213 @@ -1109,7 +1109,7 @@
HTTP Response "message" : "요청이 정상적으로 처리되었습니다.", "data" : { "category" : "SELF", - "questionIds" : [ 56, 58, 66, 64, 69, 57, 63, 59, 54, 60, 65, 67, 61, 68, 62 ] + "questionIds" : [ 60, 61, 64, 56, 63, 68, 62, 55, 69, 59, 57, 54, 65, 67, 58 ] } } @@ -1147,7 +1147,7 @@
HTTP RequestGET /api/golrabas/category/haha HTTP/1.1 Accept: application/json Content-Type: application/json -Host: localhost:65471 +Host: localhost:54905 @@ -1161,7 +1161,7 @@
Response Body
{
   "code" : "Q401",
   "message" : "유효하지 않은 카테고리입니다.",
-  "data" : "Failed to convert value of type 'java.lang.String' to required type 'donggi.dev.kkeuroolryo.core.question.domain.Category'; Failed to convert from type [java.lang.String] to type [@org.springframework.web.bind.annotation.PathVariable donggi.dev.kkeuroolryo.core.question.domain.Category] for value [haha]"
+  "data" : "Failed to convert value of type 'java.lang.String' to required type 'donggi.dev.kkeuroolryo.question.domain.Category'; Failed to convert from type [java.lang.String] to type [@org.springframework.web.bind.annotation.PathVariable donggi.dev.kkeuroolryo.question.domain.Category] for value [haha]"
 }
@@ -1176,14 +1176,14 @@
HTTP Response Vary: Access-Control-Request-Headers Content-Type: application/json Transfer-Encoding: chunked -Date: Sun, 29 Oct 2023 11:53:02 GMT +Date: Sun, 04 Feb 2024 13:03:30 GMT Connection: close -Content-Length: 400 +Content-Length: 390 { "code" : "Q401", "message" : "유효하지 않은 카테고리입니다.", - "data" : "Failed to convert value of type 'java.lang.String' to required type 'donggi.dev.kkeuroolryo.core.question.domain.Category'; Failed to convert from type [java.lang.String] to type [@org.springframework.web.bind.annotation.PathVariable donggi.dev.kkeuroolryo.core.question.domain.Category] for value [haha]" + "data" : "Failed to convert value of type 'java.lang.String' to required type 'donggi.dev.kkeuroolryo.question.domain.Category'; Failed to convert from type [java.lang.String] to type [@org.springframework.web.bind.annotation.PathVariable donggi.dev.kkeuroolryo.question.domain.Category] for value [haha]" } @@ -1226,7 +1226,7 @@
HTTP RequestGET /api/golrabas/category/SELF/question?searchAfterId=101&size=5 HTTP/1.1 Accept: application/json Content-Type: application/json -Host: localhost:65471 +Host: localhost:54905 @@ -1391,7 +1391,7 @@
HTTP Response Vary: Access-Control-Request-Headers Content-Type: application/json Transfer-Encoding: chunked -Date: Sun, 29 Oct 2023 11:53:02 GMT +Date: Sun, 04 Feb 2024 13:03:30 GMT Keep-Alive: timeout=60 Connection: keep-alive Content-Length: 1360 @@ -1498,7 +1498,7 @@
HTTP RequestGET /api/golrabas/category/SELF/question/active/true?searchAfterId=133&size=5 HTTP/1.1 Accept: application/json Content-Type: application/json -Host: localhost:65471 +Host: localhost:54905 @@ -1663,7 +1663,7 @@
HTTP Response Vary: Access-Control-Request-Headers Content-Type: application/json Transfer-Encoding: chunked -Date: Sun, 29 Oct 2023 11:53:03 GMT +Date: Sun, 04 Feb 2024 13:03:30 GMT Keep-Alive: timeout=60 Connection: keep-alive Content-Length: 1364 @@ -1766,7 +1766,7 @@
HTTP RequestGET /api/golrabas/question/85 HTTP/1.1 Accept: application/json Content-Type: application/json -Host: localhost:65471 +Host: localhost:54905 @@ -1873,7 +1873,7 @@
HTTP Response Vary: Access-Control-Request-Headers Content-Type: application/json Transfer-Encoding: chunked -Date: Sun, 29 Oct 2023 11:53:02 GMT +Date: Sun, 04 Feb 2024 13:03:30 GMT Keep-Alive: timeout=60 Connection: keep-alive Content-Length: 310 @@ -1927,7 +1927,7 @@
HTTP Request<
GET /api/golrabas/question/-1 HTTP/1.1
 Accept: application/json
 Content-Type: application/json
-Host: localhost:65471
+Host: localhost:54905 @@ -1956,7 +1956,7 @@
HTTP Respon Vary: Access-Control-Request-Headers Content-Type: application/json Transfer-Encoding: chunked -Date: Sun, 29 Oct 2023 11:53:03 GMT +Date: Sun, 04 Feb 2024 13:03:30 GMT Connection: close Content-Length: 92 @@ -1984,7 +1984,7 @@
HTTP Request<
GET /api/golrabas/question?searchAfterId=117&size=5 HTTP/1.1
 Accept: application/json
 Content-Type: application/json
-Host: localhost:65471
+Host: localhost:54905 @@ -2174,7 +2174,7 @@
HTTP Respon Vary: Access-Control-Request-Headers Content-Type: application/json Transfer-Encoding: chunked -Date: Sun, 29 Oct 2023 11:53:03 GMT +Date: Sun, 04 Feb 2024 13:03:30 GMT Keep-Alive: timeout=60 Connection: keep-alive Content-Length: 1364 @@ -2255,7 +2255,7 @@
HTTP Request<
GET /api/golrabas/question/search?keyword=%EC%A7%88%EB%AC%B8&searchAfterId=165&size=5 HTTP/1.1
 Accept: application/json
 Content-Type: application/json
-Host: localhost:65471
+Host: localhost:54905 @@ -2449,7 +2449,7 @@
HTTP Respon Vary: Access-Control-Request-Headers Content-Type: application/json Transfer-Encoding: chunked -Date: Sun, 29 Oct 2023 11:53:03 GMT +Date: Sun, 04 Feb 2024 13:03:30 GMT Keep-Alive: timeout=60 Connection: keep-alive Content-Length: 1364 @@ -2588,10 +2588,10 @@
Request Fie
HTTP Request
-
POST /api/golrabas/37/comments HTTP/1.1
+
POST /api/golrabas/15/comments HTTP/1.1
 Accept: application/json
 Content-Type: application/json
-Host: localhost:65471
+Host: localhost:54905
 Content-Length: 98
 
 {
@@ -2672,7 +2672,7 @@ 
HTTP Respon Vary: Access-Control-Request-Headers Content-Type: application/json Transfer-Encoding: chunked -Date: Sun, 29 Oct 2023 11:53:02 GMT +Date: Sun, 04 Feb 2024 13:03:28 GMT Keep-Alive: timeout=60 Connection: keep-alive Content-Length: 185 @@ -2752,10 +2752,10 @@
Request Fie
HTTP Request
-
POST /api/golrabas/33/comments HTTP/1.1
+
POST /api/golrabas/11/comments HTTP/1.1
 Accept: application/json
 Content-Type: application/json
-Host: localhost:65471
+Host: localhost:54905
 Content-Length: 86
 
 {
@@ -2788,7 +2788,7 @@ 
HTTP Respon Vary: Access-Control-Request-Headers Content-Type: application/json Transfer-Encoding: chunked -Date: Sun, 29 Oct 2023 11:53:02 GMT +Date: Sun, 04 Feb 2024 13:03:28 GMT Connection: close Content-Length: 95 @@ -2873,10 +2873,10 @@
Request Fie
HTTP Request
-
PUT /api/golrabas/36/comments/21 HTTP/1.1
+
PUT /api/golrabas/14/comments/21 HTTP/1.1
 Accept: application/json
 Content-Type: application/json
-Host: localhost:65471
+Host: localhost:54905
 Content-Length: 81
 
 {
@@ -2909,7 +2909,7 @@ 
HTTP Respon Vary: Access-Control-Request-Headers Content-Type: application/json Transfer-Encoding: chunked -Date: Sun, 29 Oct 2023 11:53:02 GMT +Date: Sun, 04 Feb 2024 13:03:28 GMT Keep-Alive: timeout=60 Connection: keep-alive Content-Length: 104 @@ -2985,10 +2985,10 @@
Request Fie
HTTP Request
-
DELETE /api/golrabas/34/comments/19 HTTP/1.1
+
DELETE /api/golrabas/12/comments/19 HTTP/1.1
 Accept: application/json
 Content-Type: application/json
-Host: localhost:65471
+Host: localhost:54905
 Content-Length: 36
 
 {
@@ -3010,7 +3010,7 @@ 
HTTP Respon Vary: Access-Control-Request-Headers Content-Type: application/json Transfer-Encoding: chunked -Date: Sun, 29 Oct 2023 11:53:02 GMT +Date: Sun, 04 Feb 2024 13:03:28 GMT Keep-Alive: timeout=60 Connection: keep-alive Content-Length: 104 @@ -3080,10 +3080,10 @@
Request Fie
HTTP Request
-
DELETE /api/golrabas/31/comments/-1 HTTP/1.1
+
DELETE /api/golrabas/9/comments/-1 HTTP/1.1
 Accept: application/json
 Content-Type: application/json
-Host: localhost:65471
+Host: localhost:54905
 Content-Length: 36
 
 {
@@ -3105,7 +3105,7 @@ 
HTTP Respon Vary: Access-Control-Request-Headers Content-Type: application/json Transfer-Encoding: chunked -Date: Sun, 29 Oct 2023 11:53:02 GMT +Date: Sun, 04 Feb 2024 13:03:28 GMT Connection: close Content-Length: 92 @@ -3177,7 +3177,7 @@
HTTP Request<
DELETE /api/golrabas/-1/comments/17 HTTP/1.1
 Accept: application/json
 Content-Type: application/json
-Host: localhost:65471
+Host: localhost:54905
 Content-Length: 36
 
 {
@@ -3199,7 +3199,7 @@ 
HTTP Respon Vary: Access-Control-Request-Headers Content-Type: application/json Transfer-Encoding: chunked -Date: Sun, 29 Oct 2023 11:53:02 GMT +Date: Sun, 04 Feb 2024 13:03:28 GMT Connection: close Content-Length: 92 @@ -3268,10 +3268,10 @@
Request Fie
HTTP Request
-
DELETE /api/golrabas/35/comments/20 HTTP/1.1
+
DELETE /api/golrabas/13/comments/20 HTTP/1.1
 Accept: application/json
 Content-Type: application/json
-Host: localhost:65471
+Host: localhost:54905
 Content-Length: 35
 
 {
@@ -3293,7 +3293,7 @@ 
HTTP Respon Vary: Access-Control-Request-Headers Content-Type: application/json Transfer-Encoding: chunked -Date: Sun, 29 Oct 2023 11:53:02 GMT +Date: Sun, 04 Feb 2024 13:03:28 GMT Connection: close Content-Length: 105 @@ -3340,10 +3340,10 @@
Path Parame
HTTP Request
-
GET /api/golrabas/30/comments?searchAfterId=15&size=5 HTTP/1.1
+
GET /api/golrabas/8/comments?searchAfterId=15&size=5 HTTP/1.1
 Accept: application/json
 Content-Type: application/json
-Host: localhost:65471
+Host: localhost:54905
@@ -3360,16 +3360,16 @@
HTTP Respon Vary: Access-Control-Request-Headers Content-Type: application/json Transfer-Encoding: chunked -Date: Sun, 29 Oct 2023 11:53:02 GMT +Date: Sun, 04 Feb 2024 13:03:28 GMT Keep-Alive: timeout=60 Connection: keep-alive -Content-Length: 724 +Content-Length: 723 { "code" : "G001", "message" : "요청이 정상적으로 처리되었습니다.", "data" : { - "questionId" : 30, + "questionId" : 8, "comments" : [ { "id" : 15, "username" : "사용자이름5", @@ -3446,7 +3446,7 @@
HTTP Request<
POST /api/golrabas/shortUrl HTTP/1.1
 Accept: application/json
 Content-Type: application/json
-Host: localhost:65471
+Host: localhost:54905
 Content-Length: 37
 
 {
@@ -3516,7 +3516,7 @@ 
HTTP Respon Vary: Access-Control-Request-Headers Content-Type: application/json Transfer-Encoding: chunked -Date: Sun, 29 Oct 2023 11:53:03 GMT +Date: Sun, 04 Feb 2024 13:03:31 GMT Keep-Alive: timeout=60 Connection: keep-alive Content-Length: 131 @@ -3569,7 +3569,7 @@
HTTP Request<
GET /api/golrabas/shortUrl/Sq3pFB HTTP/1.1
 Accept: application/json
 Content-Type: application/json
-Host: localhost:65471
+Host: localhost:54905
@@ -3634,7 +3634,7 @@
HTTP Respon Vary: Access-Control-Request-Headers Content-Type: application/json Transfer-Encoding: chunked -Date: Sun, 29 Oct 2023 11:53:03 GMT +Date: Sun, 04 Feb 2024 13:03:31 GMT Keep-Alive: timeout=60 Connection: keep-alive Content-Length: 141 @@ -3699,7 +3699,7 @@
HTTP Request<
POST /api/user/login HTTP/1.1
 Accept: application/json
 Content-Type: application/json
-Host: localhost:65471
+Host: localhost:54905
 Content-Length: 54
 
 {
@@ -3759,8 +3759,8 @@ 
Response Bo "code" : "G001", "message" : "요청이 정상적으로 처리되었습니다.", "data" : { - "accessToken" : "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI0IiwiaWF0IjoxNjk4NTgwMzgzLCJleHAiOjE2OTg1ODAzODd9.b2A9Y3m3-qpzN75H1QNNX8shRzS0iuJJwEzVBQqn1Uk", - "refreshToken" : "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI0IiwiaWF0IjoxNjk4NTgwMzgzLCJleHAiOjE2OTg1ODI5NzV9.Ugyh4YBfLfrjPxNkHyFNKWZp1bXEzRk_6PHYls6s1AA" + "accessToken" : "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI0IiwiaWF0IjoxNzA3MDUxODExLCJleHAiOjE3MDcwNTE4MTV9.SQ_Utef2vjUMz16LRp81yOgwGsu7SX5GG26xa95RdVQ", + "refreshToken" : "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI0IiwiaWF0IjoxNzA3MDUxODExLCJleHAiOjE3MDcwNTQ0MDN9.dbdgeZa4GESWFtMg_2E64lt22RmlDXhA8Q_NjvFX5dI" } }
@@ -3776,7 +3776,7 @@
HTTP Respon Vary: Access-Control-Request-Headers Content-Type: application/json Transfer-Encoding: chunked -Date: Sun, 29 Oct 2023 11:53:03 GMT +Date: Sun, 04 Feb 2024 13:03:31 GMT Keep-Alive: timeout=60 Connection: keep-alive Content-Length: 403 @@ -3785,8 +3785,8 @@
HTTP Respon "code" : "G001", "message" : "요청이 정상적으로 처리되었습니다.", "data" : { - "accessToken" : "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI0IiwiaWF0IjoxNjk4NTgwMzgzLCJleHAiOjE2OTg1ODAzODd9.b2A9Y3m3-qpzN75H1QNNX8shRzS0iuJJwEzVBQqn1Uk", - "refreshToken" : "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI0IiwiaWF0IjoxNjk4NTgwMzgzLCJleHAiOjE2OTg1ODI5NzV9.Ugyh4YBfLfrjPxNkHyFNKWZp1bXEzRk_6PHYls6s1AA" + "accessToken" : "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI0IiwiaWF0IjoxNzA3MDUxODExLCJleHAiOjE3MDcwNTE4MTV9.SQ_Utef2vjUMz16LRp81yOgwGsu7SX5GG26xa95RdVQ", + "refreshToken" : "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI0IiwiaWF0IjoxNzA3MDUxODExLCJleHAiOjE3MDcwNTQ0MDN9.dbdgeZa4GESWFtMg_2E64lt22RmlDXhA8Q_NjvFX5dI" } }
@@ -3837,7 +3837,7 @@
HTTP Request<
POST /api/user/signup HTTP/1.1
 Accept: application/json
 Content-Type: application/json
-Host: localhost:65471
+Host: localhost:54905
 Content-Length: 55
 
 {
@@ -3872,7 +3872,7 @@ 
HTTP Respon Vary: Access-Control-Request-Headers Content-Type: application/json Transfer-Encoding: chunked -Date: Sun, 29 Oct 2023 11:53:03 GMT +Date: Sun, 04 Feb 2024 13:03:31 GMT Keep-Alive: timeout=60 Connection: keep-alive Content-Length: 104 diff --git a/src/test/java/donggi/dev/kkeuroolryo/core/comment/application/CommentEditorTest.java b/src/test/java/donggi/dev/kkeuroolryo/comment/application/CommentEditorTest.java similarity index 82% rename from src/test/java/donggi/dev/kkeuroolryo/core/comment/application/CommentEditorTest.java rename to src/test/java/donggi/dev/kkeuroolryo/comment/application/CommentEditorTest.java index 0416ff6..75e834f 100644 --- a/src/test/java/donggi/dev/kkeuroolryo/core/comment/application/CommentEditorTest.java +++ b/src/test/java/donggi/dev/kkeuroolryo/comment/application/CommentEditorTest.java @@ -1,21 +1,20 @@ -package donggi.dev.kkeuroolryo.core.comment.application; +package donggi.dev.kkeuroolryo.comment.application; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import donggi.dev.kkeuroolryo.IntegrationTest; -import donggi.dev.kkeuroolryo.core.comment.application.dto.CommentDto; -import donggi.dev.kkeuroolryo.core.comment.domain.Comment; -import donggi.dev.kkeuroolryo.core.comment.domain.CommentRepository; -import donggi.dev.kkeuroolryo.core.comment.domain.exception.CommentNotFoundException; -import donggi.dev.kkeuroolryo.core.comment.domain.exception.CommentUnauthorizedException; -import donggi.dev.kkeuroolryo.core.question.domain.Category; -import donggi.dev.kkeuroolryo.core.question.domain.Question; -import donggi.dev.kkeuroolryo.core.question.domain.QuestionRepository; -import donggi.dev.kkeuroolryo.core.question.domain.exception.QuestionNotFoundException; -import donggi.dev.kkeuroolryo.web.comment.dto.CommentDeleteCommand; -import donggi.dev.kkeuroolryo.web.comment.dto.CommentRegisterDto; +import donggi.dev.kkeuroolryo.comment.application.dto.CommentDto; +import donggi.dev.kkeuroolryo.comment.domain.Comment; +import donggi.dev.kkeuroolryo.comment.domain.CommentRepository; +import donggi.dev.kkeuroolryo.comment.domain.exception.CommentNotFoundException; +import donggi.dev.kkeuroolryo.comment.domain.exception.CommentUnauthorizedException; +import donggi.dev.kkeuroolryo.comment.presentation.dto.CommentDeleteCommand; +import donggi.dev.kkeuroolryo.comment.presentation.dto.CommentRegisterDto; +import donggi.dev.kkeuroolryo.question.domain.Category; +import donggi.dev.kkeuroolryo.question.domain.Question; +import donggi.dev.kkeuroolryo.question.domain.QuestionRepository; +import donggi.dev.kkeuroolryo.question.domain.exception.QuestionNotFoundException; +import donggi.dev.kkeuroolryo.support.IntegrationTest; import org.assertj.core.api.SoftAssertions; -import org.assertj.core.api.ThrowableAssert.ThrowingCallable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; diff --git a/src/test/java/donggi/dev/kkeuroolryo/core/comment/domain/CommentTest.java b/src/test/java/donggi/dev/kkeuroolryo/comment/domain/CommentTest.java similarity index 92% rename from src/test/java/donggi/dev/kkeuroolryo/core/comment/domain/CommentTest.java rename to src/test/java/donggi/dev/kkeuroolryo/comment/domain/CommentTest.java index a5ba1fb..5ef1b44 100644 --- a/src/test/java/donggi/dev/kkeuroolryo/core/comment/domain/CommentTest.java +++ b/src/test/java/donggi/dev/kkeuroolryo/comment/domain/CommentTest.java @@ -1,12 +1,12 @@ -package donggi.dev.kkeuroolryo.core.comment.domain; +package donggi.dev.kkeuroolryo.comment.domain; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import donggi.dev.kkeuroolryo.UnitTest; -import donggi.dev.kkeuroolryo.core.comment.domain.exception.CommentInvalidContentException; -import donggi.dev.kkeuroolryo.core.comment.domain.exception.CommentInvalidPasswordException; -import donggi.dev.kkeuroolryo.core.comment.domain.exception.CommentInvalidUsernameException; -import donggi.dev.kkeuroolryo.core.comment.domain.exception.CommentUnauthorizedException; +import donggi.dev.kkeuroolryo.support.UnitTest; +import donggi.dev.kkeuroolryo.comment.domain.exception.CommentInvalidContentException; +import donggi.dev.kkeuroolryo.comment.domain.exception.CommentInvalidPasswordException; +import donggi.dev.kkeuroolryo.comment.domain.exception.CommentInvalidUsernameException; +import donggi.dev.kkeuroolryo.comment.domain.exception.CommentUnauthorizedException; import org.assertj.core.api.SoftAssertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; diff --git a/src/test/java/donggi/dev/kkeuroolryo/web/comment/CommentReadRestControllerRestDocsTest.java b/src/test/java/donggi/dev/kkeuroolryo/comment/presentation/CommentReadRestControllerRestDocsTest.java similarity index 90% rename from src/test/java/donggi/dev/kkeuroolryo/web/comment/CommentReadRestControllerRestDocsTest.java rename to src/test/java/donggi/dev/kkeuroolryo/comment/presentation/CommentReadRestControllerRestDocsTest.java index 81f2e9a..bec60fd 100644 --- a/src/test/java/donggi/dev/kkeuroolryo/web/comment/CommentReadRestControllerRestDocsTest.java +++ b/src/test/java/donggi/dev/kkeuroolryo/comment/presentation/CommentReadRestControllerRestDocsTest.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.web.comment; +package donggi.dev.kkeuroolryo.comment.presentation; import static io.restassured.RestAssured.given; import static org.springframework.restdocs.payload.PayloadDocumentation.fieldWithPath; @@ -8,13 +8,13 @@ import static org.springframework.restdocs.request.RequestDocumentation.queryParameters; import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.document; -import donggi.dev.kkeuroolryo.InitRestDocsTest; -import donggi.dev.kkeuroolryo.RestAssuredAndRestDocsTest; -import donggi.dev.kkeuroolryo.core.comment.domain.Comment; -import donggi.dev.kkeuroolryo.core.comment.domain.CommentRepository; -import donggi.dev.kkeuroolryo.core.question.domain.Category; -import donggi.dev.kkeuroolryo.core.question.domain.Question; -import donggi.dev.kkeuroolryo.core.question.domain.QuestionRepository; +import donggi.dev.kkeuroolryo.support.InitRestDocsTest; +import donggi.dev.kkeuroolryo.support.RestAssuredAndRestDocsTest; +import donggi.dev.kkeuroolryo.comment.domain.Comment; +import donggi.dev.kkeuroolryo.comment.domain.CommentRepository; +import donggi.dev.kkeuroolryo.question.domain.Category; +import donggi.dev.kkeuroolryo.question.domain.Question; +import donggi.dev.kkeuroolryo.question.domain.QuestionRepository; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/src/test/java/donggi/dev/kkeuroolryo/web/comment/CommentRestControllerRestDocsTest.java b/src/test/java/donggi/dev/kkeuroolryo/comment/presentation/CommentRestControllerRestDocsTest.java similarity index 94% rename from src/test/java/donggi/dev/kkeuroolryo/web/comment/CommentRestControllerRestDocsTest.java rename to src/test/java/donggi/dev/kkeuroolryo/comment/presentation/CommentRestControllerRestDocsTest.java index 6c9eca7..d52a26c 100644 --- a/src/test/java/donggi/dev/kkeuroolryo/web/comment/CommentRestControllerRestDocsTest.java +++ b/src/test/java/donggi/dev/kkeuroolryo/comment/presentation/CommentRestControllerRestDocsTest.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.web.comment; +package donggi.dev.kkeuroolryo.comment.presentation; import static io.restassured.RestAssured.given; import static org.springframework.restdocs.payload.PayloadDocumentation.fieldWithPath; @@ -8,15 +8,15 @@ import static org.springframework.restdocs.request.RequestDocumentation.pathParameters; import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.document; -import donggi.dev.kkeuroolryo.InitRestDocsTest; -import donggi.dev.kkeuroolryo.RestAssuredAndRestDocsTest; -import donggi.dev.kkeuroolryo.core.comment.domain.Comment; -import donggi.dev.kkeuroolryo.core.comment.domain.CommentRepository; -import donggi.dev.kkeuroolryo.core.question.domain.Category; -import donggi.dev.kkeuroolryo.core.question.domain.Question; -import donggi.dev.kkeuroolryo.core.question.domain.QuestionRepository; -import donggi.dev.kkeuroolryo.web.comment.dto.CommentDeleteCommand; -import donggi.dev.kkeuroolryo.web.comment.dto.CommentRegisterDto; +import donggi.dev.kkeuroolryo.support.InitRestDocsTest; +import donggi.dev.kkeuroolryo.support.RestAssuredAndRestDocsTest; +import donggi.dev.kkeuroolryo.comment.domain.Comment; +import donggi.dev.kkeuroolryo.comment.domain.CommentRepository; +import donggi.dev.kkeuroolryo.question.domain.Category; +import donggi.dev.kkeuroolryo.question.domain.Question; +import donggi.dev.kkeuroolryo.question.domain.QuestionRepository; +import donggi.dev.kkeuroolryo.comment.presentation.dto.CommentDeleteCommand; +import donggi.dev.kkeuroolryo.comment.presentation.dto.CommentRegisterDto; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/src/test/java/donggi/dev/kkeuroolryo/core/question/application/QuestionEditorTest.java b/src/test/java/donggi/dev/kkeuroolryo/question/application/QuestionEditorTest.java similarity index 91% rename from src/test/java/donggi/dev/kkeuroolryo/core/question/application/QuestionEditorTest.java rename to src/test/java/donggi/dev/kkeuroolryo/question/application/QuestionEditorTest.java index 2636feb..6b0a348 100644 --- a/src/test/java/donggi/dev/kkeuroolryo/core/question/application/QuestionEditorTest.java +++ b/src/test/java/donggi/dev/kkeuroolryo/question/application/QuestionEditorTest.java @@ -1,19 +1,19 @@ -package donggi.dev.kkeuroolryo.core.question.application; +package donggi.dev.kkeuroolryo.question.application; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import donggi.dev.kkeuroolryo.IntegrationTest; -import donggi.dev.kkeuroolryo.core.question.application.dto.QuestionDto; -import donggi.dev.kkeuroolryo.core.question.domain.Category; -import donggi.dev.kkeuroolryo.core.question.domain.Question; -import donggi.dev.kkeuroolryo.core.question.domain.QuestionRepository; -import donggi.dev.kkeuroolryo.core.question.domain.QuestionResult; -import donggi.dev.kkeuroolryo.core.question.domain.QuestionResultRepository; -import donggi.dev.kkeuroolryo.core.question.domain.exception.QuestionInvalidChoiceException; -import donggi.dev.kkeuroolryo.core.question.domain.exception.QuestionNotFoundException; -import donggi.dev.kkeuroolryo.web.question.dto.QuestionRegisterDto; -import donggi.dev.kkeuroolryo.web.question.dto.QuestionResultCommand; -import donggi.dev.kkeuroolryo.web.question.dto.QuestionResultCommand.ChoiceResult; +import donggi.dev.kkeuroolryo.question.application.dto.QuestionDto; +import donggi.dev.kkeuroolryo.question.domain.Category; +import donggi.dev.kkeuroolryo.question.domain.Question; +import donggi.dev.kkeuroolryo.question.domain.QuestionRepository; +import donggi.dev.kkeuroolryo.question.domain.QuestionResult; +import donggi.dev.kkeuroolryo.question.domain.QuestionResultRepository; +import donggi.dev.kkeuroolryo.question.domain.exception.QuestionInvalidChoiceException; +import donggi.dev.kkeuroolryo.question.domain.exception.QuestionNotFoundException; +import donggi.dev.kkeuroolryo.question.dto.QuestionRegisterDto; +import donggi.dev.kkeuroolryo.question.dto.QuestionResultCommand; +import donggi.dev.kkeuroolryo.question.dto.QuestionResultCommand.ChoiceResult; +import donggi.dev.kkeuroolryo.support.IntegrationTest; import java.util.ArrayList; import java.util.List; import java.util.concurrent.CountDownLatch; diff --git a/src/test/java/donggi/dev/kkeuroolryo/core/question/domain/QuestionTest.java b/src/test/java/donggi/dev/kkeuroolryo/question/domain/QuestionTest.java similarity index 90% rename from src/test/java/donggi/dev/kkeuroolryo/core/question/domain/QuestionTest.java rename to src/test/java/donggi/dev/kkeuroolryo/question/domain/QuestionTest.java index af802ae..ddb52e0 100644 --- a/src/test/java/donggi/dev/kkeuroolryo/core/question/domain/QuestionTest.java +++ b/src/test/java/donggi/dev/kkeuroolryo/question/domain/QuestionTest.java @@ -1,10 +1,10 @@ -package donggi.dev.kkeuroolryo.core.question.domain; +package donggi.dev.kkeuroolryo.question.domain; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import donggi.dev.kkeuroolryo.UnitTest; -import donggi.dev.kkeuroolryo.core.question.domain.exception.QuestionInvalidChoiceException; -import donggi.dev.kkeuroolryo.core.question.domain.exception.QuestionInvalidContentException; +import donggi.dev.kkeuroolryo.support.UnitTest; +import donggi.dev.kkeuroolryo.question.domain.exception.QuestionInvalidChoiceException; +import donggi.dev.kkeuroolryo.question.domain.exception.QuestionInvalidContentException; import org.assertj.core.api.SoftAssertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; diff --git a/src/test/java/donggi/dev/kkeuroolryo/web/question/QuestionReadRestControllerRestDocsTest.java b/src/test/java/donggi/dev/kkeuroolryo/question/presentation/QuestionReadRestControllerRestDocsTest.java similarity index 97% rename from src/test/java/donggi/dev/kkeuroolryo/web/question/QuestionReadRestControllerRestDocsTest.java rename to src/test/java/donggi/dev/kkeuroolryo/question/presentation/QuestionReadRestControllerRestDocsTest.java index 75ee228..b943f46 100644 --- a/src/test/java/donggi/dev/kkeuroolryo/web/question/QuestionReadRestControllerRestDocsTest.java +++ b/src/test/java/donggi/dev/kkeuroolryo/question/presentation/QuestionReadRestControllerRestDocsTest.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.web.question; +package donggi.dev.kkeuroolryo.question.presentation; import static io.restassured.RestAssured.given; import static org.springframework.restdocs.payload.PayloadDocumentation.fieldWithPath; @@ -8,13 +8,13 @@ import static org.springframework.restdocs.request.RequestDocumentation.queryParameters; import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.document; -import donggi.dev.kkeuroolryo.InitRestDocsTest; -import donggi.dev.kkeuroolryo.RestAssuredAndRestDocsTest; -import donggi.dev.kkeuroolryo.core.question.domain.Category; -import donggi.dev.kkeuroolryo.core.question.domain.Question; -import donggi.dev.kkeuroolryo.core.question.domain.QuestionRepository; -import donggi.dev.kkeuroolryo.core.question.domain.QuestionResult; -import donggi.dev.kkeuroolryo.core.question.domain.QuestionResultRepository; +import donggi.dev.kkeuroolryo.support.InitRestDocsTest; +import donggi.dev.kkeuroolryo.support.RestAssuredAndRestDocsTest; +import donggi.dev.kkeuroolryo.question.domain.Category; +import donggi.dev.kkeuroolryo.question.domain.Question; +import donggi.dev.kkeuroolryo.question.domain.QuestionRepository; +import donggi.dev.kkeuroolryo.question.domain.QuestionResult; +import donggi.dev.kkeuroolryo.question.domain.QuestionResultRepository; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/src/test/java/donggi/dev/kkeuroolryo/web/question/QuestionRestControllerRestDocsTest.java b/src/test/java/donggi/dev/kkeuroolryo/question/presentation/QuestionRestControllerRestDocsTest.java similarity index 91% rename from src/test/java/donggi/dev/kkeuroolryo/web/question/QuestionRestControllerRestDocsTest.java rename to src/test/java/donggi/dev/kkeuroolryo/question/presentation/QuestionRestControllerRestDocsTest.java index 1e3fbdb..ddbba49 100644 --- a/src/test/java/donggi/dev/kkeuroolryo/web/question/QuestionRestControllerRestDocsTest.java +++ b/src/test/java/donggi/dev/kkeuroolryo/question/presentation/QuestionRestControllerRestDocsTest.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.web.question; +package donggi.dev.kkeuroolryo.question.presentation; import static io.restassured.RestAssured.given; import static org.springframework.restdocs.payload.PayloadDocumentation.fieldWithPath; @@ -8,16 +8,16 @@ import static org.springframework.restdocs.request.RequestDocumentation.pathParameters; import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.document; -import donggi.dev.kkeuroolryo.InitRestDocsTest; -import donggi.dev.kkeuroolryo.RestAssuredAndRestDocsTest; -import donggi.dev.kkeuroolryo.core.question.domain.Category; -import donggi.dev.kkeuroolryo.core.question.domain.Question; -import donggi.dev.kkeuroolryo.core.question.domain.QuestionRepository; -import donggi.dev.kkeuroolryo.core.question.domain.QuestionResult; -import donggi.dev.kkeuroolryo.core.question.domain.QuestionResultRepository; -import donggi.dev.kkeuroolryo.web.question.dto.QuestionRegisterDto; -import donggi.dev.kkeuroolryo.web.question.dto.QuestionResultCommand; -import donggi.dev.kkeuroolryo.web.question.dto.QuestionResultCommand.ChoiceResult; +import donggi.dev.kkeuroolryo.support.InitRestDocsTest; +import donggi.dev.kkeuroolryo.support.RestAssuredAndRestDocsTest; +import donggi.dev.kkeuroolryo.question.domain.Category; +import donggi.dev.kkeuroolryo.question.domain.Question; +import donggi.dev.kkeuroolryo.question.domain.QuestionRepository; +import donggi.dev.kkeuroolryo.question.domain.QuestionResult; +import donggi.dev.kkeuroolryo.question.domain.QuestionResultRepository; +import donggi.dev.kkeuroolryo.question.dto.QuestionRegisterDto; +import donggi.dev.kkeuroolryo.question.dto.QuestionResultCommand; +import donggi.dev.kkeuroolryo.question.dto.QuestionResultCommand.ChoiceResult; import java.util.ArrayList; import java.util.List; import org.junit.jupiter.api.BeforeEach; diff --git a/src/test/java/donggi/dev/kkeuroolryo/InitRestDocsTest.java b/src/test/java/donggi/dev/kkeuroolryo/support/InitRestDocsTest.java similarity index 97% rename from src/test/java/donggi/dev/kkeuroolryo/InitRestDocsTest.java rename to src/test/java/donggi/dev/kkeuroolryo/support/InitRestDocsTest.java index f518bc4..0b434e7 100644 --- a/src/test/java/donggi/dev/kkeuroolryo/InitRestDocsTest.java +++ b/src/test/java/donggi/dev/kkeuroolryo/support/InitRestDocsTest.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo; +package donggi.dev.kkeuroolryo.support; import static org.springframework.restdocs.operation.preprocess.Preprocessors.prettyPrint; import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.documentationConfiguration; diff --git a/src/test/java/donggi/dev/kkeuroolryo/IntegrationTest.java b/src/test/java/donggi/dev/kkeuroolryo/support/IntegrationTest.java similarity index 94% rename from src/test/java/donggi/dev/kkeuroolryo/IntegrationTest.java rename to src/test/java/donggi/dev/kkeuroolryo/support/IntegrationTest.java index 16d1f83..209a92d 100644 --- a/src/test/java/donggi/dev/kkeuroolryo/IntegrationTest.java +++ b/src/test/java/donggi/dev/kkeuroolryo/support/IntegrationTest.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo; +package donggi.dev.kkeuroolryo.support; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; diff --git a/src/test/java/donggi/dev/kkeuroolryo/RestAssuredAndRestDocsTest.java b/src/test/java/donggi/dev/kkeuroolryo/support/RestAssuredAndRestDocsTest.java similarity index 91% rename from src/test/java/donggi/dev/kkeuroolryo/RestAssuredAndRestDocsTest.java rename to src/test/java/donggi/dev/kkeuroolryo/support/RestAssuredAndRestDocsTest.java index f7ac2e9..c4306e5 100644 --- a/src/test/java/donggi/dev/kkeuroolryo/RestAssuredAndRestDocsTest.java +++ b/src/test/java/donggi/dev/kkeuroolryo/support/RestAssuredAndRestDocsTest.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo; +package donggi.dev.kkeuroolryo.support; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/src/test/java/donggi/dev/kkeuroolryo/common/config/TestWebConfig.java b/src/test/java/donggi/dev/kkeuroolryo/support/TestWebConfig.java similarity index 78% rename from src/test/java/donggi/dev/kkeuroolryo/common/config/TestWebConfig.java rename to src/test/java/donggi/dev/kkeuroolryo/support/TestWebConfig.java index 8198726..fad1f8b 100644 --- a/src/test/java/donggi/dev/kkeuroolryo/common/config/TestWebConfig.java +++ b/src/test/java/donggi/dev/kkeuroolryo/support/TestWebConfig.java @@ -1,5 +1,6 @@ -package donggi.dev.kkeuroolryo.common.config; +package donggi.dev.kkeuroolryo.support; +import donggi.dev.kkeuroolryo.common.config.WebConfig; import org.springframework.boot.test.context.TestConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; diff --git a/src/test/java/donggi/dev/kkeuroolryo/UnitTest.java b/src/test/java/donggi/dev/kkeuroolryo/support/UnitTest.java similarity index 89% rename from src/test/java/donggi/dev/kkeuroolryo/UnitTest.java rename to src/test/java/donggi/dev/kkeuroolryo/support/UnitTest.java index 1c39612..413d43c 100644 --- a/src/test/java/donggi/dev/kkeuroolryo/UnitTest.java +++ b/src/test/java/donggi/dev/kkeuroolryo/support/UnitTest.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo; +package donggi.dev.kkeuroolryo.support; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; diff --git a/src/test/java/donggi/dev/kkeuroolryo/web/url/ShortUrlRestControllerTest.java b/src/test/java/donggi/dev/kkeuroolryo/url/presentation/ShortUrlRestControllerTest.java similarity index 89% rename from src/test/java/donggi/dev/kkeuroolryo/web/url/ShortUrlRestControllerTest.java rename to src/test/java/donggi/dev/kkeuroolryo/url/presentation/ShortUrlRestControllerTest.java index 7fcd994..4ef1a13 100644 --- a/src/test/java/donggi/dev/kkeuroolryo/web/url/ShortUrlRestControllerTest.java +++ b/src/test/java/donggi/dev/kkeuroolryo/url/presentation/ShortUrlRestControllerTest.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.web.url; +package donggi.dev.kkeuroolryo.url.presentation; import static io.restassured.RestAssured.given; import static org.springframework.restdocs.payload.PayloadDocumentation.fieldWithPath; @@ -8,13 +8,13 @@ import static org.springframework.restdocs.request.RequestDocumentation.pathParameters; import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.document; -import donggi.dev.kkeuroolryo.InitRestDocsTest; -import donggi.dev.kkeuroolryo.RestAssuredAndRestDocsTest; -import donggi.dev.kkeuroolryo.core.url.application.ShortUrlService; -import donggi.dev.kkeuroolryo.core.url.domain.ShortUrlJpaRepository; -import donggi.dev.kkeuroolryo.core.url.domain.Url; -import donggi.dev.kkeuroolryo.core.url.dto.ShortUrlResponseDto; -import donggi.dev.kkeuroolryo.web.url.dto.ShortUrlRequestDto; +import donggi.dev.kkeuroolryo.support.InitRestDocsTest; +import donggi.dev.kkeuroolryo.support.RestAssuredAndRestDocsTest; +import donggi.dev.kkeuroolryo.url.application.ShortUrlService; +import donggi.dev.kkeuroolryo.url.infrastructure.ShortUrlJpaRepository; +import donggi.dev.kkeuroolryo.url.domain.Url; +import donggi.dev.kkeuroolryo.url.application.dto.ShortUrlResponseDto; +import donggi.dev.kkeuroolryo.url.presentation.dto.ShortUrlRequestDto; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/src/test/java/donggi/dev/kkeuroolryo/core/user/application/UserServiceTest.java b/src/test/java/donggi/dev/kkeuroolryo/user/application/UserServiceTest.java similarity index 78% rename from src/test/java/donggi/dev/kkeuroolryo/core/user/application/UserServiceTest.java rename to src/test/java/donggi/dev/kkeuroolryo/user/application/UserServiceTest.java index 7fa4f9c..3027d91 100644 --- a/src/test/java/donggi/dev/kkeuroolryo/core/user/application/UserServiceTest.java +++ b/src/test/java/donggi/dev/kkeuroolryo/user/application/UserServiceTest.java @@ -1,13 +1,13 @@ -package donggi.dev.kkeuroolryo.core.user.application; +package donggi.dev.kkeuroolryo.user.application; import static org.assertj.core.api.SoftAssertions.assertSoftly; -import donggi.dev.kkeuroolryo.IntegrationTest; -import donggi.dev.kkeuroolryo.core.user.application.dto.LoginTokens; -import donggi.dev.kkeuroolryo.core.user.domain.User; -import donggi.dev.kkeuroolryo.core.user.domain.UserRepository; -import donggi.dev.kkeuroolryo.web.user.dto.LoginRequestDto; -import donggi.dev.kkeuroolryo.web.user.dto.SignupRequestDto; +import donggi.dev.kkeuroolryo.support.IntegrationTest; +import donggi.dev.kkeuroolryo.user.application.dto.LoginTokens; +import donggi.dev.kkeuroolryo.user.domain.User; +import donggi.dev.kkeuroolryo.user.domain.UserRepository; +import donggi.dev.kkeuroolryo.user.presentation.dto.LoginRequestDto; +import donggi.dev.kkeuroolryo.user.presentation.dto.SignupRequestDto; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; @@ -29,6 +29,8 @@ class UserServiceTest { @BeforeEach void setUp() { + userRepository.deleteAllInBatch(); + SignupRequestDto signupRequestDto = new SignupRequestDto("loginId", "password"); user = userRepository.save(signupRequestDto.convertToEntity()); diff --git a/src/test/java/donggi/dev/kkeuroolryo/web/user/UserRestControllerRestDocsTest.java b/src/test/java/donggi/dev/kkeuroolryo/user/presentation/UserRestControllerRestDocsTest.java similarity index 90% rename from src/test/java/donggi/dev/kkeuroolryo/web/user/UserRestControllerRestDocsTest.java rename to src/test/java/donggi/dev/kkeuroolryo/user/presentation/UserRestControllerRestDocsTest.java index 529ca75..9479332 100644 --- a/src/test/java/donggi/dev/kkeuroolryo/web/user/UserRestControllerRestDocsTest.java +++ b/src/test/java/donggi/dev/kkeuroolryo/user/presentation/UserRestControllerRestDocsTest.java @@ -1,4 +1,4 @@ -package donggi.dev.kkeuroolryo.web.user; +package donggi.dev.kkeuroolryo.user.presentation; import static io.restassured.RestAssured.given; import static org.springframework.restdocs.payload.PayloadDocumentation.fieldWithPath; @@ -6,12 +6,12 @@ import static org.springframework.restdocs.payload.PayloadDocumentation.responseFields; import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.document; -import donggi.dev.kkeuroolryo.InitRestDocsTest; -import donggi.dev.kkeuroolryo.RestAssuredAndRestDocsTest; -import donggi.dev.kkeuroolryo.core.user.domain.User; -import donggi.dev.kkeuroolryo.core.user.domain.UserRepository; -import donggi.dev.kkeuroolryo.web.user.dto.LoginRequestDto; -import donggi.dev.kkeuroolryo.web.user.dto.SignupRequestDto; +import donggi.dev.kkeuroolryo.support.InitRestDocsTest; +import donggi.dev.kkeuroolryo.support.RestAssuredAndRestDocsTest; +import donggi.dev.kkeuroolryo.user.domain.User; +import donggi.dev.kkeuroolryo.user.domain.UserRepository; +import donggi.dev.kkeuroolryo.user.presentation.dto.LoginRequestDto; +import donggi.dev.kkeuroolryo.user.presentation.dto.SignupRequestDto; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test;