From a137a11486edc3745e2128776f4d1aa2e437430a Mon Sep 17 00:00:00 2001 From: SeoSeunghun Date: Sun, 11 Feb 2024 00:07:13 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EC=98=81=EC=86=8D=EC=84=B1=20?= =?UTF-8?q?=EC=96=B4=EB=8C=91=ED=84=B0=20=EB=AA=A8=EB=93=88=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adapter/persistence/build.gradle | 6 ++++++ .../ticketlounge/persistence/member}/MemberMapper.java | 6 +++--- .../persistence/member}/MemberPersistenceAdapter.java | 10 +++++----- .../persistence/member}/MemberRepository.java | 4 ++-- .../persistence/member}/entity/MemberJpaEntity.java | 2 +- .../persistence/product}/EarnedProductMapper.java | 6 +++--- .../product}/EarnedProductPersistenceAdapter.java | 8 ++++---- .../persistence/product}/EarnedProductRepository.java | 4 ++-- .../persistence/product}/ProductMapper.java | 6 +++--- .../product}/ProductPersistenceAdapter.java | 8 ++++---- .../persistence/product}/ProductRepository.java | 4 ++-- .../product}/entity/EarnedProductJpaEntity.java | 2 +- .../persistence/product}/entity/ProductJpaEntity.java | 2 +- .../ticketlounge/persistence/ticket}/TicketMapper.java | 5 +++-- .../persistence/ticket}/TicketPersistenceAdapter.java | 8 ++++---- .../persistence/ticket}/TicketRepository.java | 4 +++- .../persistence/ticket/entity}/TicketJpaEntity.java | 2 +- 17 files changed, 48 insertions(+), 39 deletions(-) create mode 100644 adapter/persistence/build.gradle rename {src/main/java/com/ticketexchange/member/adapter/out/persistence => adapter/persistence/src/main/java/com/ticketlounge/persistence/member}/MemberMapper.java (76%) rename {src/main/java/com/ticketexchange/member/adapter/out/persistence => adapter/persistence/src/main/java/com/ticketlounge/persistence/member}/MemberPersistenceAdapter.java (75%) rename {src/main/java/com/ticketexchange/member/adapter/out/persistence => adapter/persistence/src/main/java/com/ticketlounge/persistence/member}/MemberRepository.java (70%) rename {src/main/java/com/ticketexchange/member/adapter/out/persistence => adapter/persistence/src/main/java/com/ticketlounge/persistence/member}/entity/MemberJpaEntity.java (95%) rename {src/main/java/com/ticketexchange/product/adapter/out/persistence => adapter/persistence/src/main/java/com/ticketlounge/persistence/product}/EarnedProductMapper.java (76%) rename {src/main/java/com/ticketexchange/product/adapter/out/persistence => adapter/persistence/src/main/java/com/ticketlounge/persistence/product}/EarnedProductPersistenceAdapter.java (77%) rename {src/main/java/com/ticketexchange/product/adapter/out/persistence => adapter/persistence/src/main/java/com/ticketlounge/persistence/product}/EarnedProductRepository.java (71%) rename {src/main/java/com/ticketexchange/product/adapter/out/persistence => adapter/persistence/src/main/java/com/ticketlounge/persistence/product}/ProductMapper.java (83%) rename {src/main/java/com/ticketexchange/product/adapter/out/persistence => adapter/persistence/src/main/java/com/ticketlounge/persistence/product}/ProductPersistenceAdapter.java (80%) rename {src/main/java/com/ticketexchange/product/adapter/out/persistence => adapter/persistence/src/main/java/com/ticketlounge/persistence/product}/ProductRepository.java (85%) rename {src/main/java/com/ticketexchange/product/adapter/out/persistence => adapter/persistence/src/main/java/com/ticketlounge/persistence/product}/entity/EarnedProductJpaEntity.java (95%) rename {src/main/java/com/ticketexchange/product/adapter/out/persistence => adapter/persistence/src/main/java/com/ticketlounge/persistence/product}/entity/ProductJpaEntity.java (96%) rename {src/main/java/com/ticketexchange/ticket/adapter/out/persistence => adapter/persistence/src/main/java/com/ticketlounge/persistence/ticket}/TicketMapper.java (82%) rename {src/main/java/com/ticketexchange/ticket/adapter/out/persistence => adapter/persistence/src/main/java/com/ticketlounge/persistence/ticket}/TicketPersistenceAdapter.java (82%) rename {src/main/java/com/ticketexchange/ticket/adapter/out/persistence => adapter/persistence/src/main/java/com/ticketlounge/persistence/ticket}/TicketRepository.java (83%) rename {src/main/java/com/ticketexchange/ticket/adapter/out/persistence => adapter/persistence/src/main/java/com/ticketlounge/persistence/ticket/entity}/TicketJpaEntity.java (97%) diff --git a/adapter/persistence/build.gradle b/adapter/persistence/build.gradle new file mode 100644 index 0000000..b96e02d --- /dev/null +++ b/adapter/persistence/build.gradle @@ -0,0 +1,6 @@ +dependencies { + implementation(project(":domain")) + implementation(project(":application")) + + implementation("org.springframework.boot:spring-boot-starter-data-jpa") +} diff --git a/src/main/java/com/ticketexchange/member/adapter/out/persistence/MemberMapper.java b/adapter/persistence/src/main/java/com/ticketlounge/persistence/member/MemberMapper.java similarity index 76% rename from src/main/java/com/ticketexchange/member/adapter/out/persistence/MemberMapper.java rename to adapter/persistence/src/main/java/com/ticketlounge/persistence/member/MemberMapper.java index fad187f..f864f92 100644 --- a/src/main/java/com/ticketexchange/member/adapter/out/persistence/MemberMapper.java +++ b/adapter/persistence/src/main/java/com/ticketlounge/persistence/member/MemberMapper.java @@ -1,7 +1,7 @@ -package com.ticketexchange.member.adapter.out.persistence; +package com.ticketlounge.persistence.member; -import com.ticketexchange.member.adapter.out.persistence.entity.MemberJpaEntity; -import com.ticketexchange.member.domain.Member; +import com.ticketlounge.persistence.member.entity.MemberJpaEntity; +import com.ticketlounge.domain.member.Member; public final class MemberMapper { diff --git a/src/main/java/com/ticketexchange/member/adapter/out/persistence/MemberPersistenceAdapter.java b/adapter/persistence/src/main/java/com/ticketlounge/persistence/member/MemberPersistenceAdapter.java similarity index 75% rename from src/main/java/com/ticketexchange/member/adapter/out/persistence/MemberPersistenceAdapter.java rename to adapter/persistence/src/main/java/com/ticketlounge/persistence/member/MemberPersistenceAdapter.java index a1015ad..0200d7e 100644 --- a/src/main/java/com/ticketexchange/member/adapter/out/persistence/MemberPersistenceAdapter.java +++ b/adapter/persistence/src/main/java/com/ticketlounge/persistence/member/MemberPersistenceAdapter.java @@ -1,11 +1,11 @@ -package com.ticketexchange.member.adapter.out.persistence; +package com.ticketlounge.persistence.member; import org.springframework.stereotype.Repository; -import com.ticketexchange.member.adapter.out.persistence.entity.MemberJpaEntity; -import com.ticketexchange.member.application.port.out.MemberQueryPort; -import com.ticketexchange.member.application.port.out.SaveMemberPort; -import com.ticketexchange.member.domain.Member; +import com.ticketlounge.persistence.member.entity.MemberJpaEntity; +import com.ticketlounge.application.member.port.out.MemberQueryPort; +import com.ticketlounge.application.member.port.out.SaveMemberPort; +import com.ticketlounge.domain.member.Member; @Repository public class MemberPersistenceAdapter implements MemberQueryPort, SaveMemberPort { diff --git a/src/main/java/com/ticketexchange/member/adapter/out/persistence/MemberRepository.java b/adapter/persistence/src/main/java/com/ticketlounge/persistence/member/MemberRepository.java similarity index 70% rename from src/main/java/com/ticketexchange/member/adapter/out/persistence/MemberRepository.java rename to adapter/persistence/src/main/java/com/ticketlounge/persistence/member/MemberRepository.java index 2ac2e31..81d0025 100644 --- a/src/main/java/com/ticketexchange/member/adapter/out/persistence/MemberRepository.java +++ b/adapter/persistence/src/main/java/com/ticketlounge/persistence/member/MemberRepository.java @@ -1,10 +1,10 @@ -package com.ticketexchange.member.adapter.out.persistence; +package com.ticketlounge.persistence.member; import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; -import com.ticketexchange.member.adapter.out.persistence.entity.MemberJpaEntity; +import com.ticketlounge.persistence.member.entity.MemberJpaEntity; public interface MemberRepository extends JpaRepository { diff --git a/src/main/java/com/ticketexchange/member/adapter/out/persistence/entity/MemberJpaEntity.java b/adapter/persistence/src/main/java/com/ticketlounge/persistence/member/entity/MemberJpaEntity.java similarity index 95% rename from src/main/java/com/ticketexchange/member/adapter/out/persistence/entity/MemberJpaEntity.java rename to adapter/persistence/src/main/java/com/ticketlounge/persistence/member/entity/MemberJpaEntity.java index f9201a0..9136668 100644 --- a/src/main/java/com/ticketexchange/member/adapter/out/persistence/entity/MemberJpaEntity.java +++ b/adapter/persistence/src/main/java/com/ticketlounge/persistence/member/entity/MemberJpaEntity.java @@ -1,4 +1,4 @@ -package com.ticketexchange.member.adapter.out.persistence.entity; +package com.ticketlounge.persistence.member.entity; import jakarta.persistence.Column; import jakarta.persistence.Entity; diff --git a/src/main/java/com/ticketexchange/product/adapter/out/persistence/EarnedProductMapper.java b/adapter/persistence/src/main/java/com/ticketlounge/persistence/product/EarnedProductMapper.java similarity index 76% rename from src/main/java/com/ticketexchange/product/adapter/out/persistence/EarnedProductMapper.java rename to adapter/persistence/src/main/java/com/ticketlounge/persistence/product/EarnedProductMapper.java index fbe43c9..29adede 100644 --- a/src/main/java/com/ticketexchange/product/adapter/out/persistence/EarnedProductMapper.java +++ b/adapter/persistence/src/main/java/com/ticketlounge/persistence/product/EarnedProductMapper.java @@ -1,7 +1,7 @@ -package com.ticketexchange.product.adapter.out.persistence; +package com.ticketlounge.persistence.product; -import com.ticketexchange.product.adapter.out.persistence.entity.EarnedProductJpaEntity; -import com.ticketexchange.product.domain.EarnedProduct; +import com.ticketlounge.persistence.product.entity.EarnedProductJpaEntity; +import com.ticketlounge.domain.product.EarnedProduct; public final class EarnedProductMapper { diff --git a/src/main/java/com/ticketexchange/product/adapter/out/persistence/EarnedProductPersistenceAdapter.java b/adapter/persistence/src/main/java/com/ticketlounge/persistence/product/EarnedProductPersistenceAdapter.java similarity index 77% rename from src/main/java/com/ticketexchange/product/adapter/out/persistence/EarnedProductPersistenceAdapter.java rename to adapter/persistence/src/main/java/com/ticketlounge/persistence/product/EarnedProductPersistenceAdapter.java index c0d8534..a3ca51e 100644 --- a/src/main/java/com/ticketexchange/product/adapter/out/persistence/EarnedProductPersistenceAdapter.java +++ b/adapter/persistence/src/main/java/com/ticketlounge/persistence/product/EarnedProductPersistenceAdapter.java @@ -1,12 +1,12 @@ -package com.ticketexchange.product.adapter.out.persistence; +package com.ticketlounge.persistence.product; import java.util.List; import org.springframework.stereotype.Repository; -import com.ticketexchange.product.application.port.out.EarnedProductPort; -import com.ticketexchange.product.application.port.out.EarnedProductQueryPort; -import com.ticketexchange.product.domain.EarnedProduct; +import com.ticketlounge.application.product.port.out.EarnedProductPort; +import com.ticketlounge.application.product.port.out.EarnedProductQueryPort; +import com.ticketlounge.domain.product.EarnedProduct; @Repository public class EarnedProductPersistenceAdapter implements EarnedProductPort, EarnedProductQueryPort { diff --git a/src/main/java/com/ticketexchange/product/adapter/out/persistence/EarnedProductRepository.java b/adapter/persistence/src/main/java/com/ticketlounge/persistence/product/EarnedProductRepository.java similarity index 71% rename from src/main/java/com/ticketexchange/product/adapter/out/persistence/EarnedProductRepository.java rename to adapter/persistence/src/main/java/com/ticketlounge/persistence/product/EarnedProductRepository.java index b75475c..1920be3 100644 --- a/src/main/java/com/ticketexchange/product/adapter/out/persistence/EarnedProductRepository.java +++ b/adapter/persistence/src/main/java/com/ticketlounge/persistence/product/EarnedProductRepository.java @@ -1,11 +1,11 @@ -package com.ticketexchange.product.adapter.out.persistence; +package com.ticketlounge.persistence.product; import java.util.List; import org.springframework.data.jpa.repository.EntityGraph; import org.springframework.data.jpa.repository.JpaRepository; -import com.ticketexchange.product.adapter.out.persistence.entity.EarnedProductJpaEntity; +import com.ticketlounge.persistence.product.entity.EarnedProductJpaEntity; public interface EarnedProductRepository extends JpaRepository { diff --git a/src/main/java/com/ticketexchange/product/adapter/out/persistence/ProductMapper.java b/adapter/persistence/src/main/java/com/ticketlounge/persistence/product/ProductMapper.java similarity index 83% rename from src/main/java/com/ticketexchange/product/adapter/out/persistence/ProductMapper.java rename to adapter/persistence/src/main/java/com/ticketlounge/persistence/product/ProductMapper.java index 719dc0f..15575c6 100644 --- a/src/main/java/com/ticketexchange/product/adapter/out/persistence/ProductMapper.java +++ b/adapter/persistence/src/main/java/com/ticketlounge/persistence/product/ProductMapper.java @@ -1,7 +1,7 @@ -package com.ticketexchange.product.adapter.out.persistence; +package com.ticketlounge.persistence.product; -import com.ticketexchange.product.adapter.out.persistence.entity.ProductJpaEntity; -import com.ticketexchange.product.domain.Product; +import com.ticketlounge.persistence.product.entity.ProductJpaEntity; +import com.ticketlounge.domain.product.Product; public final class ProductMapper { diff --git a/src/main/java/com/ticketexchange/product/adapter/out/persistence/ProductPersistenceAdapter.java b/adapter/persistence/src/main/java/com/ticketlounge/persistence/product/ProductPersistenceAdapter.java similarity index 80% rename from src/main/java/com/ticketexchange/product/adapter/out/persistence/ProductPersistenceAdapter.java rename to adapter/persistence/src/main/java/com/ticketlounge/persistence/product/ProductPersistenceAdapter.java index 381bb05..93487b8 100644 --- a/src/main/java/com/ticketexchange/product/adapter/out/persistence/ProductPersistenceAdapter.java +++ b/adapter/persistence/src/main/java/com/ticketlounge/persistence/product/ProductPersistenceAdapter.java @@ -1,13 +1,13 @@ -package com.ticketexchange.product.adapter.out.persistence; +package com.ticketlounge.persistence.product; import java.time.LocalDate; import java.util.List; import org.springframework.stereotype.Repository; -import com.ticketexchange.product.application.port.out.ProductPort; -import com.ticketexchange.product.application.port.out.ProductQueryPort; -import com.ticketexchange.product.domain.Product; +import com.ticketlounge.application.product.port.out.ProductPort; +import com.ticketlounge.application.product.port.out.ProductQueryPort; +import com.ticketlounge.domain.product.Product; @Repository public class ProductPersistenceAdapter implements ProductQueryPort, ProductPort { diff --git a/src/main/java/com/ticketexchange/product/adapter/out/persistence/ProductRepository.java b/adapter/persistence/src/main/java/com/ticketlounge/persistence/product/ProductRepository.java similarity index 85% rename from src/main/java/com/ticketexchange/product/adapter/out/persistence/ProductRepository.java rename to adapter/persistence/src/main/java/com/ticketlounge/persistence/product/ProductRepository.java index fb5cdc7..59b8510 100644 --- a/src/main/java/com/ticketexchange/product/adapter/out/persistence/ProductRepository.java +++ b/adapter/persistence/src/main/java/com/ticketlounge/persistence/product/ProductRepository.java @@ -1,4 +1,4 @@ -package com.ticketexchange.product.adapter.out.persistence; +package com.ticketlounge.persistence.product; import java.time.LocalDate; import java.util.List; @@ -10,7 +10,7 @@ import org.springframework.data.jpa.repository.Lock; import org.springframework.data.jpa.repository.Query; -import com.ticketexchange.product.adapter.out.persistence.entity.ProductJpaEntity; +import com.ticketlounge.persistence.product.entity.ProductJpaEntity; public interface ProductRepository extends JpaRepository { diff --git a/src/main/java/com/ticketexchange/product/adapter/out/persistence/entity/EarnedProductJpaEntity.java b/adapter/persistence/src/main/java/com/ticketlounge/persistence/product/entity/EarnedProductJpaEntity.java similarity index 95% rename from src/main/java/com/ticketexchange/product/adapter/out/persistence/entity/EarnedProductJpaEntity.java rename to adapter/persistence/src/main/java/com/ticketlounge/persistence/product/entity/EarnedProductJpaEntity.java index c64a92d..ce1f905 100644 --- a/src/main/java/com/ticketexchange/product/adapter/out/persistence/entity/EarnedProductJpaEntity.java +++ b/adapter/persistence/src/main/java/com/ticketlounge/persistence/product/entity/EarnedProductJpaEntity.java @@ -1,4 +1,4 @@ -package com.ticketexchange.product.adapter.out.persistence.entity; +package com.ticketlounge.persistence.product.entity; import java.time.LocalDateTime; diff --git a/src/main/java/com/ticketexchange/product/adapter/out/persistence/entity/ProductJpaEntity.java b/adapter/persistence/src/main/java/com/ticketlounge/persistence/product/entity/ProductJpaEntity.java similarity index 96% rename from src/main/java/com/ticketexchange/product/adapter/out/persistence/entity/ProductJpaEntity.java rename to adapter/persistence/src/main/java/com/ticketlounge/persistence/product/entity/ProductJpaEntity.java index 316f3a8..d0c36d0 100644 --- a/src/main/java/com/ticketexchange/product/adapter/out/persistence/entity/ProductJpaEntity.java +++ b/adapter/persistence/src/main/java/com/ticketlounge/persistence/product/entity/ProductJpaEntity.java @@ -1,4 +1,4 @@ -package com.ticketexchange.product.adapter.out.persistence.entity; +package com.ticketlounge.persistence.product.entity; import java.time.LocalDate; diff --git a/src/main/java/com/ticketexchange/ticket/adapter/out/persistence/TicketMapper.java b/adapter/persistence/src/main/java/com/ticketlounge/persistence/ticket/TicketMapper.java similarity index 82% rename from src/main/java/com/ticketexchange/ticket/adapter/out/persistence/TicketMapper.java rename to adapter/persistence/src/main/java/com/ticketlounge/persistence/ticket/TicketMapper.java index a2e21a7..4c06466 100644 --- a/src/main/java/com/ticketexchange/ticket/adapter/out/persistence/TicketMapper.java +++ b/adapter/persistence/src/main/java/com/ticketlounge/persistence/ticket/TicketMapper.java @@ -1,6 +1,7 @@ -package com.ticketexchange.ticket.adapter.out.persistence; +package com.ticketlounge.persistence.ticket; -import com.ticketexchange.ticket.domain.Ticket; +import com.ticketlounge.persistence.ticket.entity.TicketJpaEntity; +import com.ticketlounge.domain.ticket.Ticket; public final class TicketMapper { diff --git a/src/main/java/com/ticketexchange/ticket/adapter/out/persistence/TicketPersistenceAdapter.java b/adapter/persistence/src/main/java/com/ticketlounge/persistence/ticket/TicketPersistenceAdapter.java similarity index 82% rename from src/main/java/com/ticketexchange/ticket/adapter/out/persistence/TicketPersistenceAdapter.java rename to adapter/persistence/src/main/java/com/ticketlounge/persistence/ticket/TicketPersistenceAdapter.java index 6763133..f295f80 100644 --- a/src/main/java/com/ticketexchange/ticket/adapter/out/persistence/TicketPersistenceAdapter.java +++ b/adapter/persistence/src/main/java/com/ticketlounge/persistence/ticket/TicketPersistenceAdapter.java @@ -1,13 +1,13 @@ -package com.ticketexchange.ticket.adapter.out.persistence; +package com.ticketlounge.persistence.ticket; import java.time.LocalDate; import java.util.List; import org.springframework.stereotype.Repository; -import com.ticketexchange.ticket.application.port.out.SaveTicketPort; -import com.ticketexchange.ticket.application.port.out.TicketQueryPort; -import com.ticketexchange.ticket.domain.Ticket; +import com.ticketlounge.application.ticket.port.out.SaveTicketPort; +import com.ticketlounge.application.ticket.port.out.TicketQueryPort; +import com.ticketlounge.domain.ticket.Ticket; @Repository public class TicketPersistenceAdapter implements SaveTicketPort, TicketQueryPort { diff --git a/src/main/java/com/ticketexchange/ticket/adapter/out/persistence/TicketRepository.java b/adapter/persistence/src/main/java/com/ticketlounge/persistence/ticket/TicketRepository.java similarity index 83% rename from src/main/java/com/ticketexchange/ticket/adapter/out/persistence/TicketRepository.java rename to adapter/persistence/src/main/java/com/ticketlounge/persistence/ticket/TicketRepository.java index d0d8aaf..69d975c 100644 --- a/src/main/java/com/ticketexchange/ticket/adapter/out/persistence/TicketRepository.java +++ b/adapter/persistence/src/main/java/com/ticketlounge/persistence/ticket/TicketRepository.java @@ -1,4 +1,4 @@ -package com.ticketexchange.ticket.adapter.out.persistence; +package com.ticketlounge.persistence.ticket; import java.time.LocalDate; import java.util.List; @@ -6,6 +6,8 @@ import org.springframework.data.domain.Sort; import org.springframework.data.jpa.repository.JpaRepository; +import com.ticketlounge.persistence.ticket.entity.TicketJpaEntity; + public interface TicketRepository extends JpaRepository { long countByMemberIdAndExpireDateGreaterThanEqual(Long memberId, LocalDate expireDate); diff --git a/src/main/java/com/ticketexchange/ticket/adapter/out/persistence/TicketJpaEntity.java b/adapter/persistence/src/main/java/com/ticketlounge/persistence/ticket/entity/TicketJpaEntity.java similarity index 97% rename from src/main/java/com/ticketexchange/ticket/adapter/out/persistence/TicketJpaEntity.java rename to adapter/persistence/src/main/java/com/ticketlounge/persistence/ticket/entity/TicketJpaEntity.java index 9b93d4e..894c589 100644 --- a/src/main/java/com/ticketexchange/ticket/adapter/out/persistence/TicketJpaEntity.java +++ b/adapter/persistence/src/main/java/com/ticketlounge/persistence/ticket/entity/TicketJpaEntity.java @@ -1,4 +1,4 @@ -package com.ticketexchange.ticket.adapter.out.persistence; +package com.ticketlounge.persistence.ticket.entity; import java.time.LocalDate;