Refactor: 단일 모듈 계층형에서 헥사고널 아키텍처 멀티모듈 전환 - #18
Open
leepg038292 wants to merge 41 commits into
Open
Conversation
- GetPageInfoForWeb → GetSearchResult 엔드포인트로 변경 - sellable_status 필드로 품절 필터 수정 - thumbnail_nudge_badge_list 서브필드 누락 오류 수정 - 홈 피드 탐색(fetch_home)과 카테고리 크롤링(fetch_page) 함수 분리 - zigzag_final_list.csv, zigzag_100k.csv, benchmark 결과 추가 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
[data] 무신사 데이터 크롤링
[data] 지그재그 데이터 크롤링
* tags, description 컬럼 제거 * 숫자 컬럼 결측값 0으로 처리
* 에이블리 재수집 데이터로 병합 * 29cm 재수집 및 전처리된 데이터로 병합 * 크림 쇼핑물 데이터 추가
…ALLYM#8 LIKELION-HALLYM#8 [data] 29cm 데이터 크롤링
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
전환 배경
기존 구조는 단일 Spring Boot 모듈 안에
controller / service / repository패키지 계층형으로 구성되어 있었습니다.기존 문제점
CartItem이ProductEntity를@ManyToOne으로 직접 참조 → 피처 간 결합@Entityimport해도 빌드 통과변경 사항
1. Java + Lombok → Kotlin 전환
data class+val로 불변 도메인 객체를 언어 수준에서 지원.상태 변경은 반드시
copy()를 통해 새 객체를 반환하므로 사이드 이펙트가 줄고, Lombok 어노테이션 프로세서 의존이 제거됩니다.2. 단일 모듈 → Gradle 멀티모듈 (피처 우선 분리)
레이어 우선 분리가 아닌 피처 우선 분리를 채택했습니다.
3. CartItem의 ProductEntity 직접 참조 제거
cart가 필요한 상품 정보의 형태를 스스로 정의(
ProductSummary)하고, 조회 방법은ProductQueryPort인터페이스로 추상화했습니다.4. ProductQueryPort/Adapter를 cart 모듈로 이동
기존에
product:repository-jpa가cart:model의ProductSummary를 반환하면서 product 모듈이 cart 모듈을 알게 되는 역방향 의존이 존재했습니다.5. UseCase 과분리 → Service 인터페이스 통합
구현체는
internal class로 선언해 모듈 외부에서 직접 접근 불가. 외부는 인터페이스만 사용합니다.6. DTO를 api 레이어에 위치
도메인 객체에 직렬화 어노테이션이 침투하지 않도록 DTO는
api서브모듈에만 존재합니다.변환 로직은 컨트롤러 내 확장 함수(
private fun Domain.toResponse())로 처리합니다.7. schema 모듈 = SQL 마이그레이션 전용
각 피처가 자신의 테이블 스키마를 소유합니다.
빌드 이슈 해결 내역
Test plan
GET /products전체 조회 (커서 페이지네이션)GET /products/{id}상세 조회POST /carts/items상품 담기PATCH /carts/items/{id}수량 변경DELETE /carts/items/{id}아이템 삭제DELETE /carts장바구니 초기화