Skip to content

[BE-referral] 추천 이력서 업로드 URL 발급 및 업로드 확인 - #32

Merged
2eceon merged 1 commit into
devfrom
feature/BE-referral-resume
Oct 9, 2026
Merged

2eceon merged 1 commit into
devfrom
feature/BE-referral-resume

Conversation

@2eceon

@2eceon 2eceon commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

💡 개요

추천 게시물에 첨부할 이력서를 객체 스토리지에 직접 올릴 수 있도록 업로드 URL을 발급하고, 실제 업로드 여부를 확인하는 기능을 추가합니다.

Closes #17

📌 변경 사항

  • POST /referral/resumes/presigned-url (대표): 이력서 업로드 URL 발급
    • presigned PUT 10분, 파일 형식·크기를 서명에 포함 → 신고한 것과 다른 파일은 업로드 불가
    • 객체 키: referral-resumes/{companyId}/{uuid}/{파일명} (경로 문자 제거)
    • DB에는 객체 키와 메타데이터만 저장 (uploadedAt=null, 업로드 미확인 상태)
  • ResumeService.confirmUploaded: 게시물 작성 시([BE-referral] 인재 추천 게시물 CRUD API #18) 실제 업로드 여부·크기·형식 확인
  • StorageService: S3 호환 스토리지 연결 (엔드포인트 설정형, AWS·OCI 모두 가능)
  • 의존성 추가: @aws-sdk/client-s3, @aws-sdk/s3-request-presigner
  • .env.example에 STORAGE_* 항목 추가 (기존 줄 변경 없음)

📖 프론트 참고

  • 발급받은 uploadUrl로 PUT 요청, 헤더 Content-Type은 발급 때 보낸 값과 같아야 함
  • 허용 형식: PDF(.pdf), Word(.docx), 최대 10MB
  • 오류
    • PDF·DOCX 외 415 UNSUPPORTED_FILE_TYPE
    • 10MB 초과 413 FILE_TOO_LARGE
    • 추천 게시 동의 없음 403 CONSENT_NOT_GIVEN

⚠️ 명세에 없는 에러 코드

  • RESUME_NOT_FOUND(404), RESUME_NOT_UPLOADED(422), RESUME_MISMATCH(422): 업로드 확인용, [BE-referral] 인재 추천 게시물 CRUD API #18 게시물 작성에서 사용
  • STORAGE_NOT_CONFIGURED(503): 스토리지 미설정 시 메타데이터 저장 전 차단
  • EMPLOYEE_NOT_FOUND(404)

❓ 확인 필요

  • AWS S3 / OCI Object Storage 미정 → 버킷 미생성으로 실제 업로드는 확인 못 함
    • 후속 이슈: [BE-referral] 스토리지 실연동 확인 (링크 예정)
  • 버킷 CORS에 프론트 도메인의 PUT 허용 필요

🛠 머지 후 팀 작업

  • npm ci --legacy-peer-deps (패키지 추가됨)
  • 서버·로컬 .env에 STORAGE_* 설정 (비어 있으면 업로드 URL 발급이 503)

✅ 검증

  • build 통과, test 345개 통과 (신규 33개)
  • 실제 AWS SDK로 서명 URL 생성 확인 (10분 만료, content-type·content-length 서명 포함)
  • 임시 DB로 앱 실행해 HTTP smoke 13/13 통과

- POST /referral/resumes/presigned-url (대표): presigned PUT 10분, Content-Type·Content-Length 서명 포함
  - 403 FORBIDDEN / CONSENT_NOT_GIVEN, 415 UNSUPPORTED_FILE_TYPE(PDF·DOCX 외), 413 FILE_TOO_LARGE(10MB 초과)
  - 객체 키 referral-resumes/{companyId}/{uuid}/{경로 문자 제거한 파일명}, DB 저장 후 presign
  - 버킷 미설정 시 503 STORAGE_NOT_CONFIGURED (메타데이터 저장 전 차단)
- ResumeService.confirmUploaded: 404 RESUME_NOT_FOUND, 422 RESUME_NOT_UPLOADED, 422 RESUME_MISMATCH, 통과 시 uploadedAt 기록
- StorageService(S3 호환, endpoint 설정형 — AWS/OCI 팀 확인 필요): presignPut·presignGet·headObject
- 의존성 추가: @aws-sdk/client-s3, @aws-sdk/s3-request-presigner / .env.example에 STORAGE_* 추가

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@2eceon
2eceon requested a review from haeunjeon0410 October 9, 2026 13:18
@2eceon 2eceon self-assigned this Oct 9, 2026
@2eceon 2eceon added the ✨FEATURE 새로운 기능 개발 label Oct 9, 2026
@2eceon
2eceon merged commit 4f1fe14 into dev Oct 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨FEATURE 새로운 기능 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BE-referral] 추천 이력서 업로드 URL 발급 및 업로드 확인

1 participant