feat: EditorOperationController 경계 도입 및 Editor save, move 공통화#67
Open
feat: EditorOperationController 경계 도입 및 Editor save, move 공통화#67
Conversation
- 공통 작업들의 공통 처리를 위한 EditorOperationController 채택 배경과 경계 ADR을 추가하였습니다. - guides 경로의 문서화 구조 규칙을 재정립하고, 이에 맞게 기존 editor-transaction-guideline 관련 문서들을 개편했습니다. - 관련 요구사항과 연관 문서를 채택 기준에 맞게 재정리하였습니다.
1. 에디터 공통 처리를 위한 오케스트레이터를 추가하였습니다. 2. 에디터 저장 로직을 EditorSave 구조로 개편하여 오케스트레이터에 반영하였습니다. - 기존 DocumentTransactionService의 저장 알고리즘은 유지합니다. - DocumentTransaction 중심 명명과 구조를 EditorSave 기준으로 재정리하였습니다. - 기존 DocumentTransaction 구조는 Deprecated 처리하였습니다.
1. move API를 추가하고 문서/블록 이동 요청을 공통화하여 처리하도록 구현하였습니다. - 에디터 오케스트레이터가 EditorMoveResourceType에 따른 라우팅 및 실행을 담당합니다. - 문서/블록 이동은 기존 이동 알고리즘을 재사용하도록 정리하였습니다. 2. 관련 문서들을 현재 구조에 맞게 변경하였습니다.
1. EditorOperationController 기준, save 및 move API에 대한 테스트를 추가하였습니다. - 기존 구현해둔 관련 테스트들과 동일한 기능 시나리오들을 검증하도록 구성하였습니다. - save, move의 핵심적인 성공 및 실패 케이스를 추가로 보강하였습니다.
1. 기존 AdminBlock 단건 경로에서 사용되던 DocumentTransaction 계열 타입과 구조를 EditorSave 기준으로 정리하였습니다. 2. 변경에 맞춰, AdminBlockTransactionService 등의 기존 명명을 AdminBlockOperationService로 기준으로 변경하였습니다.
1. AdminBlockController 테스트를 현재 AdminBlockOperationService 구조에 맞게 정리하였습니다. 2. 기존 BlockApiIntegerationTest는 AdminBlockApiIntegrationTest로 분리하고, 문서+블록 조회는 DocumentBlocksApiIntegrationTest로 분리하였습니다. 3. AdminBlockOperationServiceImpl 테스트를 추가하고, 핵심적인 오류 케이스 및 몇 가지 검증을 보강하였습니다.
1. DocumentController의 기존 transaction save 경로와 move 경로를 제거하였습니다. 2. 더 이상 사용되지 않는 legacy DocumentTransaction 구조 파일들을 모두 삭제하였습니다. 3. legacy save, move 테스트를 모두 삭제하고, EditorOperation 및 남은 Document/AdminBlock 테스트 기준으로 유지하도록 정리하였습니다. 4. legacy Transaction 구조 없이도 기존 기능들이 EditorOperation 경계에서 동일하게 검증됨을 확인하였습니다.
1. Repository에서 직접 flush 하던 흐름을, PersistenceContextManager를 통해 flush 하도록 수정하였습니다. 2. Editor save, move와 Admin Block Operation 흐름의 flush 호출을 PersistenceContextManager 기준으로 정리하였습니다. 3. 문서 version up 책임을 DocumentVersionUpdater 컴포넌트로 분리하였고, 관련 서비스들에서 이를 호출하도록 변경했습니다.
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 #65
🔎 작업 내용
1. 주요 변경 사항 요약
EditorOperationController경계 도입 (/editor-operations)save,move를 Editor 협업/쓰기 경계로 정리EditorOperationOrchestrator로 연결EditorSave*기준으로 정리DocumentTransaction*구조 제거EditorSave*기준으로 정리save경계의 flush 및 문서 version up 책임 재정리2. 상세 내용 (선택)
1. 에디터 관련 쓰기 경계를 EditorOperationController 기준으로 정리하였습니다.
EditorOperationController를 문서/블록 엔티티 전반에서 공통으로 발생하는 에디터 협업 Write 작업을 받는 경계로 잡았습니다.EditorOperationController는 문서/블록 엔티티에 걸친 에디터 협업 operation의 공통 진입점임과 동시에, 각 작업의 의미와 계약은 endpoint 수준에서 그대로 드러나도록 유지하였습니다.2. save 구조를 Editor operation 문맥에 맞게 다시 정리하였습니다.
save를 기존DocumentTransaction...명명과 구조를 중심으로 사용하지 않고,EditorSave...기준으로 정리하였습니다.3. move를 Editor operation 경계 안에서 공통화하였습니다.
move또한 Editor operation write 작업으로 공통화처리하였습니다.save는 배치 저장 유스케이스이고,move는 구조 변경 유스케이스이므로, 실제 처리 방식은 다릅니다.move는 오케스트레이터에서 분기한 뒤, 각 resource 성격에 맞는 기존 처리 경로를 재사용하는 방식으로 요청을 처리합니다.4. 관리자 단건 블록 API도 Editor save 기준으로 재정리하였습니다.
DocumentTransaction*구조를 더 이상 중심으로 사용하지 않으므로, 관리자 단건 블록 API도EditorSave*기준으로 재정리하였습니다.5. save 경계에서 flush와 문서 version up 책임을 재정리하였습니다.
Block관련 응답은 최신version,sortKey,deletedAt이 필요한 시점에만 확정되도록 정리하였으며, document version은 담당 컴포넌트를 추가하여 별도 정책으로 유지되도록 책임을 분리하였습니다.6. Legacy Deprecated 구조와 문서를 변경된 구조 기준으로 정리하였습니다.
DocumentTransaction*구조는 더 이상 중심 경계가 아니므로 제거하였습니다.3. 프롬프트 경로
4. 참조 문서 경로 (ADR, discussions, roadMap ...)
💬 집중 리뷰 요청
EditorOperationController에서 묶어서 처리하는 기준이 자연스러운지 확인 부탁드립니다.POST /documents/{documentId}/transactions->POST /editor-operations/documents/{documentId}/saveDocumentTransaction*->EditorSave*POST /editor-operations/moveresourceType,resourceId,targetParentId,afterId,beforeId,versionresourceType,resourceId,parentId,version,documentVersion,sortKeyDocumentTransaction*, 개별move경로, 기존 요청/응답 명명에 의존하고 있었다면, 이번 리팩토링 이후 어떤 호출부와 상태 동기화 코드를 함께 변경해야 할지 확인 부탁드립니다.🧪 테스트 방법
1. 로컬 실행 방법
./gradlew :documents-infrastructure:test --tests com.documents.service.AdminBlockOperationServiceImplTest --tests com.documents.service.EditorOperationOrchestratorImplTest --tests com.documents.service.BlockServiceImplTest --tests com.documents.service.DocumentServiceImplTest./gradlew :documents-api:test --tests com.documents.api.editor.EditorOperationControllerWebMvcTest --tests com.documents.api.block.AdminBlockControllerWebMvcTest --tests com.documents.api.document.DocumentControllerWebMvcTest./gradlew :documents-boot:test --tests com.documents.api.editor.EditorOperationApiIntegrationTest --tests com.documents.api.editor.EditorOperationConcurrencyIntegrationTest --tests com.documents.api.block.AdminBlockApiIntegrationTest --tests com.documents.api.block.DocumentBlocksApiIntegrationTest --tests com.documents.api.document.DocumentApiIntegrationTest2. 테스트 시나리오
✅ PR 체크리스트
📈 이미지 / 캡처 (필요 시)
No response