Fix: 게시글 및 프로필 파일 관련 로직 보완 (#308) #313
Merged
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.
📌 개요
AttachmentMappingService로 일원화하여 중복 제거 및 책임 분리🔨 작업 내용
PostService
FileService제거 및AttachmentMappingService로 교체deleteRemovedAttachments로직 적용attachmentMappingService.deleteAttachments()사용으로 일관성 확보AttachmentMappingService
새 메서드
deleteRemovedAttachments()추가기존 전체 삭제 로직(
deleteAttachments)과 분리하여 부분 삭제 가능하도록 개선AccountService
AttachmentMappingService로 위임updateProfileImage,removeExistingMapping,isExternalImageUrl) 제거UserProfile기준으로 프로필 이미지 매핑 삭제 수행테스트 코드(PostServiceTest, AccountServiceTest)
AmazonS3를@MockBean처리AttachmentMappingService는 실제 Bean 주입하여 DB 반영 검증 가능하도록 수정userId대신userProfile.id기준으로 조회하도록 수정🔗 관련 이슈
Closes #{이슈 번호}
📝 참고 사항
✅ 체크리스트