Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: repository 인터페이스를 domain 패키지로 이동 #73

Merged
merged 2 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package es.princip.getp.domain.auth.application;

import es.princip.getp.domain.auth.domain.TokenVerification;
import es.princip.getp.domain.auth.domain.TokenVerificationRepository;
import es.princip.getp.domain.auth.dto.request.LoginRequest;
import es.princip.getp.domain.auth.dto.response.Token;
import es.princip.getp.domain.auth.exception.LoginErrorCode;
import es.princip.getp.domain.auth.exception.TokenErrorCode;
import es.princip.getp.domain.auth.repository.TokenVerificationRepository;
import es.princip.getp.domain.member.application.MemberService;
import es.princip.getp.infra.exception.BusinessLogicException;
import es.princip.getp.infra.security.details.PrincipalDetails;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package es.princip.getp.domain.auth.application;

import es.princip.getp.domain.auth.domain.EmailVerification;
import es.princip.getp.domain.auth.domain.EmailVerificationRepository;
import es.princip.getp.domain.auth.exception.EmailVerificationErrorCode;
import es.princip.getp.domain.auth.repository.EmailVerificationRepository;
import es.princip.getp.infra.exception.BusinessLogicException;
import es.princip.getp.infra.util.RandomUtil;
import org.springframework.beans.factory.annotation.Value;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package es.princip.getp.domain.auth.repository;
package es.princip.getp.domain.auth.domain;

import es.princip.getp.domain.auth.domain.EmailVerification;
import org.springframework.data.keyvalue.repository.KeyValueRepository;

public interface EmailVerificationRepository extends KeyValueRepository<EmailVerification, String> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package es.princip.getp.domain.auth.repository;
package es.princip.getp.domain.auth.domain;

import es.princip.getp.domain.auth.domain.TokenVerification;
import org.springframework.data.keyvalue.repository.KeyValueRepository;

public interface TokenVerificationRepository extends KeyValueRepository<TokenVerification, Long> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package es.princip.getp.domain.client.application;

import es.princip.getp.domain.client.domain.Client;
import es.princip.getp.domain.client.domain.ClientRepository;
import es.princip.getp.domain.client.dto.request.CreateClientRequest;
import es.princip.getp.domain.client.dto.request.UpdateClientRequest;
import es.princip.getp.domain.client.exception.ClientErrorCode;
import es.princip.getp.domain.client.repository.ClientRepository;
import es.princip.getp.domain.member.application.MemberService;
import es.princip.getp.domain.member.dto.request.UpdateMemberRequest;
import es.princip.getp.infra.exception.BusinessLogicException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package es.princip.getp.domain.client.repository;
package es.princip.getp.domain.client.domain;

import es.princip.getp.domain.client.domain.Client;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import es.princip.getp.domain.auth.exception.SignUpErrorCode;
import es.princip.getp.domain.member.domain.Member;
import es.princip.getp.domain.member.domain.MemberRepository;
import es.princip.getp.domain.member.dto.request.CreateMemberRequest;
import es.princip.getp.domain.member.dto.request.UpdateMemberRequest;
import es.princip.getp.domain.member.exception.MemberErrorCode;
import es.princip.getp.domain.member.repository.MemberRepository;
import es.princip.getp.domain.serviceTerm.application.ServiceTermService;
import es.princip.getp.domain.serviceTerm.domain.ServiceTerm;
import es.princip.getp.domain.serviceTerm.domain.ServiceTermAgreement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package es.princip.getp.domain.member.repository;
package es.princip.getp.domain.member.domain;

import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;
import es.princip.getp.domain.member.domain.Member;

import java.util.Optional;

