Skip to content

[REFACTOR]: 수정 API DTO 정책 반영 및 업로드 헬퍼 정리#129

Merged
arlen02-01 merged 1 commit intodevelopfrom
OT-156-feature/update-api
Mar 9, 2026
Merged

[REFACTOR]: 수정 API DTO 정책 반영 및 업로드 헬퍼 정리#129
arlen02-01 merged 1 commit intodevelopfrom
OT-156-feature/update-api

Conversation

@arlen02-01
Copy link
Copy Markdown
Contributor

@arlen02-01 arlen02-01 commented Mar 9, 2026

📝 작업 내용

이번 PR에서 작업한 내용을 적어주세요

  • 업데이트에 영상 업데이트 없는 것 반영

☑️ 체크 리스트

체크 리스트를 확인해주세요

  • 테스트는 잘 통과했나요?
  • 충돌을 해결했나요?
  • 이슈는 등록했나요?
  • 라벨은 등록했나요?

#️⃣ 연관된 이슈

ex) # 이슈번호
#90

💬 리뷰 요구사항

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 예외 처리를 이렇게 해도 괜찮을까요? / ~~부분 주의 깊게 봐주세요

Summary by CodeRabbit

릴리스 노트

  • Refactor
    • API 응답 구조를 단순화하여 불필요한 필드를 제거했습니다.
    • 콘텐츠 및 숏폼 메타데이터 업데이트 기능을 재정의하여 시리즈와 배우 정보 업데이트에만 집중하도록 변경했습니다.
    • 이미지 업로드 처리 로직을 개선하고 선택적 썸네일 처리를 지원하도록 업데이트했습니다.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 9, 2026

Walkthrough

미디어 업로드 흐름에서 미디어 관련 필드 및 메타데이터를 제거하고, 이미지 기반 업데이트로 전환하는 리팩토링입니다. 요청/응답 DTO, 매퍼, 서비스, 도메인 엔티티, 업로드 헬퍼에서 originFileName, duration, videoSize, MediaUpdateUploadResult 등을 제거했습니다.

Changes

Cohort / File(s) Summary
Contents DTO 및 ShortForm DTO 요청
apps/api-admin/src/main/java/com/ott/api_admin/content/dto/request/ContentsUpdateRequest.java, apps/api-admin/src/main/java/com/ott/api_admin/shortform/dto/request/ShortFormUpdateRequest.java, apps/api-admin/src/main/java/com/ott/api_admin/shortform/dto/request/ShortFormUploadRequest.java
duration, videoSize, originFileName, thumbnailFileName 필드 및 관련 검증 애노테이션 제거
Contents 및 ShortForm 응답 DTO
apps/api-admin/src/main/java/com/ott/api_admin/content/dto/response/ContentsUpdateResponse.java, apps/api-admin/src/main/java/com/ott/api_admin/shortform/dto/response/ShortFormUpdateResponse.java
originObjectKey, masterPlaylistObjectKey, originUploadUrl 필드 제거. 이미지 관련 필드만 유지
백오피스 매퍼
apps/api-admin/src/main/java/com/ott/api_admin/content/mapper/BackOfficeContentsMapper.java, apps/api-admin/src/main/java/com/ott/api_admin/shortform/mapper/BackOfficeShortFormMapper.java
toContentsUpdateResponse, toShortFormUpdateResponse 메서드 시그니처에서 originObjectKey, masterPlaylistObjectKey, originUploadUrl 파라미터 제거
백오피스 서비스 레이어
apps/api-admin/src/main/java/com/ott/api_admin/content/service/BackOfficeContentsService.java, apps/api-admin/src/main/java/com/ott/api_admin/shortform/service/BackOfficeShortFormService.java
prepareMediaUpdate에서 prepareImageUpdate로 전환. MediaUpdateUploadResult를 ImageUpdateUploadResult로 변경. Contents.updateMetadata 호출에서 duration, videoSize 파라미터 제거
업로드 헬퍼
apps/api-admin/src/main/java/com/ott/api_admin/upload/support/UploadHelper.java
public 메서드 prepareMediaUpdate 및 MediaUpdateUploadResult 레코드 제거. prepareMediaCreate에서 thumbnailFileName 선택적 처리 추가
도메인 엔티티
modules/domain/src/main/java/com/ott/domain/contents/domain/Contents.java, modules/domain/src/main/java/com/ott/domain/short_form/domain/ShortForm.java
updateMetadata 메서드 시그니처에서 duration, videoSize 파라미터 제거

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • [OT-156] [FEAT] 시리즈 숏폼 콘텐츠 수정 API 구현 #100: 미디어/원본 관련 필드 및 prepareMediaUpdate 사용을 제거하여 이미지 전용 흐름으로 전환하는 변경으로, PR #100에서 도입된 미디어 업데이트 기능을 직접 되돌립니다.
  • [OT-104][FEAT]: 업로드 API 구현 #64: 동일한 업로드/DTO/UploadHelper 흐름을 수정하며, 검색된 PR이 미디어 원본/마스터 업로드 필드와 prepareMediaUpdate/MediaUpdateUploadResult를 추가했다면 이 PR은 해당 기능을 제거합니다.
  • [OT-85][REFACTOR]: ERD 수정 사항 반영 #45: Contents 및 ShortForm 도메인 엔티티와 업로드/업데이트 흐름의 미디어/원본/마스터 플레이리스트 및 비디오 관련 필드를 제거하거나 리팩토링하는 변경입니다.

