Skip to content

Conversation

@namgigun
Copy link
Collaborator

📌 개요

  • 파일 CRUD 기능 요구사항에 맞게 수정
  • 파일 CRUD 테스트 추가

🔨 작업 내용

🆙 파일 업로드 (POST /api/file/upload)

  • 요청 데이터 변경

    • 기존: 파일 정보 + 엔티티 타입 + 해당 엔티티의 아이디
    • 변경: 유저 + 파일 정보만 전달
  • 응답 데이터 변경

    • 기존: publicURL만 반환
    • 변경: attachmentId + publicURL 반환

🧾 파일 조회 (GET /api/file/read/{attachmentId})

  • 엔드포인트 변경

    • 기존: /api/file/read?entityType=POST&entityId=1
    • 변경: /api/file/read/{attachmentId}
  • 요청 데이터 변경

    • 기존: 엔티티 타입 + 해당 엔티티의 아이디
    • 변경: 유저 + attachmentId
  • 응답 데이터

    • 변경 없음 (URL 반환)

🔁 파일 수정 (PUT /api/file/update/{attachmentId})

  • 엔드포인트 변경

    • 기존: /api/file/update
    • 변경: /api/file/update/{attachmentId}
  • 응답 데이터 변경

    • 기존: null 반환
    • 변경: publicURL 반환 (수정된 파일의 새 URL)

🗑️ 파일 삭제 (DELETE /api/file/delete/{attachmentId})

  • 엔드포인트 변경
    • 기존: /api/file/delete?entityType=POST&entityId=1
    • 변경: /api/file/delete/{attachmentId}

🔗 관련 이슈

Closes #244

📝 참고 사항

  • 변경사항에 따른 파일 업로드 관련 문서 최신화 예정.

✅ 체크리스트

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

- 기존: 파일 정보 + 엔티티 타입 + 해당 엔티티의 아이디
- 변경: 유저 + 파일 정보
- 요청 데이터 변경에 따른 로직 변경
- 기존: publicURL
- 변경: attachmentId + publicURL
- 파일 업로드 요청 및 응답 데이터 변경에 따른 컨트롤러 메서드 변경
- 기존 : filePath
- 변경 : publicURL
- 기존: /api/file/read?entityType=POST&entityId=1
- 변경: /api/file/read/{attachmentId}
- 엔드 포인트 변경에 따른 파일 조회 비즈니스 로직 변경
- 기존 : /api/file/update
- 변경 : /api/file/update/{attachmentId}
- 엔드 포인트 변경에 따른 파일 수정 컨트롤러 메서드 변경
- 엔드 포인트 변경에 따른 파일 수정 로직 변경
- 기존: null
- 변경: publicURL
- 기존: /api/file/delete?entityType=POST&entityId=1
- 변경: /api/file/delete/{attachmentId}
- 엔드 포인트 변경에 따른 파일 삭제 로직 변경
- AttachmentMappingRepository 삭제
- getFileAttachmentOrThrow(AttachmentMapping으로부터 파일정보 추출하는 함수) 삭제
- 파일 서비스 변경에 따른 테스트 수정
- 기존: imageUrl = "S3 퍼블릭 URL"
- 변경: publicURL = "S3 퍼블릭 URL"
@github-actions github-actions bot changed the title Fix: 프론트 요청사항에 따른 파일 업로드 기능 수정 Fix: 프론트 요청사항에 따른 파일 업로드 기능 수정 (#244) Oct 13, 2025
기존 : "!=" 비교
변경 : "equals" 비교
@namgigun namgigun merged commit c257696 into dev Oct 13, 2025
3 checks passed
@github-actions github-actions bot deleted the Fix/244 branch October 13, 2025 03:09
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