public interface MemberRepository extends JpaRepository<Member, Long> {
boolean existsByEmail(String email);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import es.princip.getp.domain.client.domain.Client;
import es.princip.getp.domain.people.domain.People;
import es.princip.getp.domain.people.domain.PeopleLike;
import es.princip.getp.domain.people.domain.PeopleLikeRepository;
import es.princip.getp.domain.people.exception.PeopleLikeErrorCode;
import es.princip.getp.domain.people.repository.PeopleLikeRepository;
import es.princip.getp.infra.exception.BusinessLogicException;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import es.princip.getp.domain.people.domain.People;
import es.princip.getp.domain.people.domain.PeopleProfile;
import es.princip.getp.domain.people.domain.PeopleProfileRepository;
import es.princip.getp.domain.people.dto.request.CreatePeopleProfileRequest;
import es.princip.getp.domain.people.dto.request.UpdatePeopleProfileRequest;
import es.princip.getp.domain.people.exception.PeopleProfileErrorCode;
import es.princip.getp.domain.people.repository.PeopleProfileRepository;
import es.princip.getp.infra.exception.BusinessLogicException;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import es.princip.getp.domain.member.application.MemberService;
import es.princip.getp.domain.member.dto.request.UpdateMemberRequest;
import es.princip.getp.domain.people.domain.People;
import es.princip.getp.domain.people.domain.PeopleRepository;
import es.princip.getp.domain.people.dto.request.CreatePeopleRequest;
import es.princip.getp.domain.people.dto.request.UpdatePeopleRequest;
import es.princip.getp.domain.people.dto.response.people.CardPeopleResponse;
import es.princip.getp.domain.people.exception.PeopleErrorCode;
import es.princip.getp.domain.people.repository.PeopleRepository;
import es.princip.getp.infra.exception.BusinessLogicException;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package es.princip.getp.domain.people.repository;
package es.princip.getp.domain.people.domain;

import es.princip.getp.domain.people.domain.PeopleLike;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package es.princip.getp.domain.people.repository;
package es.princip.getp.domain.people.domain;

import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import es.princip.getp.domain.people.domain.PeopleProfile;
import java.util.Optional;

public interface PeopleProfileRepository extends JpaRepository<PeopleProfile, Long> {
Optional<PeopleProfile> findByPeople_PeopleId(Long peopleId);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package es.princip.getp.domain.people.repository;
package es.princip.getp.domain.people.domain;

import es.princip.getp.domain.people.domain.People;
import java.util.Optional;
import es.princip.getp.domain.people.infra.PeopleQueryDslRepository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface PeopleRepository extends JpaRepository<People, Long>, PeopleQueryDslRepository {
Optional<People> findByMember_MemberId(Long memberId);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package es.princip.getp.domain.people.repository;
package es.princip.getp.domain.people.infra;

import es.princip.getp.domain.people.dto.response.people.CardPeopleResponse;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import es.princip.getp.domain.people.dto.response.people.CardPeopleResponse;

public interface PeopleQueryDslRepository {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package es.princip.getp.domain.people.repository;
package es.princip.getp.domain.people.infra;

import com.querydsl.core.Tuple;
import com.querydsl.core.types.OrderSpecifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import es.princip.getp.domain.people.domain.People;
import es.princip.getp.domain.project.domain.Project;
import es.princip.getp.domain.project.domain.ProjectApplication;
import es.princip.getp.domain.project.domain.ProjectApplicationRepository;
import es.princip.getp.domain.project.dto.request.ApplicateProjectRequest;
import es.princip.getp.domain.project.repository.ProjectApplicationRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import es.princip.getp.domain.people.domain.People;
import es.princip.getp.domain.project.domain.Project;
import es.princip.getp.domain.project.domain.ProjectLike;
import es.princip.getp.domain.project.domain.ProjectLikeRepository;
import es.princip.getp.domain.project.exception.ProjectLikeErrorCode;
import es.princip.getp.domain.project.repository.ProjectLikeRepository;
import es.princip.getp.infra.exception.BusinessLogicException;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import es.princip.getp.domain.client.application.ClientService;
import es.princip.getp.domain.client.domain.Client;
import es.princip.getp.domain.project.domain.Project;
import es.princip.getp.domain.project.domain.ProjectRepository;
import es.princip.getp.domain.project.dto.request.CreateProjectRequest;
import es.princip.getp.domain.project.exception.ProjectErrorCode;
import es.princip.getp.domain.project.repository.ProjectRepository;
import es.princip.getp.infra.exception.BusinessLogicException;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package es.princip.getp.domain.project.repository;
package es.princip.getp.domain.project.domain;

import es.princip.getp.domain.project.domain.ProjectApplication;
import org.springframework.data.jpa.repository.JpaRepository;

public interface ProjectApplicationRepository extends JpaRepository<ProjectApplication, Long> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package es.princip.getp.domain.project.repository;
package es.princip.getp.domain.project.domain;

import es.princip.getp.domain.project.domain.ProjectLike;
import org.springframework.data.jpa.repository.JpaRepository;

public interface ProjectLikeRepository extends JpaRepository<ProjectLike, Long> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package es.princip.getp.domain.project.repository;
package es.princip.getp.domain.project.domain;

import es.princip.getp.domain.project.domain.Project;
import es.princip.getp.domain.project.infra.ProjectQueryDslRepository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package es.princip.getp.domain.project.repository;
package es.princip.getp.domain.project.infra;

import es.princip.getp.domain.project.domain.Project;
import org.springframework.data.domain.Page;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package es.princip.getp.domain.project.repository;
package es.princip.getp.domain.project.infra;

import com.querydsl.jpa.impl.JPAQuery;
import com.querydsl.jpa.impl.JPAQueryFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package es.princip.getp.domain.auth.application;

import es.princip.getp.domain.auth.domain.EmailVerification;
import es.princip.getp.domain.auth.domain.EmailVerificationRepository;
import es.princip.getp.domain.auth.exception.EmailVerificationErrorCode;
import es.princip.getp.domain.auth.repository.EmailVerificationRepository;
import es.princip.getp.infra.exception.BusinessLogicException;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package es.princip.getp.domain.client.application;

import es.princip.getp.domain.client.domain.Client;
import es.princip.getp.domain.client.domain.ClientRepository;
import es.princip.getp.domain.client.dto.request.CreateClientRequest;
import es.princip.getp.domain.client.dto.request.UpdateClientRequest;
import es.princip.getp.domain.client.fixture.ClientFixture;
import es.princip.getp.domain.client.repository.ClientRepository;
import es.princip.getp.domain.member.application.MemberService;
import es.princip.getp.domain.member.domain.Member;
import es.princip.getp.domain.member.dto.request.UpdateMemberRequest;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package es.princip.getp.domain.member.application;

import es.princip.getp.domain.member.domain.Member;
import es.princip.getp.domain.member.domain.MemberRepository;
import es.princip.getp.domain.member.domain.MemberType;
import es.princip.getp.domain.member.dto.request.CreateMemberRequest;
import es.princip.getp.domain.member.dto.request.UpdateMemberRequest;
import es.princip.getp.domain.member.exception.MemberErrorCode;
import es.princip.getp.domain.member.repository.MemberRepository;
import es.princip.getp.domain.serviceTerm.application.ServiceTermService;
import es.princip.getp.domain.serviceTerm.fixture.ServiceTermFixture;
import es.princip.getp.domain.storage.application.ImageStorageService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import es.princip.getp.domain.member.domain.Member;
import es.princip.getp.domain.people.domain.People;
import es.princip.getp.domain.people.domain.PeopleLike;
import es.princip.getp.domain.people.domain.PeopleLikeRepository;
import es.princip.getp.domain.people.exception.PeopleErrorCode;
import es.princip.getp.domain.people.exception.PeopleLikeErrorCode;
import es.princip.getp.domain.people.repository.PeopleLikeRepository;
import es.princip.getp.infra.exception.BusinessLogicException;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import es.princip.getp.domain.member.domain.Member;
import es.princip.getp.domain.people.domain.People;
import es.princip.getp.domain.people.domain.PeopleProfile;
import es.princip.getp.domain.people.domain.PeopleProfileRepository;
import es.princip.getp.domain.people.domain.PeopleRepository;
import es.princip.getp.domain.people.dto.request.CreatePeopleProfileRequest;
import es.princip.getp.domain.people.dto.request.UpdatePeopleProfileRequest;
import es.princip.getp.domain.people.fixture.PeopleProfileFixture;
import es.princip.getp.domain.people.repository.PeopleProfileRepository;
import es.princip.getp.domain.people.repository.PeopleRepository;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import es.princip.getp.domain.member.domain.Member;
import es.princip.getp.domain.member.dto.request.UpdateMemberRequest;
import es.princip.getp.domain.people.domain.People;
import es.princip.getp.domain.people.domain.PeopleRepository;
import es.princip.getp.domain.people.dto.request.CreatePeopleRequest;
import es.princip.getp.domain.people.dto.request.UpdatePeopleRequest;
import es.princip.getp.domain.people.dto.response.people.CardPeopleResponse;
import es.princip.getp.domain.people.repository.PeopleRepository;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
package es.princip.getp.domain.people.repository;
package es.princip.getp.domain.people.infra;

import es.princip.getp.domain.client.domain.Client;
import es.princip.getp.domain.client.repository.ClientRepository;
import es.princip.getp.domain.client.domain.ClientRepository;
import es.princip.getp.domain.member.domain.Member;
import es.princip.getp.domain.member.repository.MemberRepository;
import es.princip.getp.domain.member.domain.MemberRepository;
import es.princip.getp.domain.people.domain.People;
import es.princip.getp.domain.people.domain.PeopleLike;
import es.princip.getp.infra.config.QueryDslTestConfig;
import es.princip.getp.domain.people.domain.PeopleLikeRepository;
import es.princip.getp.domain.people.domain.PeopleRepository;
import es.princip.getp.infra.annotation.RepositoryTest;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.ActiveProfiles;

import static es.princip.getp.domain.client.fixture.ClientFixture.createClient;
import static es.princip.getp.domain.member.domain.MemberType.ROLE_CLIENT;
Expand All @@ -24,10 +22,8 @@
import static es.princip.getp.domain.people.fixture.PeopleFixture.createPeople;
import static org.assertj.core.api.Assertions.assertThat;

@DataJpaTest
@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
@ActiveProfiles("test")
@Import(QueryDslTestConfig.class)

@RepositoryTest
class PeopleLikeRepositoryTest {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
package es.princip.getp.domain.people.repository;
package es.princip.getp.domain.people.infra;

import es.princip.getp.domain.member.repository.MemberRepository;
import es.princip.getp.infra.config.QueryDslTestConfig;
import es.princip.getp.domain.member.domain.MemberRepository;
import es.princip.getp.domain.people.domain.PeopleRepository;
import es.princip.getp.infra.annotation.RepositoryTest;
import org.junit.jupiter.api.BeforeEach;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.ActiveProfiles;

@DataJpaTest
@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
@ActiveProfiles("test")
@Import(QueryDslTestConfig.class)

@RepositoryTest
public class PeopleRepositoryTest {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import es.princip.getp.domain.people.domain.People;
import es.princip.getp.domain.project.domain.Project;
import es.princip.getp.domain.project.domain.ProjectApplication;
import es.princip.getp.domain.project.domain.ProjectApplicationRepository;
import es.princip.getp.domain.project.dto.request.ApplicateProjectRequest;
import es.princip.getp.domain.project.repository.ProjectApplicationRepository;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import es.princip.getp.domain.people.application.PeopleService;
import es.princip.getp.domain.people.domain.People;
import es.princip.getp.domain.project.domain.Project;
import es.princip.getp.domain.project.domain.ProjectLikeRepository;
import es.princip.getp.domain.project.exception.ProjectErrorCode;
import es.princip.getp.domain.project.exception.ProjectLikeErrorCode;
import es.princip.getp.domain.project.repository.ProjectLikeRepository;
import es.princip.getp.infra.exception.BusinessLogicException;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;
Expand Down
Loading