Skip to content

Conversation

@namgigun
Copy link
Collaborator

📌 개요

  • AttachmentService 생성 및 주요 로직 구현
  • AttachmentService 단위 테스트 추가

🔨 작업 내용

AttachmentService 생성

  • entityType, entityId를 기반으로 AttachmentMapping을 수정 및 삭제할 수 있도록 기능 구현
  • 기존 구현하지 못했던 S3 이미지 삭제 로직을 서비스 내부에서 통합 처리

AttachmentService 테스트 구현

  • S3Mock을 활용해 실제 S3 연동 없이 삭제 로직 테스트 가능하도록 구성
  • 정상 케이스에 대한 단위 테스트 구현

🔗 관련 이슈

Closes #295

📝 참고 사항

  • 해당 내용을 반영하여 ERD, 매핑 전략 수정 예정

✅ 체크리스트

  • 기능 동작 확인
  • 테스트 코드 작성
  • 문서/주석 추가 및 최신화

- AttachmentMapping, FileAttachment 연관관계 주인을 다시 FileAttachment로 변경
- FileAttachment가 AttachmentMapping 참조를 안하도록 변경
EntityType에 해당하는 도메인에서 참조할 수 있는 비즈니스 로직 추가
- 각 entityType, entityId를 통해 AttachmentMapping을 수정/삭제 할 수 있도록 변경
- 이전에 추가하지 못했던 S3 이미지도 해당 로직을 통해 연동 가능
- FileAttachment의 nullable 여부 false로 변경
- MimeType 삭제
- AttachmentRepository em.flush, em.clear 삭제
- 기존
1. S3 오브젝트 + 파일 정보 제거
2. 매핑 테이블 제거

- 변경
1. S3 오브젝트 제거
2. 매핑 테이블 + 파일 정보 제거
@github-actions github-actions bot changed the title Fix: AttachmentMapping 관련 기능 수정 Fix: AttachmentMapping 관련 기능 수정 (#295) Oct 15, 2025
@namgigun namgigun merged commit 9436ad8 into dev Oct 15, 2025
3 checks passed
@github-actions github-actions bot deleted the Fix/295 branch October 15, 2025 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants