feat: 문서 이동/순서 변경 API 추가#32
Merged
hellonaeunkim merged 12 commits intodevfrom Mar 21, 2026
Hidden character warning
The head ref may contain hidden characters: "feat/#31_\ubb38\uc11c_\uc774\ub3d9_\ubc0f_\uc21c\uc11c_\ubcc0\uacbd"
Merged
Conversation
26 tasks
oneplast
reviewed
Mar 20, 2026
Collaborator
|
현재 요구사항과 비즈니스 정책에 따라 잘 구현해주신 것 같습니다. |
Collaborator
|
수정 내용 확인했습니다! 고생하셨습니다!! |
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.
📝 Part (해당되는 것만 체크)
#️⃣ 연관된 이슈
closes #31
🔎 작업 내용
1. 주요 변경 사항 요약
POST /v1/documents/{documentId}/move)targetParentId,afterDocumentId,beforeDocumentId기반 위치 해석 및sortKey재계산 로직 추가docs/REQUIREMENTS.md에 move API 명세와 정책 반영2. 상세 내용 (선택)
PATCH /v1/documents/{documentId}는 메타데이터 수정 책임만 유지하고, 구조 변경은POST /v1/documents/{documentId}/move로 분리했습니다.targetParentIdafterDocumentIdbeforeDocumentIdtargetParentId = null이면 루트 형제 집합 이동afterDocumentId만 있으면 해당 문서 뒤 위치beforeDocumentId만 있으면 해당 문서 앞 위치afterDocumentId,beforeDocumentId가 동시에 오면 같은 부모 집합의 활성 형제 문서인지, 서로 인접한 위치인지 검증합니다.parentId,sortKey,updatedBy를 한 트랜잭션 안에서 반영하고,updatedAt은 JPA update 시점에 함께 갱신됩니다.SORT_KEY_REBALANCE_REQUIRED를 반환합니다.3. 프롬프트 경로
💬 집중 리뷰 요청
[docs/REQUIREMENTS.md](https://github.com/jho951/Block-server/pull/32/changes/86a7c9cab9c725046bc95cd7560ed1bbce8fe894)반영 범위가 과하지 않은지 점검 부탁드립니다.[DocumentSortKeyGenerator](https://github.com/jho951/Block-server/pull/32/changes/9a90431e9075c02a94d06537039418b18ac237b0)에 추가한 move용sortKey계산 로직이 현재 요구사항과 정렬 정책에 맞게 구현되었는지 확인 부탁드립니다.🧪 테스트 방법
1. 로컬 실행 방법
./gradlew --no-daemon :documents-api:test --tests com.documents.api.document.DocumentControllerWebMvcTest :documents-infrastructure:test --tests com.documents.service.DocumentServiceImplTest :documents-boot:test --tests com.documents.api.document.DocumentApiIntegrationTest2. 테스트 시나리오
parentId,sortKey,updatedBy,updatedAt반영 확인DOCUMENT_NOT_FOUND응답/예외 확인DOCUMENT_NOT_FOUND응답/예외 확인INVALID_REQUEST응답/예외 확인INVALID_REQUEST응답/예외 확인INVALID_REQUEST예외 확인afterDocumentId/beforeDocumentId요청 실패 확인SORT_KEY_REBALANCE_REQUIRED확인X-User-Id헤더 누락 시UNAUTHORIZED응답 확인✅ PR 체크리스트