<aside> 🔑

기본 원칙


1. 패키지 구조

/LogiBox
├── .github
│   ├── workflows/ci.yml
│   ├── ISSUE_TEMPLATE/issue-template.md
│   └── PULL_REQUEST_TEMPLATE.md
├── module
│   ├── src/main
│   │   ├── java/com/spatra/gt5lt7/common
│   │   │   ├── config
│   │   │   │  └── JpaConfig.java
│   │   │   ├── advice/GlobalExceptionHandler.java
│   │   │   ├── exception
│   │   │   │   ├── BaseException.java
│   │   │   │   ├── ErrorCode.java
│   │   │   │   └── CommonErrorCode.java
│   │   │   ├── dto
│   │   │   │   ├── ApiResponse.java
│   │   │   │   └── PageResponse.java
│   │   │   └── entity/BaseEntity.java
│   │   └── resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
│   └── build.gradle
├── infrastructure
│   ├── eureka-server
│   └── api-gateway
├── services
│   ├── user-service
│   ├── logistics-service
│   ├── catalog-service
│   └── order-service
├── build.gradle
├── settings.gradle
├── docker-compose.yml
└── README.md

2. 이름 규칙

구분 규칙 예시
클래스 PascalCase ProductController
메서드 camelCase + 동사 시작 createProduct), getProduct(), searchProduct(), updateProduct(), deleteProduct()
변수 camelCase productName
boolean 변수 camelCase + is/has 접두어 isSale, hasStock
상수 SCREAMING_SNAKE_CASE DEFAULT_PAGE_SIZE
Enum PascalCase ProductStatus
Enum 값 SCREAMING_SNAKE_CASE ON_SALE, OUT_OF_STOCK, PARTNER, VENDOR
DTO PascalCase + Request/Response 접미사 ProductRequest, ProductResponse

3. 계층별 규칙

1) Controller 규칙


2) Service 규칙

@Transactional(readOnly = true)
public class ProductService {
    public ProductResponse getProductById(UUID id) { ... }
		
    @Transactional
    public UUID createProduct(ProductRequest request) { ... }
}