Skip to content

Commit

Permalink
style: list domain 패키지 구조 변경 (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdkdhoho committed Feb 15, 2024
1 parent 2047caa commit c5ce9b3
Show file tree
Hide file tree
Showing 50 changed files with 99 additions and 98 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.listywave.collaborator.application.domain;

import com.listywave.list.application.domain.ListEntity;
import com.listywave.list.application.domain.list.ListEntity;
import com.listywave.user.application.domain.User;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.listywave.collaborator.repository;

import com.listywave.collaborator.application.domain.Collaborator;
import com.listywave.list.application.domain.ListEntity;
import com.listywave.list.application.domain.list.ListEntity;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import com.listywave.image.application.dto.ExtensionRanks;
import com.listywave.image.application.dto.response.ItemPresignedUrlResponse;
import com.listywave.image.application.dto.response.UserPresignedUrlResponse;
import com.listywave.list.application.domain.Item;
import com.listywave.list.application.domain.ListEntity;
import com.listywave.list.application.domain.item.Item;
import com.listywave.list.application.domain.list.ListEntity;
import com.listywave.list.repository.ItemRepository;
import com.listywave.list.repository.list.ListRepository;
import com.listywave.user.application.domain.User;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.listywave.list.application.domain;
package com.listywave.list.application.domain.category;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.listywave.common.exception.CustomException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.listywave.list.application.domain;
package com.listywave.list.application.domain.category;

import jakarta.persistence.AttributeConverter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.listywave.list.application.domain;
package com.listywave.list.application.domain.comment;

import com.listywave.common.BaseEntity;
import com.listywave.list.application.vo.Content;
import com.listywave.list.application.domain.list.Content;
import com.listywave.list.application.domain.list.ListEntity;
import com.listywave.user.application.domain.User;
import jakarta.persistence.Column;
import jakarta.persistence.Embedded;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package com.listywave.list.application.domain;
package com.listywave.list.application.domain.item;

import com.listywave.common.BaseEntity;
import com.listywave.list.application.vo.ItemComment;
import com.listywave.list.application.vo.ItemImageUrl;
import com.listywave.list.application.vo.ItemLink;
import com.listywave.list.application.vo.ItemTitle;
import com.listywave.list.application.domain.list.ListEntity;
import com.listywave.list.presentation.dto.request.ItemCreateRequest;
import jakarta.persistence.Column;
import jakarta.persistence.Embedded;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.listywave.list.application.vo;
package com.listywave.list.application.domain.item;

import com.listywave.common.exception.CustomException;
import com.listywave.common.exception.ErrorCode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.listywave.list.application.vo;
package com.listywave.list.application.domain.item;

import com.listywave.common.exception.CustomException;
import com.listywave.common.exception.ErrorCode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.listywave.list.application.vo;
package com.listywave.list.application.domain.item;

import com.listywave.common.exception.CustomException;
import com.listywave.common.exception.ErrorCode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.listywave.list.application.vo;
package com.listywave.list.application.domain.item;

import com.listywave.common.exception.CustomException;
import com.listywave.common.exception.ErrorCode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.listywave.list.application.domain;
package com.listywave.list.application.domain.label;

import com.listywave.list.application.vo.LabelName;
import com.listywave.list.application.domain.list.ListEntity;
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,4 +1,4 @@
package com.listywave.list.application.vo;
package com.listywave.list.application.domain.label;

import com.listywave.common.exception.CustomException;
import com.listywave.common.exception.ErrorCode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.listywave.list.application.vo;
package com.listywave.list.application.domain.list;

import com.listywave.common.exception.CustomException;
import com.listywave.common.exception.ErrorCode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.listywave.list.application.vo;
package com.listywave.list.application.domain.list;

import com.listywave.common.exception.CustomException;
import com.listywave.common.exception.ErrorCode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
package com.listywave.list.application.domain;
package com.listywave.list.application.domain.list;

import static com.listywave.common.util.StringUtils.match;

import com.listywave.list.application.domain.category.CategoryType;
import com.listywave.list.application.domain.category.CategoryTypeConverter;
import com.listywave.list.application.domain.item.Item;
import com.listywave.list.application.domain.item.ItemComment;
import com.listywave.list.application.domain.item.ItemImageUrl;
import com.listywave.list.application.domain.item.ItemLink;
import com.listywave.list.application.domain.item.ItemTitle;
import com.listywave.list.application.domain.label.Label;
import com.listywave.list.application.domain.label.LabelName;
import com.listywave.list.application.dto.ListCreateCommand;
import com.listywave.list.application.vo.ItemComment;
import com.listywave.list.application.vo.ItemImageUrl;
import com.listywave.list.application.vo.ItemLink;
import com.listywave.list.application.vo.ItemTitle;
import com.listywave.list.application.vo.LabelName;
import com.listywave.list.application.vo.ListDescription;
import com.listywave.list.application.vo.ListTitle;
import com.listywave.list.presentation.dto.request.ItemCreateRequest;
import com.listywave.user.application.domain.User;
import jakarta.persistence.CascadeType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.listywave.list.application.vo;
package com.listywave.list.application.domain.list;

import com.listywave.common.exception.CustomException;
import com.listywave.common.exception.ErrorCode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.listywave.list.application.domain;
package com.listywave.list.application.domain.list;

public enum SortType {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.listywave.list.application.domain;
package com.listywave.list.application.domain.reply;

import com.listywave.common.BaseEntity;
import com.listywave.list.application.vo.Content;
import com.listywave.list.application.domain.comment.Comment;
import com.listywave.list.application.domain.list.Content;
import com.listywave.user.application.domain.User;
import jakarta.persistence.Embedded;
import jakarta.persistence.Entity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.listywave.list.application.dto;

import com.listywave.list.application.domain.CategoryType;
import com.listywave.list.application.vo.ListDescription;
import com.listywave.list.application.vo.ListTitle;
import com.listywave.list.application.domain.category.CategoryType;
import com.listywave.list.application.domain.list.ListDescription;
import com.listywave.list.application.domain.list.ListTitle;
import com.listywave.list.presentation.dto.request.ListCreateRequest;

public record ListCreateCommand(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.listywave.list.application.dto.response;

import com.listywave.list.application.domain.CategoryType;
import com.listywave.list.application.domain.category.CategoryType;

public record CategoryTypeResponse(
String codeValue,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.listywave.list.application.dto.response;

import com.listywave.list.application.domain.Comment;
import com.listywave.list.application.domain.comment.Comment;
import com.listywave.user.application.domain.User;
import java.time.LocalDateTime;
import lombok.Builder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import static java.util.Collections.emptyList;

import com.listywave.list.application.domain.Comment;
import com.listywave.list.application.domain.Reply;
import com.listywave.list.application.domain.comment.Comment;
import com.listywave.list.application.domain.reply.Reply;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.listywave.list.application.dto.response;

import com.listywave.collaborator.application.domain.Collaborator;
import com.listywave.list.application.domain.Item;
import com.listywave.list.application.domain.Label;
import com.listywave.list.application.domain.ListEntity;
import com.listywave.list.application.domain.item.Item;
import com.listywave.list.application.domain.label.Label;
import com.listywave.list.application.domain.list.ListEntity;
import com.listywave.user.application.domain.User;
import java.time.LocalDateTime;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.listywave.list.application.dto.response;

import com.listywave.list.application.domain.Item;
import com.listywave.list.application.domain.Label;
import com.listywave.list.application.domain.ListEntity;
import com.listywave.list.application.domain.item.Item;
import com.listywave.list.application.domain.label.Label;
import com.listywave.list.application.domain.list.ListEntity;
import java.util.Comparator;
import java.util.List;
import lombok.Builder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.listywave.list.application.dto.response;

import com.listywave.list.application.domain.Item;
import com.listywave.list.application.domain.ListEntity;
import com.listywave.list.application.domain.item.Item;
import com.listywave.list.application.domain.list.ListEntity;
import java.time.LocalDateTime;
import java.util.List;
import lombok.Builder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.listywave.list.application.dto.response;

import com.listywave.list.application.domain.ListEntity;
import com.listywave.list.application.domain.list.ListEntity;
import lombok.Builder;

@Builder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.listywave.list.application.dto.response;

import com.listywave.list.application.domain.Comment;
import com.listywave.list.application.domain.Reply;
import com.listywave.list.application.domain.comment.Comment;
import com.listywave.list.application.domain.reply.Reply;
import com.listywave.user.application.domain.User;
import java.time.LocalDateTime;
import lombok.Builder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import com.listywave.auth.application.domain.JwtManager;
import com.listywave.common.exception.CustomException;
import com.listywave.list.application.domain.Comment;
import com.listywave.list.application.domain.ListEntity;
import com.listywave.list.application.domain.Reply;
import com.listywave.list.application.domain.comment.Comment;
import com.listywave.list.application.domain.list.ListEntity;
import com.listywave.list.application.domain.reply.Reply;
import com.listywave.list.application.dto.response.CommentCreateResponse;
import com.listywave.list.application.dto.response.CommentFindResponse;
import com.listywave.list.repository.CommentRepository;
Expand Down Expand Up @@ -80,7 +80,7 @@ public void delete(Long listId, Long commentId, String accessToken) {
if (!comment.canDeleteBy(user)) {
throw new CustomException(INVALID_ACCESS, "댓글은 작성자만 지울 수 있습니다.");
}

if (replyRepository.existsByComment(comment)) {
comment.softDelete();
return;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.listywave.list.application.service;

import static com.listywave.common.exception.ErrorCode.INVALID_ACCESS;
import static com.listywave.list.application.domain.SortType.COLLECTED;
import static com.listywave.list.application.domain.SortType.OLD;
import static com.listywave.list.application.domain.list.SortType.COLLECTED;
import static com.listywave.list.application.domain.list.SortType.OLD;

import com.listywave.auth.application.domain.JwtManager;
import com.listywave.collaborator.application.domain.Collaborator;
Expand All @@ -11,11 +11,11 @@
import com.listywave.common.exception.ErrorCode;
import com.listywave.common.util.UserUtil;
import com.listywave.image.application.service.ImageService;
import com.listywave.list.application.domain.CategoryType;
import com.listywave.list.application.domain.Comment;
import com.listywave.list.application.domain.Item;
import com.listywave.list.application.domain.ListEntity;
import com.listywave.list.application.domain.SortType;
import com.listywave.list.application.domain.category.CategoryType;
import com.listywave.list.application.domain.comment.Comment;
import com.listywave.list.application.domain.item.Item;
import com.listywave.list.application.domain.list.ListEntity;
import com.listywave.list.application.domain.list.SortType;
import com.listywave.list.application.dto.ListCreateCommand;
import com.listywave.list.application.dto.response.ListCreateResponse;
import com.listywave.list.application.dto.response.ListDetailResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import com.listywave.auth.application.domain.JwtManager;
import com.listywave.common.exception.CustomException;
import com.listywave.common.exception.ErrorCode;
import com.listywave.list.application.domain.Comment;
import com.listywave.list.application.domain.Reply;
import com.listywave.list.application.domain.comment.Comment;
import com.listywave.list.application.domain.list.Content;
import com.listywave.list.application.domain.reply.Reply;
import com.listywave.list.application.dto.ReplyDeleteCommand;
import com.listywave.list.application.dto.response.ReplyCreateResponse;
import com.listywave.list.application.vo.Content;
import com.listywave.list.repository.CommentRepository;
import com.listywave.list.repository.list.ListRepository;
import com.listywave.list.repository.reply.ReplyRepository;
Expand Down Expand Up @@ -50,7 +50,7 @@ public void delete(ReplyDeleteCommand command, String accessToken) {
if (!reply.canDeleteBy(user)) {
throw new CustomException(ErrorCode.INVALID_ACCESS, "답글은 작성자만 삭제할 수 있습니다.");
}

replyRepository.deleteById(command.replyId());
if (!replyRepository.existsByComment(comment) && comment.isDeleted()) {
commentRepository.delete(comment);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.listywave.list.presentation.controller;

import com.listywave.list.application.domain.CategoryType;
import com.listywave.list.application.domain.category.CategoryType;
import com.listywave.list.application.dto.response.CategoryTypeResponse;
import java.util.Arrays;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import static org.springframework.http.HttpHeaders.AUTHORIZATION;

import com.listywave.list.application.domain.CategoryType;
import com.listywave.list.application.domain.SortType;
import com.listywave.list.application.domain.category.CategoryType;
import com.listywave.list.application.domain.list.SortType;
import com.listywave.list.application.dto.ListCreateCommand;
import com.listywave.list.application.dto.response.ListCreateResponse;
import com.listywave.list.application.dto.response.ListDetailResponse;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.listywave.list.presentation.dto.request;

import com.listywave.list.application.domain.CategoryType;
import com.listywave.list.application.domain.category.CategoryType;
import com.listywave.list.application.domain.list.ListDescription;
import com.listywave.list.application.domain.list.ListTitle;
import com.listywave.list.application.dto.ListCreateCommand;
import com.listywave.list.application.vo.ListDescription;
import com.listywave.list.application.vo.ListTitle;
import java.util.List;

public record ListCreateRequest(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import static com.listywave.common.exception.ErrorCode.RESOURCE_NOT_FOUND;

import com.listywave.common.exception.CustomException;
import com.listywave.list.application.domain.Comment;
import com.listywave.list.application.domain.ListEntity;
import com.listywave.list.application.domain.comment.Comment;
import com.listywave.list.application.domain.list.ListEntity;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.listywave.list.repository;

import com.listywave.list.application.domain.Comment;
import com.listywave.list.application.domain.ListEntity;
import com.listywave.list.application.domain.comment.Comment;
import com.listywave.list.application.domain.list.ListEntity;
import java.util.List;

public interface CustomCommentRepository {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import static com.listywave.list.application.domain.QComment.comment;
import static com.listywave.list.application.domain.QListEntity.listEntity;

import com.listywave.list.application.domain.Comment;
import com.listywave.list.application.domain.ListEntity;
import com.listywave.list.application.domain.comment.Comment;
import com.listywave.list.application.domain.list.ListEntity;
import com.querydsl.jpa.impl.JPAQueryFactory;
import java.util.List;
import lombok.RequiredArgsConstructor;
Expand Down
Loading

0 comments on commit c5ce9b3

Please sign in to comment.