Skip to content

Commit

Permalink
refactor: 영속성 어댑터 모듈 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
ProtoSeo committed Feb 10, 2024
1 parent 9fe0213 commit a137a11
Show file tree
Hide file tree
Showing 17 changed files with 48 additions and 39 deletions.
6 changes: 6 additions & 0 deletions adapter/persistence/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies {
implementation(project(":domain"))
implementation(project(":application"))

implementation("org.springframework.boot:spring-boot-starter-data-jpa")
}
Original file line number Diff line number Diff line change
@@ -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 {

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

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

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

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

Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ticketexchange.product.adapter.out.persistence;
package com.ticketlounge.persistence.product;

import java.time.LocalDate;
import java.util.List;
Expand All @@ -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<ProductJpaEntity, Long> {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ticketexchange.product.adapter.out.persistence.entity;
package com.ticketlounge.persistence.product.entity;

import java.time.LocalDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ticketexchange.product.adapter.out.persistence.entity;
package com.ticketlounge.persistence.product.entity;

import java.time.LocalDate;

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

Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +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.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;

import com.ticketlounge.persistence.ticket.entity.TicketJpaEntity;

public interface TicketRepository extends JpaRepository<TicketJpaEntity, Long> {

long countByMemberIdAndExpireDateGreaterThanEqual(Long memberId, LocalDate expireDate);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ticketexchange.ticket.adapter.out.persistence;
package com.ticketlounge.persistence.ticket.entity;

import java.time.LocalDate;

Expand Down

0 comments on commit a137a11

Please sign in to comment.