출처 몰 판정을 컨트롤러에서 WishlistService 결과로 이동 - #1050
Open
m-a-king wants to merge 2 commits into
Open
Conversation
- WishlistController 가 SourcePlatformResolver 를 직접 주입받아 응답 조립 때마다 판정을 풀어 넘기던 것을 제거. 컨트롤러는 WishlistService 만 의존한다 - 판정 결과(sourcePlatform)는 WishWithItem·WishDetail 에 실리고, WishlistService 가 응답 경계에서 withSourcePlatform 으로 채운다. 영속화 계층(WishPersistenceService)은 손대지 않아 그쪽 생성 지점 8곳은 그대로다 - 응답 DTO 는 결과 객체만 받는다. WishItemResponse.from(result)·fromRegistration(result)·WishDetailResponse.from(detail, requesterId) Claude-Session: https://claude.ai/code/session_011f4kWuNL7ritPmuwz7R4c9
- 등록·상세는 기존 테스트가 sourcePlatform 을 단언했지만 목록은 없어, 목록 경로에서 판정을 빠뜨려도 통과했다. 판정 지점을 서비스 경계로 옮기면서 그 구멍을 닫는다 Claude-Session: https://claude.ai/code/session_011f4kWuNL7ritPmuwz7R4c9
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Discord 스레드 연동용 메타데이터입니다. discord-pr-bot 워크플로가 자동 생성하며, 수정·삭제하면 PR 과 Discord 알림 연동이 끊깁니다. |
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.
Situation
SourcePlatformResolver빈을 직접 주입받아, 응답을 만들 때마다 링크에서 출처 몰 표시명을 판정해 DTO 에 넘기고 있었다. 목록·등록·상세 세 곳이 같은 호출을 반복했다.Task
Action
WishlistService만 의존WishWithItem·WishDetail)sourcePlatform을 든다WishlistServicewithSourcePlatform으로 채운다WishlistService의 private 확장 함수가sourcePlatformResolver.resolve(item.link)를 호출하고, 컨트롤러로 나가는 모든 경로(등록·이미지 confirm·목록·상세·수기 수정·새로고침)가 그것을 거친다.WishPersistenceService가WishWithItem을 만드는 8곳은 그대로다. 그래서WishWithItem.sourcePlatform은 기본값 null 이고, 서비스 경계가 채운다는 점을 필드 주석 한 줄로 남겼다.WishDetail은 생성 지점이 서비스 한 곳뿐이라 기본값 없이 필수 인자다.Result
sourcePlatform값과 이미지 등록의 null 을 단언하는 기존 통합 테스트가 그 계약을 잡고 있다.sourcePlatform을 단언하지 않아 목록 경로에서 채우기를 빠뜨려도 통과했다. 판정 지점을 옮기는 김에 목록 단언을 더해 세 경로(등록·목록·상세) 모두 계약이 잡히게 했다.연관 이슈