Suggested labels

refactor

Suggested reviewers

  • yubin012
  • phonil
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 주요 변경 사항인 업데이트 API DTO 정책 반영과 업로드 헬퍼 정리를 명확하게 요약하고 있으며, 변경 세트와 잘 연관되어 있습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch OT-156-feature/update-api

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Collaborator

@marulog marulog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다~

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/api-admin/src/main/java/com/ott/api_admin/shortform/service/BackOfficeShortFormService.java (1)

193-215: ⚠️ Potential issue | 🟠 Major

숏폼 생성/수정에서 썸네일 업로드 경로가 끊겼습니다.

Line 194와 Line 253에서 썸네일 파일명을 항상 null로 넘기고 있는데, 아래에서는 계속 thumbnailObjectKey/thumbnailUploadUrl/nextThumbnailUrl을 소비하고 있습니다. 이 상태면 숏폼 쪽은 썸네일 presigned URL 발급 흐름이 사실상 빠지고, modules/domain/src/main/java/com/ott/domain/media/domain/Media.java:68-71updateImageKeys(...)는 null 가드가 없어서 기존 thumbnailUrl까지 그대로 null로 저장될 수 있습니다. 같은 PR의 BackOfficeContentsService는 여전히 request.thumbnailFileName()을 전달하고 있으니, 숏폼도 썸네일을 계속 지원하는 계약이면 여기서 파일명을 넘겨야 하고, 정말 제거한 거라면 응답 DTO의 썸네일 필드와 Media.thumbnailUrl 갱신 로직까지 같이 정리하는 편이 안전합니다.

Also applies to: 249-272

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/api-admin/src/main/java/com/ott/api_admin/shortform/service/BackOfficeShortFormService.java`
around lines 193 - 215, The short-form flow is passing null for the thumbnail
filename to uploadHelper.prepareMediaCreate (in BackOfficeShortFormService)
which prevents thumbnail presigned URLs from being generated and lets
media.updateImageKeys(...) (Media.updateImageKeys) overwrite thumbnail fields
with null; change the prepareMediaCreate calls in BackOfficeShortFormService to
pass request.thumbnailFileName() (same as BackOfficeContentsService) so
thumbnailObjectKey/thumbnailUploadUrl are produced and Media.updateImageKeys
keeps correct values; alternatively, if thumbnails are intentionally removed,
remove thumbnail fields from the upload response DTO and add null guards in
Media.updateImageKeys to avoid wiping existing thumbnailUrl (but prefer passing
request.thumbnailFileName() to preserve existing contract).
🧹 Nitpick comments (1)
apps/api-admin/src/main/java/com/ott/api_admin/shortform/dto/request/ShortFormUpdateRequest.java (1)

31-32: 요청/응답 계약을 한 방향으로 정리해 주세요.

apps/api-admin/src/main/java/com/ott/api_admin/shortform/service/BackOfficeShortFormService.java:219-273prepareImageUpdate(..., request.posterFileName(), null, ...)로 썸네일 교체를 완전히 막고 있는데, apps/api-admin/src/main/java/com/ott/api_admin/shortform/dto/response/ShortFormUpdateResponse.java:13-20는 여전히 thumbnailObjectKey/thumbnailUploadUrl를 노출합니다. 지금 형태면 두 필드는 항상 null이라 API 계약이 헷갈립니다. 포스터만 교체하는 정책이 맞다면 응답에서도 thumbnail 필드를 같이 제거하고, 아니라면 요청 DTO에 thumbnail 입력을 유지하는 쪽이 맞습니다.

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@apps/api-admin/src/main/java/com/ott/api_admin/upload/support/UploadHelper.java`:
- Around line 169-170: The thumbnail handling currently treats only null as "no
upload" and calls prepareRequiredUpload when thumbnailFileName is empty or
whitespace, causing INVALID_FILE_EXTENSION; change the logic that sets
thumbnailUpload to use StringUtils.hasText(thumbnailFileName) and call
prepareOptionalUpload(resourceRoot, resourceId, "thumbnail", thumbnailFileName,
false) when text is present, otherwise set thumbnailUpload to null so optional
thumbnails follow the same rule as the update path.

