diff --git a/application/build.gradle.kts b/application/build.gradle.kts index f2c0f0fc..606a55b3 100644 --- a/application/build.gradle.kts +++ b/application/build.gradle.kts @@ -1,6 +1,6 @@ dependencies { implementation(project(":domain")) - implementation(project(":infrastructure:jpa")) + implementation(project(":usecase")) // spring implementation("org.springframework.boot:spring-boot-starter") diff --git a/application/src/main/java/org/depromeet/spot/application/config/SpotApplicationConfig.java b/application/src/main/java/org/depromeet/spot/application/config/SpotApplicationConfig.java index 7af3d8c5..bb176462 100644 --- a/application/src/main/java/org/depromeet/spot/application/config/SpotApplicationConfig.java +++ b/application/src/main/java/org/depromeet/spot/application/config/SpotApplicationConfig.java @@ -1,11 +1,11 @@ package org.depromeet.spot.application.config; -import org.depromeet.spot.jpa.config.JpaConfig; +import org.depromeet.spot.usecase.config.UsecaseConfig; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @ComponentScan(basePackages = {"org.depromeet.spot.application"}) @Configuration -@Import({JpaConfig.class}) +@Import({UsecaseConfig.class}) public class SpotApplicationConfig {} diff --git a/application/src/main/java/org/depromeet/spot/application/member/controller/MemberController.java b/application/src/main/java/org/depromeet/spot/application/member/controller/MemberController.java index 3fc0be15..a86d6438 100644 --- a/application/src/main/java/org/depromeet/spot/application/member/controller/MemberController.java +++ b/application/src/main/java/org/depromeet/spot/application/member/controller/MemberController.java @@ -1,8 +1,8 @@ package org.depromeet.spot.application.member.controller; -import org.depromeet.spot.application.member.controller.request.MemberRequest; -import org.depromeet.spot.application.member.controller.response.MemberResponse; -import org.depromeet.spot.application.member.service.port.MemberService; +import org.depromeet.spot.application.member.dto.request.MemberRequest; +import org.depromeet.spot.application.member.dto.response.MemberResponse; +import org.depromeet.spot.usecase.port.in.MemberService; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; diff --git a/application/src/main/java/org/depromeet/spot/application/member/controller/request/MemberRequest.java b/application/src/main/java/org/depromeet/spot/application/member/controller/request/MemberRequest.java deleted file mode 100644 index aca9a596..00000000 --- a/application/src/main/java/org/depromeet/spot/application/member/controller/request/MemberRequest.java +++ /dev/null @@ -1,3 +0,0 @@ -package org.depromeet.spot.application.member.controller.request; - -public record MemberRequest(String name) {} diff --git a/application/src/main/java/org/depromeet/spot/application/member/dto/request/MemberRequest.java b/application/src/main/java/org/depromeet/spot/application/member/dto/request/MemberRequest.java new file mode 100644 index 00000000..59ef51cd --- /dev/null +++ b/application/src/main/java/org/depromeet/spot/application/member/dto/request/MemberRequest.java @@ -0,0 +1,3 @@ +package org.depromeet.spot.application.member.dto.request; + +public record MemberRequest(String name) {} diff --git a/application/src/main/java/org/depromeet/spot/application/member/controller/response/MemberResponse.java b/application/src/main/java/org/depromeet/spot/application/member/dto/response/MemberResponse.java similarity index 77% rename from application/src/main/java/org/depromeet/spot/application/member/controller/response/MemberResponse.java rename to application/src/main/java/org/depromeet/spot/application/member/dto/response/MemberResponse.java index a319f380..06ab8203 100644 --- a/application/src/main/java/org/depromeet/spot/application/member/controller/response/MemberResponse.java +++ b/application/src/main/java/org/depromeet/spot/application/member/dto/response/MemberResponse.java @@ -1,4 +1,4 @@ -package org.depromeet.spot.application.member.controller.response; +package org.depromeet.spot.application.member.dto.response; import org.depromeet.spot.domain.member.Member; diff --git a/infrastructure/jpa/build.gradle.kts b/infrastructure/jpa/build.gradle.kts index f45141b9..06299a39 100644 --- a/infrastructure/jpa/build.gradle.kts +++ b/infrastructure/jpa/build.gradle.kts @@ -1,5 +1,6 @@ dependencies { implementation(project(":domain")) + implementation(project(":usecase")) // spring implementation("org.springframework.boot:spring-boot-starter-data-jpa:_") diff --git a/infrastructure/jpa/src/main/java/org/depromeet/spot/jpa/member/repository/MemberRepositoryImpl.java b/infrastructure/jpa/src/main/java/org/depromeet/spot/jpa/member/repository/MemberRepositoryImpl.java index 7f165f1c..42507851 100644 --- a/infrastructure/jpa/src/main/java/org/depromeet/spot/jpa/member/repository/MemberRepositoryImpl.java +++ b/infrastructure/jpa/src/main/java/org/depromeet/spot/jpa/member/repository/MemberRepositoryImpl.java @@ -2,7 +2,7 @@ import org.depromeet.spot.domain.member.Member; import org.depromeet.spot.jpa.member.entity.MemberEntity; -import org.depromeet.spot.jpa.member.repository.port.MemberRepository; +import org.depromeet.spot.usecase.port.out.MemberRepository; import org.springframework.stereotype.Repository; import lombok.RequiredArgsConstructor; diff --git a/usecase/src/main/java/org/depromeet/spot/usecase/config/UsecaseConfig.java b/usecase/src/main/java/org/depromeet/spot/usecase/config/UsecaseConfig.java new file mode 100644 index 00000000..55a776cc --- /dev/null +++ b/usecase/src/main/java/org/depromeet/spot/usecase/config/UsecaseConfig.java @@ -0,0 +1,8 @@ +package org.depromeet.spot.usecase.config; + +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; + +@Configuration +@ComponentScan(basePackages = {"org.depromeet.spot.usecase"}) +public class UsecaseConfig {} diff --git a/application/src/main/java/org/depromeet/spot/application/member/service/port/MemberService.java b/usecase/src/main/java/org/depromeet/spot/usecase/port/in/MemberService.java similarity index 66% rename from application/src/main/java/org/depromeet/spot/application/member/service/port/MemberService.java rename to usecase/src/main/java/org/depromeet/spot/usecase/port/in/MemberService.java index b39bb703..3f367adf 100644 --- a/application/src/main/java/org/depromeet/spot/application/member/service/port/MemberService.java +++ b/usecase/src/main/java/org/depromeet/spot/usecase/port/in/MemberService.java @@ -1,4 +1,4 @@ -package org.depromeet.spot.application.member.service.port; +package org.depromeet.spot.usecase.port.in; import org.depromeet.spot.domain.member.Member; diff --git a/infrastructure/jpa/src/main/java/org/depromeet/spot/jpa/member/repository/port/MemberRepository.java b/usecase/src/main/java/org/depromeet/spot/usecase/port/out/MemberRepository.java similarity index 68% rename from infrastructure/jpa/src/main/java/org/depromeet/spot/jpa/member/repository/port/MemberRepository.java rename to usecase/src/main/java/org/depromeet/spot/usecase/port/out/MemberRepository.java index fe754447..b7b5fe40 100644 --- a/infrastructure/jpa/src/main/java/org/depromeet/spot/jpa/member/repository/port/MemberRepository.java +++ b/usecase/src/main/java/org/depromeet/spot/usecase/port/out/MemberRepository.java @@ -1,4 +1,4 @@ -package org.depromeet.spot.jpa.member.repository.port; +package org.depromeet.spot.usecase.port.out; import org.depromeet.spot.domain.member.Member; diff --git a/application/src/main/java/org/depromeet/spot/application/member/service/MemberServiceImpl.java b/usecase/src/main/java/org/depromeet/spot/usecase/usecase/MemberServiceImpl.java similarity index 69% rename from application/src/main/java/org/depromeet/spot/application/member/service/MemberServiceImpl.java rename to usecase/src/main/java/org/depromeet/spot/usecase/usecase/MemberServiceImpl.java index 50ac7d27..b0c61339 100644 --- a/application/src/main/java/org/depromeet/spot/application/member/service/MemberServiceImpl.java +++ b/usecase/src/main/java/org/depromeet/spot/usecase/usecase/MemberServiceImpl.java @@ -1,8 +1,8 @@ -package org.depromeet.spot.application.member.service; +package org.depromeet.spot.usecase.usecase; -import org.depromeet.spot.application.member.service.port.MemberService; import org.depromeet.spot.domain.member.Member; -import org.depromeet.spot.jpa.member.repository.port.MemberRepository; +import org.depromeet.spot.usecase.port.in.MemberService; +import org.depromeet.spot.usecase.port.out.MemberRepository; import org.springframework.stereotype.Service; import lombok.RequiredArgsConstructor;