Repository navigation
feat: 내 템플릿 상세 조회 API (#49) - #50
Merged
Merged
Conversation
oTAETAEo
marked this pull request as ready for review
October 30, 2026 16:05
This was referenced Oct 31, 2026
Closed
Merged
Merged
chjpooh2002
previously approved these changes
Nov 2, 2026
chjpooh2002
left a comment
Contributor
There was a problem hiding this comment.
리뷰 남긴 사항 하나만 확인 부탁드립니다! 수고하셨습니다~
| * 휴지통에 없는 본인 템플릿. 수정·사용 기록도 같은 404 구분을 쓴다. | ||
| * 엔티티를 돌려주므로 template 도메인 안에서만 부른다 (ArchUnit이 다른 도메인의 사용을 막는다). | ||
| */ | ||
| public Template getActiveTemplate(Long userId, Long templateId) { |
Contributor
There was a problem hiding this comment.
엔티티를 돌려주는 공개 메서드가 조회 서비스에 생기면서 쓰기 서비스가 조회 서비스를 의존하게 됐는데요(#53). 지금은 문제없지만, 나중에 조회 서비스가 다른 도메인 서비스를 부르기 시작하면 순환 참조 위험이 생길 거 같습니다!
지금 구조로 가되, 이 메서드는 “template 도메인 내부 전용”이라는 걸 ArchUnit 규칙으로도 묶어 두면 좋겠습니다~~
Contributor
Author
There was a problem hiding this comment.
@chjpooh2002 해당 부분 공개 범위가 public 인줄은 몰랐네여 수정 해 두겠습니다 👍
해당 부분은 다시 보니까 규칙을 추가하는것 보다 default 공개 범위로 두는것이 나을것 같은데 어떻게 생각하세여 ?
Contributor
There was a problem hiding this comment.
그게 더 나을 거 같네요! 규칙 테스트보다 컴파일 단계에서 막히니까요. 바꾸실 때 메서드 위 주석의 “ArchUnit이 다른 도메인의 사용을 막는다” 부분도 "패키지 범위라 service 패키지 밖에서는 부를 수 없다"로 같이 고쳐 주세요~!
chjpooh2002
approved these changes
Nov 2, 2026
chjpooh2002
approved these changes
Nov 2, 2026
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.
관련 이슈
작업 내용
명세 9번
GET /api/v1/templates/{templateId}를 구현했습니다. 본인 소유 조회와 404 구분을 처음 만드는 작업이라 11번 수정, 14번 사용 기록이 재사용할 수 있게 나눴습니다.커밋별로 보기
TemplateRepository.findByIdAndUserId,TEMPLATE404_1,TEMPLATE404_2TemplateQueryService.getTemplate,getActiveTemplate,TemplateDetailQuery,TemplateDetailResultGET /{templateId},TemplateDetailResponse,TEMPLATE200_2getActiveTemplate을 패키지 범위로 제한404 구분
TEMPLATE404_1TEMPLATE404_1TEMPLATE404_2본인 소유 조건으로 한 번 찾은 뒤
isInTrash()로 나눕니다. 다른 회원의 휴지통 템플릿은 조회되지 않으므로 존재 여부가 드러나지 않습니다.명세와 달라진 점
TEMPLATE404_1설명에 "휴지통에 있는 템플릿"이 남아 있어 같은 표의TEMPLATE404_2, 비고와 어긋납니다. 비고대로 내 휴지통 템플릿은TEMPLATE404_2로 구현했습니다. 이 PR에서docs/는 고치지 않았습니다테스트
TemplateDetailControllerTest(테스트컨테이너 MySQL)+09:00,no-store, 영속성 컨텍스트를 비운 뒤 다시 읽은 본문lastUsedAt은 null404_1, 다른 회원 템플릿404_1, 내 휴지통404_2, 다른 회원의 휴지통404_1COMMON401_1templateId는COMMON400_1(현재 전역 처리 결과를 고정)TemplateQueryServiceTest(모키토): 성공,404_1,404_2세 분기TemplateRepositoryTest: 본인 소유 조회가 휴지통은 찾고 다른 회원 것은 찾지 않음TemplateErrorCodeTest:404_1,404_2코드·문구확인 체크리스트
./gradlew build통과global공통 코드 변경 없음리뷰어에게
getActiveTemplate이 엔티티를 돌려줍니다: 11·14번의TemplateCommandService가 같은 404 구분을 쓰게 하려고 패키지 범위로 뒀습니다.service패키지 밖에서는 컴파일되지 않습니다. 기존 ArchUnit 규칙은 반환값을 버리거나TemplateDetailResult.from(...)에 바로 넘기는 호출을 잡지 못해, 규칙 추가 대신 공개 범위를 닫았습니다 (리뷰 반영)TEMPLATE404_2가 없어 명세대로면 휴지통 템플릿이404_1입니다. 9·11·14번 표를 고칠 때 12번을 어떻게 둘지 같이 정해야 합니다TemplateCreateResponse와 필드가 같지만, 화면마다 바뀌는 방향이 달라 각자 둔다는 기존 방침을 따랐습니다🤖 Generated with Claude Code