---

Outside diff comments:
In
`@apps/api-admin/src/main/java/com/ott/api_admin/shortform/service/BackOfficeShortFormService.java`:
- Around line 193-215: The short-form flow is passing null for the thumbnail
filename to uploadHelper.prepareMediaCreate (in BackOfficeShortFormService)
which prevents thumbnail presigned URLs from being generated and lets
media.updateImageKeys(...) (Media.updateImageKeys) overwrite thumbnail fields
with null; change the prepareMediaCreate calls in BackOfficeShortFormService to
pass request.thumbnailFileName() (same as BackOfficeContentsService) so
thumbnailObjectKey/thumbnailUploadUrl are produced and Media.updateImageKeys
keeps correct values; alternatively, if thumbnails are intentionally removed,
remove thumbnail fields from the upload response DTO and add null guards in
Media.updateImageKeys to avoid wiping existing thumbnailUrl (but prefer passing
request.thumbnailFileName() to preserve existing contract).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 005b6404-dcb9-49ab-b0f3-fda9598bee50

📥 Commits

Reviewing files that changed from the base of the PR and between c995f26 and 29fb1c1.

📒 Files selected for processing (12)
  • apps/api-admin/src/main/java/com/ott/api_admin/content/dto/request/ContentsUpdateRequest.java
  • apps/api-admin/src/main/java/com/ott/api_admin/content/dto/response/ContentsUpdateResponse.java
  • apps/api-admin/src/main/java/com/ott/api_admin/content/mapper/BackOfficeContentsMapper.java
  • apps/api-admin/src/main/java/com/ott/api_admin/content/service/BackOfficeContentsService.java
  • apps/api-admin/src/main/java/com/ott/api_admin/shortform/dto/request/ShortFormUpdateRequest.java
  • apps/api-admin/src/main/java/com/ott/api_admin/shortform/dto/request/ShortFormUploadRequest.java
  • apps/api-admin/src/main/java/com/ott/api_admin/shortform/dto/response/ShortFormUpdateResponse.java
  • apps/api-admin/src/main/java/com/ott/api_admin/shortform/mapper/BackOfficeShortFormMapper.java
  • apps/api-admin/src/main/java/com/ott/api_admin/shortform/service/BackOfficeShortFormService.java
  • apps/api-admin/src/main/java/com/ott/api_admin/upload/support/UploadHelper.java
  • modules/domain/src/main/java/com/ott/domain/contents/domain/Contents.java
  • modules/domain/src/main/java/com/ott/domain/short_form/domain/ShortForm.java
💤 Files with no reviewable changes (1)
  • apps/api-admin/src/main/java/com/ott/api_admin/shortform/dto/request/ShortFormUploadRequest.java

@arlen02-01 arlen02-01 merged commit a87bd11 into develop Mar 9, 2026
1 check passed
@phonil phonil deleted the OT-156-feature/update-api branch April 4, 2026 09:38
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.

2 participants