-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Spotless 코드 포맷팅 + pre-commit 스크립트 작성 (#4)
* chore : spotless 설정 * chore : spotless 컨벤션 적용 * chore : spotless pre-commit 적용 * chore : spotless 자바 포맷 변경 * chore : 자바 컨벤션 적용
- Loading branch information
Showing
16 changed files
with
99 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
PROJECT_ROOT=$(git rev-parse --show-toplevel) | ||
|
||
stagedFiles=$(git diff --staged --name-only) | ||
|
||
echo "Running spotlessApply. Formatting code..." | ||
cd $PROJECT_ROOT && ./gradlew spotlessApply | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Spotless apply failed!" | ||
exit 1 | ||
fi | ||
|
||
for file in $stagedFiles; do | ||
if test -f "$file"; then | ||
git add $file | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 4 additions & 5 deletions
9
src/main/java/depromeet/onepiece/payment/command/application/PaymentCommandService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
package depromeet.onepiece.payment.command.application; | ||
|
||
/** | ||
* 도메인 주도 개발 아키텍처에서 application 계층은 도메인 규칙에 핵심 로직 수행을 위임해요. | ||
* 도메인 객체를 조합하고, 도메인 객체 간의 흐름을 제어하며, 도메인 객체의 상태를 변경하는 역할을 합니다. | ||
* 꼭 CommandService라고 명명할 필요는 없지만, 명령을 처리하는 역할을 하는 서비스라는 것을 알 수 있도록 이름을 지어주는 것이 좋아요. | ||
* 도메인 주도 개발 아키텍처에서 application 계층은 도메인 규칙에 핵심 로직 수행을 위임해요. 도메인 객체를 조합하고, 도메인 객체 간의 흐름을 제어하며, 도메인 | ||
* 객체의 상태를 변경하는 역할을 합니다. 꼭 CommandService라고 명명할 필요는 없지만, 명령을 처리하는 역할을 하는 서비스라는 것을 알 수 있도록 이름을 지어주는 | ||
* 것이 좋아요. | ||
*/ | ||
public class PaymentCommandService { | ||
} | ||
public class PaymentCommandService {} |
7 changes: 2 additions & 5 deletions
7
...depromeet/onepiece/payment/command/application/exception/PaymentCommandExceptionCode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
package depromeet.onepiece.payment.command.application.exception; | ||
|
||
/** | ||
* CommandExceptionCode는 CommandService에서 발생하는 커스텀 예외 코드를 정의해요. | ||
*/ | ||
public enum PaymentCommandExceptionCode { | ||
} | ||
/** CommandExceptionCode는 CommandService에서 발생하는 커스텀 예외 코드를 정의해요. */ | ||
public enum PaymentCommandExceptionCode {} |
7 changes: 3 additions & 4 deletions
7
src/main/java/depromeet/onepiece/payment/command/domain/PaymentCommandRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
package depromeet.onepiece.payment.command.domain; | ||
|
||
/** | ||
* 도메인 주도 개발 DDD 아키텍처에서는 CommandRepository 별도로 구현하여 CQRS 패턴을 적용합니다. | ||
* Master-Slave 구조에서는 Master DB에 쓰기 작업을 하고, Slave DB에서 읽기 작업을 하기 때문에, CommandRepository를 별도로 구현해요. | ||
* 도메인 주도 개발 DDD 아키텍처에서는 CommandRepository 별도로 구현하여 CQRS 패턴을 적용합니다. Master-Slave 구조에서는 Master DB에 쓰기 | ||
* 작업을 하고, Slave DB에서 읽기 작업을 하기 때문에, CommandRepository를 별도로 구현해요. | ||
*/ | ||
public interface PaymentCommandRepository { | ||
} | ||
public interface PaymentCommandRepository {} |
9 changes: 4 additions & 5 deletions
9
.../java/depromeet/onepiece/payment/command/infrastructure/PaymentCommandRepositoryImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
package depromeet.onepiece.payment.command.infrastructure; | ||
|
||
/** | ||
* RepositoryImpl은 Repository 인터페이스를 구현한 클래스로, 실제로 데이터베이스에 접근하여 데이터를 저장하거나 조회하는 역할을 해요. | ||
* 데이터베이스 접근 기술(JPA DATA, QueryDSL, MyBatis 등)을 사용하여 구현합니다. | ||
* 만약 JPA 및 QueryDSL을 사용한다면, infrastructure 패키지 내에 PaymentCommandJpaRepository, PaymentCommandQueryDslRepository 같이 구현 클래스를 생성할 수 있어요. | ||
* RepositoryImpl은 Repository 인터페이스를 구현한 클래스로, 실제로 데이터베이스에 접근하여 데이터를 저장하거나 조회하는 역할을 해요. 데이터베이스 접근 | ||
* 기술(JPA DATA, QueryDSL, MyBatis 등)을 사용하여 구현합니다. 만약 JPA 및 QueryDSL을 사용한다면, infrastructure 패키지 내에 | ||
* PaymentCommandJpaRepository, PaymentCommandQueryDslRepository 같이 구현 클래스를 생성할 수 있어요. | ||
*/ | ||
public class PaymentCommandRepositoryImpl { | ||
} | ||
public class PaymentCommandRepositoryImpl {} |
9 changes: 4 additions & 5 deletions
9
src/main/java/depromeet/onepiece/payment/command/presentation/PaymentCommandController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
package depromeet.onepiece.payment.command.presentation; | ||
|
||
/** | ||
* 도메인 간 의존성을 제거하고 이벤트 소싱을 적용하기 위해 CQRS 패턴을 적용해요. | ||
* CQRS 패턴은 명령(Command)과 조회(Query)를 분리하는 패턴으로, 이 중에서 명령(Command)은 상태를 변경하는 역할을 담당해요. | ||
* 꼭 CommandController라고 명명할 필요는 없지만, 명령을 처리하는 역할을 하는 컨트롤러라는 것을 알 수 있도록 이름을 지어주는 것이 좋아요. | ||
* 도메인 간 의존성을 제거하고 이벤트 소싱을 적용하기 위해 CQRS 패턴을 적용해요. CQRS 패턴은 명령(Command)과 조회(Query)를 분리하는 패턴으로, 이 중에서 | ||
* 명령(Command)은 상태를 변경하는 역할을 담당해요. 꼭 CommandController라고 명명할 필요는 없지만, 명령을 처리하는 역할을 하는 컨트롤러라는 것을 알 수 | ||
* 있도록 이름을 지어주는 것이 좋아요. | ||
*/ | ||
public class PaymentCommandController { | ||
} | ||
public class PaymentCommandController {} |
11 changes: 4 additions & 7 deletions
11
src/main/java/depromeet/onepiece/payment/domain/Payment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
package depromeet.onepiece.payment.domain; | ||
|
||
/** | ||
* 도메인 주도 개발 DDD 아키텍처에서는 비즈니스 로직을 도메인 객체에 위치 시킵니다. | ||
* 이것을 도메인 규칙이라고 부르며, 외부에서 객체에 접근할 때는 이 도메인 규칙을 통해 객체의 상태를 변경해야 해요. | ||
* 도메인 규칙은 한 트랜잭션 안에서 처리할 수 있는 작은 단위로 나누는 것이 좋습니다. | ||
* 흔히 비슷한 도메인을 묶어서 하나의 애그리거트로 처리하기도 하지만, 도메인 간 복잡성을 증가시키고 일관성을 깨트릴 수 있으므로 주의해야 해요. | ||
* 도메인 주도 개발 DDD 아키텍처에서는 비즈니스 로직을 도메인 객체에 위치 시킵니다. 이것을 도메인 규칙이라고 부르며, 외부에서 객체에 접근할 때는 이 도메인 규칙을 통해 | ||
* 객체의 상태를 변경해야 해요. 도메인 규칙은 한 트랜잭션 안에서 처리할 수 있는 작은 단위로 나누는 것이 좋습니다. 흔히 비슷한 도메인을 묶어서 하나의 애그리거트로 처리하기도 | ||
* 하지만, 도메인 간 복잡성을 증가시키고 일관성을 깨트릴 수 있으므로 주의해야 해요. | ||
*/ | ||
|
||
public class Payment { | ||
} | ||
public class Payment {} |
7 changes: 2 additions & 5 deletions
7
src/main/java/depromeet/onepiece/payment/domain/exception/PaymentDomainExceptionCode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
package depromeet.onepiece.payment.domain.exception; | ||
|
||
/** | ||
* DomainExceptionCode는 도메인 규칙에서 발생하는 커스텀 예외 코드를 정의해요. | ||
*/ | ||
public enum PaymentDomainExceptionCode { | ||
} | ||
/** DomainExceptionCode는 도메인 규칙에서 발생하는 커스텀 예외 코드를 정의해요. */ | ||
public enum PaymentDomainExceptionCode {} |
7 changes: 3 additions & 4 deletions
7
src/main/java/depromeet/onepiece/payment/query/application/PaymentQueryService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
package depromeet.onepiece.payment.query.application; | ||
|
||
/** | ||
* 도메인 주도 개발 아키텍처에서 application 계층은 도메인 규칙에 핵심 로직 수행을 위임해요. | ||
* 따라서 QueryService는 조회한 데이터를 DTO로 변환하거나, 여러 도메인 객체를 조합하여 응답 데이터를 만드는 역할을 합니다. | ||
* 도메인 주도 개발 아키텍처에서 application 계층은 도메인 규칙에 핵심 로직 수행을 위임해요. 따라서 QueryService는 조회한 데이터를 DTO로 변환하거나, | ||
* 여러 도메인 객체를 조합하여 응답 데이터를 만드는 역할을 합니다. | ||
*/ | ||
public class PaymentQueryService { | ||
} | ||
public class PaymentQueryService {} |
7 changes: 2 additions & 5 deletions
7
...ava/depromeet/onepiece/payment/query/application/exception/PaymentQueryExceptionCode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
package depromeet.onepiece.payment.query.application.exception; | ||
|
||
/** | ||
* QueryExceptionCode는 QueryService에서 발생하는 커스텀 예외 코드를 정의해요. | ||
*/ | ||
public enum PaymentQueryExceptionCode { | ||
} | ||
/** QueryExceptionCode는 QueryService에서 발생하는 커스텀 예외 코드를 정의해요. */ | ||
public enum PaymentQueryExceptionCode {} |
7 changes: 3 additions & 4 deletions
7
src/main/java/depromeet/onepiece/payment/query/domain/PaymentQueryRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
package depromeet.onepiece.payment.query.domain; | ||
|
||
/** | ||
* 도메인 주도 개발 DDD 아키텍처에서는 조회 성능 향상을 위해 QueryRepository를 별도로 구현하여 CQRS 패턴을 적용합니다. | ||
* Master-Slave 구조에서는 Master DB에 쓰기 작업을 하고, Slave DB에서 읽기 작업을 하기 때문에, QueryRepository를 별도로 구현해요. | ||
* 도메인 주도 개발 DDD 아키텍처에서는 조회 성능 향상을 위해 QueryRepository를 별도로 구현하여 CQRS 패턴을 적용합니다. Master-Slave 구조에서는 | ||
* Master DB에 쓰기 작업을 하고, Slave DB에서 읽기 작업을 하기 때문에, QueryRepository를 별도로 구현해요. | ||
*/ | ||
public interface PaymentQueryRepository { | ||
} | ||
public interface PaymentQueryRepository {} |
9 changes: 4 additions & 5 deletions
9
...main/java/depromeet/onepiece/payment/query/infrastructure/PaymentQueryRepositoryImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
package depromeet.onepiece.payment.query.infrastructure; | ||
|
||
/** | ||
* RepositoryImpl은 Repository 인터페이스를 구현한 클래스로, 실제로 데이터베이스에 접근하여 데이터를 저장하거나 조회하는 역할을 해요. | ||
* 데이터베이스 접근 기술(JPA DATA, QueryDSL, MyBatis 등)을 사용하여 구현합니다. | ||
* 만약 JPA 및 QueryDSL을 사용한다면, infrastructure 패키지 내에 PaymentQueryJpaRepository, PaymentQueryQueryDslRepository 같이 구현 클래스를 생성할 수 있어요. | ||
* RepositoryImpl은 Repository 인터페이스를 구현한 클래스로, 실제로 데이터베이스에 접근하여 데이터를 저장하거나 조회하는 역할을 해요. 데이터베이스 접근 | ||
* 기술(JPA DATA, QueryDSL, MyBatis 등)을 사용하여 구현합니다. 만약 JPA 및 QueryDSL을 사용한다면, infrastructure 패키지 내에 | ||
* PaymentQueryJpaRepository, PaymentQueryQueryDslRepository 같이 구현 클래스를 생성할 수 있어요. | ||
*/ | ||
public class PaymentQueryRepositoryImpl { | ||
} | ||
public class PaymentQueryRepositoryImpl {} |
9 changes: 4 additions & 5 deletions
9
src/main/java/depromeet/onepiece/payment/query/presentation/PaymentQueryController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
package depromeet.onepiece.payment.query.presentation; | ||
|
||
/** | ||
* 도메인 간 의존성을 제거하고 이벤트 소싱을 적용하기 위해 CQRS 패턴을 적용해요. | ||
* CQRS 패턴은 명령(Command)과 조회(Query)를 분리하는 패턴으로, 이 중에서 조회(Query)는 상태를 조회하는 역할을 담당해요. | ||
* Master-Slave 구조로 데이터베이스가 구성되어 있을 때, 조회 모델을 따로 분리하는 것이 조회 성능 향상에 도움이 될 수 있어요. | ||
* 도메인 간 의존성을 제거하고 이벤트 소싱을 적용하기 위해 CQRS 패턴을 적용해요. CQRS 패턴은 명령(Command)과 조회(Query)를 분리하는 패턴으로, 이 중에서 | ||
* 조회(Query)는 상태를 조회하는 역할을 담당해요. Master-Slave 구조로 데이터베이스가 구성되어 있을 때, 조회 모델을 따로 분리하는 것이 조회 성능 향상에 도움이 | ||
* 될 수 있어요. | ||
*/ | ||
public class PaymentQueryController { | ||
} | ||
public class PaymentQueryController {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,6 @@ | |
@SpringBootTest | ||
class OnepieceApplicationTests { | ||
|
||
@Test | ||
void contextLoads() { | ||
} | ||
|
||
@Test | ||
void contextLoads() {} | ||
} |