Skip to content

Commit

Permalink
refact: move Gateway to appropriate package for better module organiz…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
Ji-soo708 committed Jan 13, 2025
1 parent dc318ff commit c2be193
Show file tree
Hide file tree
Showing 46 changed files with 73 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.dobby.backend.application.usecase.member.CreateParticipantUseCase
import com.dobby.backend.application.usecase.member.CreateResearcherUseCase
import com.dobby.backend.application.usecase.member.VerifyResearcherEmailUseCase
import com.dobby.backend.domain.exception.SignupOauthEmailDuplicateException
import com.dobby.backend.domain.gateway.MemberGateway
import com.dobby.backend.domain.gateway.member.MemberGateway
import com.dobby.backend.infrastructure.database.entity.enum.MemberStatus
import jakarta.transaction.Transactional
import org.springframework.stereotype.Service
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.dobby.backend.application.usecase

import com.dobby.backend.domain.gateway.MemberGateway
import com.dobby.backend.domain.gateway.member.MemberGateway
import com.dobby.backend.domain.model.member.Member

class GetMemberByIdUseCase(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.dobby.backend.application.usecase.auth

import com.dobby.backend.application.usecase.UseCase
import com.dobby.backend.domain.gateway.MemberGateway
import com.dobby.backend.domain.gateway.TokenGateway
import com.dobby.backend.domain.gateway.feign.GoogleAuthGateway
import com.dobby.backend.domain.gateway.member.MemberGateway
import com.dobby.backend.domain.gateway.auth.TokenGateway
import com.dobby.backend.domain.gateway.auth.GoogleAuthGateway
import com.dobby.backend.infrastructure.database.entity.enum.MemberStatus
import com.dobby.backend.infrastructure.database.entity.enum.ProviderType
import com.dobby.backend.infrastructure.database.entity.enum.RoleType
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.dobby.backend.application.usecase.auth

import com.dobby.backend.application.usecase.UseCase
import com.dobby.backend.domain.gateway.MemberGateway
import com.dobby.backend.domain.gateway.feign.NaverAuthGateway
import com.dobby.backend.domain.gateway.TokenGateway
import com.dobby.backend.domain.gateway.member.MemberGateway
import com.dobby.backend.domain.gateway.auth.NaverAuthGateway
import com.dobby.backend.domain.gateway.auth.TokenGateway
import com.dobby.backend.infrastructure.database.entity.enum.MemberStatus
import com.dobby.backend.infrastructure.database.entity.enum.ProviderType
import com.dobby.backend.infrastructure.database.entity.enum.RoleType
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.dobby.backend.application.usecase.auth

import com.dobby.backend.application.usecase.UseCase
import com.dobby.backend.domain.gateway.MemberGateway
import com.dobby.backend.domain.gateway.TokenGateway
import com.dobby.backend.domain.gateway.member.MemberGateway
import com.dobby.backend.domain.gateway.auth.TokenGateway
import com.dobby.backend.domain.model.member.Member

class GenerateTestTokenUseCase(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.dobby.backend.application.usecase.auth

import com.dobby.backend.application.usecase.UseCase
import com.dobby.backend.domain.gateway.MemberGateway
import com.dobby.backend.domain.gateway.TokenGateway
import com.dobby.backend.domain.gateway.member.MemberGateway
import com.dobby.backend.domain.gateway.auth.TokenGateway
import com.dobby.backend.domain.model.member.Member

class GenerateTokenWithRefreshTokenUseCase(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.dobby.backend.application.usecase.experiment

import com.dobby.backend.application.usecase.UseCase
import com.dobby.backend.domain.exception.PermissionDeniedException
import com.dobby.backend.domain.gateway.*
import com.dobby.backend.domain.gateway.experiment.ExperimentPostGateway
import com.dobby.backend.domain.gateway.member.MemberGateway
import com.dobby.backend.domain.model.experiment.ApplyMethod
import com.dobby.backend.domain.model.experiment.ExperimentPost
import com.dobby.backend.domain.model.experiment.TargetGroup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.dobby.backend.application.usecase.experiment

import com.dobby.backend.application.usecase.UseCase
import com.dobby.backend.domain.exception.ExperimentPostNotFoundException
import com.dobby.backend.domain.gateway.ExperimentPostGateway
import com.dobby.backend.domain.gateway.experiment.ExperimentPostGateway

class GetExperimentPostApplyMethodUseCase(
private val experimentPostGateway: ExperimentPostGateway,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.dobby.backend.application.usecase.experiment

import com.dobby.backend.application.usecase.UseCase
import com.dobby.backend.domain.gateway.ExperimentPostGateway
import com.dobby.backend.domain.gateway.experiment.ExperimentPostGateway
import com.dobby.backend.infrastructure.database.entity.enum.areaInfo.Area
import com.dobby.backend.infrastructure.database.entity.enum.areaInfo.Region
import jakarta.persistence.Tuple
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.dobby.backend.application.usecase.experiment

import com.dobby.backend.application.usecase.UseCase
import com.dobby.backend.domain.gateway.ExperimentPostGateway
import com.dobby.backend.domain.gateway.experiment.ExperimentPostGateway
import com.dobby.backend.infrastructure.database.entity.enum.areaInfo.Region

class GetExperimentPostCountsByRegionUseCase(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.dobby.backend.application.usecase.experiment

import com.dobby.backend.application.usecase.UseCase
import com.dobby.backend.domain.exception.ExperimentPostNotFoundException
import com.dobby.backend.domain.gateway.ExperimentPostGateway
import com.dobby.backend.domain.gateway.experiment.ExperimentPostGateway
import com.dobby.backend.domain.model.experiment.ExperimentPost
import com.dobby.backend.domain.model.experiment.TargetGroup
import com.dobby.backend.presentation.api.dto.response.expirement.ExperimentPostDetailResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.dobby.backend.application.usecase.experiment

import com.dobby.backend.application.usecase.UseCase
import com.dobby.backend.domain.exception.ResearcherNotFoundException
import com.dobby.backend.domain.gateway.ResearcherGateway
import com.dobby.backend.domain.gateway.member.ResearcherGateway

class GetResearcherInfoUseCase(
private val researcherGateway: ResearcherGateway
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package com.dobby.backend.application.usecase.member

import com.dobby.backend.application.mapper.SignupMapper
import com.dobby.backend.application.usecase.UseCase
import com.dobby.backend.domain.gateway.ParticipantGateway
import com.dobby.backend.domain.gateway.TokenGateway
import com.dobby.backend.domain.gateway.member.ParticipantGateway
import com.dobby.backend.domain.gateway.auth.TokenGateway
import com.dobby.backend.domain.model.member.Member
import com.dobby.backend.domain.model.member.Participant
import com.dobby.backend.infrastructure.database.entity.enum.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package com.dobby.backend.application.usecase.member

import com.dobby.backend.application.mapper.SignupMapper
import com.dobby.backend.application.usecase.UseCase
import com.dobby.backend.domain.gateway.MemberGateway
import com.dobby.backend.domain.gateway.ResearcherGateway
import com.dobby.backend.domain.gateway.TokenGateway
import com.dobby.backend.domain.gateway.member.MemberGateway
import com.dobby.backend.domain.gateway.member.ResearcherGateway
import com.dobby.backend.domain.gateway.auth.TokenGateway
import com.dobby.backend.domain.model.member.Member
import com.dobby.backend.domain.model.member.Researcher
import com.dobby.backend.infrastructure.database.entity.enum.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ package com.dobby.backend.application.usecase.member
import com.dobby.backend.application.usecase.UseCase
import com.dobby.backend.domain.exception.EmailNotValidateException
import com.dobby.backend.domain.exception.VerifyInfoNotFoundException
import com.dobby.backend.domain.gateway.VerificationGateway
import com.dobby.backend.domain.model.Verification
import com.dobby.backend.domain.gateway.email.VerificationGateway
import com.dobby.backend.infrastructure.database.entity.enum.VerificationStatus

class VerifyResearcherEmailUseCase(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package com.dobby.backend.application.usecase.member.email
import com.dobby.backend.application.mapper.VerificationMapper
import com.dobby.backend.application.usecase.UseCase
import com.dobby.backend.domain.exception.*
import com.dobby.backend.domain.gateway.EmailGateway
import com.dobby.backend.domain.gateway.VerificationGateway
import com.dobby.backend.domain.gateway.email.EmailGateway
import com.dobby.backend.domain.gateway.email.VerificationGateway
import com.dobby.backend.domain.model.Verification
import com.dobby.backend.infrastructure.database.entity.enum.VerificationStatus
import com.dobby.backend.util.EmailUtils
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.dobby.backend.application.usecase.UseCase
import com.dobby.backend.domain.exception.CodeExpiredException
import com.dobby.backend.domain.exception.CodeNotCorrectException
import com.dobby.backend.domain.exception.VerifyInfoNotFoundException
import com.dobby.backend.domain.gateway.VerificationGateway
import com.dobby.backend.domain.gateway.email.VerificationGateway
import com.dobby.backend.infrastructure.database.entity.enum.VerificationStatus
import java.time.LocalDateTime

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dobby.backend.domain.gateway.feign;
package com.dobby.backend.domain.gateway.auth;

import com.dobby.backend.presentation.api.dto.response.auth.google.GoogleInfoResponse;
import com.dobby.backend.presentation.api.dto.response.auth.google.GoogleTokenResponse
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dobby.backend.domain.gateway.feign
package com.dobby.backend.domain.gateway.auth

import com.dobby.backend.presentation.api.dto.response.auth.naver.NaverInfoResponse
import com.dobby.backend.presentation.api.dto.response.auth.naver.NaverTokenResponse
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dobby.backend.domain.gateway
package com.dobby.backend.domain.gateway.auth

import com.dobby.backend.domain.model.member.Member

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dobby.backend.domain.gateway
package com.dobby.backend.domain.gateway.email

interface EmailGateway {
fun sendEmail(to: String, subject: String, content: String)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dobby.backend.domain.gateway
package com.dobby.backend.domain.gateway.email

import com.dobby.backend.domain.model.Verification
import com.dobby.backend.infrastructure.database.entity.enum.VerificationStatus
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dobby.backend.domain.gateway
package com.dobby.backend.domain.gateway.experiment

import com.dobby.backend.domain.model.experiment.ApplyMethod
import com.dobby.backend.domain.model.experiment.ExperimentPost
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dobby.backend.domain.gateway
package com.dobby.backend.domain.gateway.experiment

import com.dobby.backend.domain.model.experiment.ExperimentPost
import com.dobby.backend.infrastructure.database.entity.enum.areaInfo.Region
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dobby.backend.domain.gateway
package com.dobby.backend.domain.gateway.experiment

import com.amazonaws.services.ec2.model.TargetGroup

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dobby.backend.domain.gateway
package com.dobby.backend.domain.gateway.member

import com.dobby.backend.domain.model.member.Member
import com.dobby.backend.infrastructure.database.entity.enum.MemberStatus
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dobby.backend.domain.gateway
package com.dobby.backend.domain.gateway.member

import com.dobby.backend.domain.model.member.Participant

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dobby.backend.domain.gateway
package com.dobby.backend.domain.gateway.member

import com.dobby.backend.domain.model.member.Member
import com.dobby.backend.domain.model.member.Researcher
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.dobby.backend.infrastructure.gateway
package com.dobby.backend.infrastructure.gateway.auth

import com.dobby.backend.domain.gateway.feign.GoogleAuthGateway
import com.dobby.backend.domain.gateway.auth.GoogleAuthGateway
import com.dobby.backend.infrastructure.config.properties.GoogleAuthProperties
import com.dobby.backend.infrastructure.feign.google.GoogleAuthFeignClient
import com.dobby.backend.infrastructure.feign.google.GoogleUserInfoFeginClient
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.dobby.backend.infrastructure.gateway
package com.dobby.backend.infrastructure.gateway.auth

import com.dobby.backend.domain.gateway.feign.NaverAuthGateway
import com.dobby.backend.domain.gateway.auth.NaverAuthGateway
import com.dobby.backend.infrastructure.config.properties.NaverAuthProperties
import com.dobby.backend.infrastructure.feign.naver.NaverAuthFeignClient
import com.dobby.backend.infrastructure.feign.naver.NaverUserInfoFeignClient
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.dobby.backend.infrastructure.gateway
package com.dobby.backend.infrastructure.gateway.auth

import com.dobby.backend.domain.gateway.TokenGateway
import com.dobby.backend.domain.gateway.auth.TokenGateway
import com.dobby.backend.domain.model.member.Member
import com.dobby.backend.infrastructure.token.JwtTokenProvider
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.dobby.backend.infrastructure.gateway
package com.dobby.backend.infrastructure.gateway.email

import com.dobby.backend.domain.gateway.EmailGateway
import com.dobby.backend.domain.gateway.email.EmailGateway
import com.dobby.backend.infrastructure.config.properties.EmailProperties
import org.springframework.mail.SimpleMailMessage
import org.springframework.mail.javamail.JavaMailSender
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.dobby.backend.infrastructure.gateway
package com.dobby.backend.infrastructure.gateway.email

import com.dobby.backend.domain.gateway.VerificationGateway
import com.dobby.backend.domain.gateway.email.VerificationGateway
import com.dobby.backend.domain.model.Verification
import com.dobby.backend.infrastructure.database.entity.enum.VerificationStatus
import com.dobby.backend.infrastructure.database.repository.VerificationRepository
Expand All @@ -10,7 +10,7 @@ import org.springframework.stereotype.Component
@Component
class VerificationGatewayImpl(
private val verificationRepository: VerificationRepository
) : VerificationGateway{
) : VerificationGateway {

override fun findByUnivEmailAndStatus(univEmail: String, status: VerificationStatus): Verification? {
return verificationRepository
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.dobby.backend.infrastructure.gateway
package com.dobby.backend.infrastructure.gateway.experiment

import com.dobby.backend.domain.gateway.ExperimentPostGateway
import com.dobby.backend.domain.gateway.experiment.ExperimentPostGateway
import com.dobby.backend.domain.model.experiment.ExperimentPost
import com.dobby.backend.infrastructure.converter.ExperimentPostConverter
import com.dobby.backend.infrastructure.database.entity.enum.areaInfo.Region
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.dobby.backend.infrastructure.gateway
package com.dobby.backend.infrastructure.gateway.member

import com.dobby.backend.domain.gateway.MemberGateway
import com.dobby.backend.domain.gateway.member.MemberGateway
import com.dobby.backend.infrastructure.database.entity.enum.MemberStatus
import com.dobby.backend.domain.model.member.Member
import com.dobby.backend.infrastructure.converter.MemberConverter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.dobby.backend.infrastructure.gateway
package com.dobby.backend.infrastructure.gateway.member

import com.dobby.backend.domain.gateway.ParticipantGateway
import com.dobby.backend.domain.gateway.member.ParticipantGateway
import com.dobby.backend.domain.model.member.Participant
import com.dobby.backend.infrastructure.converter.ParticipantConverter
import com.dobby.backend.infrastructure.database.repository.ParticipantRepository
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
package com.dobby.backend.infrastructure.gateway
package com.dobby.backend.infrastructure.gateway.member

import com.dobby.backend.domain.gateway.ResearcherGateway
import com.dobby.backend.domain.model.member.Member
import com.dobby.backend.domain.gateway.member.ResearcherGateway
import com.dobby.backend.domain.model.member.Researcher
import com.dobby.backend.infrastructure.converter.MemberConverter
import com.dobby.backend.infrastructure.converter.ResearcherConverter
import com.dobby.backend.infrastructure.database.repository.ResearcherRepository
import org.springframework.stereotype.Component

@Component
class ResearcherGatewayImpl(
private val researcherRepository: ResearcherRepository
) : ResearcherGateway{
) : ResearcherGateway {

override fun findByMemberId(memberId: Long) : Researcher? {
val researcherEntity = researcherRepository
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.dobby.backend.application.usecase.auth

import com.dobby.backend.application.usecase.auth.FetchGoogleUserInfoUseCase
import com.dobby.backend.domain.gateway.MemberGateway
import com.dobby.backend.domain.gateway.TokenGateway
import com.dobby.backend.domain.gateway.feign.GoogleAuthGateway
import com.dobby.backend.domain.gateway.member.MemberGateway
import com.dobby.backend.domain.gateway.auth.TokenGateway
import com.dobby.backend.domain.gateway.auth.GoogleAuthGateway
import com.dobby.backend.domain.model.member.Member
import com.dobby.backend.infrastructure.database.entity.enum.MemberStatus
import com.dobby.backend.infrastructure.database.entity.enum.ProviderType
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.dobby.backend.application.usecase.auth

import com.dobby.backend.application.usecase.auth.FetchNaverUserInfoUseCase
import com.dobby.backend.domain.gateway.MemberGateway
import com.dobby.backend.domain.gateway.feign.NaverAuthGateway
import com.dobby.backend.domain.gateway.TokenGateway
import com.dobby.backend.domain.gateway.member.MemberGateway
import com.dobby.backend.domain.gateway.auth.NaverAuthGateway
import com.dobby.backend.domain.gateway.auth.TokenGateway
import com.dobby.backend.domain.model.member.Member
import com.dobby.backend.infrastructure.database.entity.enum.MemberStatus
import com.dobby.backend.infrastructure.database.entity.enum.ProviderType
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.dobby.backend.application.usecase.auth

import com.dobby.backend.application.usecase.auth.GenerateTestTokenUseCase
import com.dobby.backend.domain.gateway.MemberGateway
import com.dobby.backend.domain.gateway.member.MemberGateway
import io.kotest.core.spec.style.BehaviorSpec
import com.dobby.backend.domain.gateway.TokenGateway
import com.dobby.backend.domain.gateway.auth.TokenGateway
import com.dobby.backend.domain.model.member.Member
import com.dobby.backend.infrastructure.database.entity.enum.MemberStatus
import com.dobby.backend.infrastructure.database.entity.enum.ProviderType
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.dobby.backend.application.usecase.auth

import com.dobby.backend.domain.gateway.MemberGateway
import com.dobby.backend.domain.gateway.TokenGateway
import com.dobby.backend.domain.gateway.member.MemberGateway
import com.dobby.backend.domain.gateway.auth.TokenGateway
import com.dobby.backend.domain.model.member.Member
import com.dobby.backend.infrastructure.database.entity.enum.MemberStatus
import com.dobby.backend.infrastructure.database.entity.enum.ProviderType
Expand Down
Loading

0 comments on commit c2be193

Please sign in to comment.