Skip to content

Commit

Permalink
refactor: 패키지 구조 변경 (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
donggi-lee-bit authored Feb 4, 2024
1 parent 7a88c25 commit 71530c0
Show file tree
Hide file tree
Showing 88 changed files with 413 additions and 473 deletions.
Original file line number Diff line number Diff line change
@@ -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 {

Expand Down
Original file line number Diff line number Diff line change
@@ -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 {

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package donggi.dev.kkeuroolryo.web.comment.dto;
package donggi.dev.kkeuroolryo.comment.presentation.dto;

import lombok.Getter;
import lombok.NoArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package donggi.dev.kkeuroolryo.core.common;
package donggi.dev.kkeuroolryo.common;

import lombok.Getter;

Expand Down
Original file line number Diff line number Diff line change
@@ -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 {

Expand Down
Original file line number Diff line number Diff line change
@@ -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 {

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -101,8 +96,8 @@ public RandomQuestionsDto getRandomQuestionsByCategory(Category category) {

private List<Long> retrieveQuestionIdsByCategory(Category category) {
List<Category> 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);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package donggi.dev.kkeuroolryo.core.question.domain;
package donggi.dev.kkeuroolryo.question.domain;

import java.util.Optional;

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Loading

0 comments on commit 71530c0

Please sign in to comment.