[REFACTOR]: 수정 API DTO 정책 반영 및 업로드 헬퍼 정리#129
Conversation
Walkthrough미디어 업로드 흐름에서 미디어 관련 필드 및 메타데이터를 제거하고, 이미지 기반 업데이트로 전환하는 리팩토링입니다. 요청/응답 DTO, 매퍼, 서비스, 도메인 엔티티, 업로드 헬퍼에서 originFileName, duration, videoSize, MediaUpdateUploadResult 등을 제거했습니다. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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. Comment |
There was a problem hiding this comment.
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-71의updateImageKeys(...)는 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-273는prepareImageUpdate(..., 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
📒 Files selected for processing (12)
apps/api-admin/src/main/java/com/ott/api_admin/content/dto/request/ContentsUpdateRequest.javaapps/api-admin/src/main/java/com/ott/api_admin/content/dto/response/ContentsUpdateResponse.javaapps/api-admin/src/main/java/com/ott/api_admin/content/mapper/BackOfficeContentsMapper.javaapps/api-admin/src/main/java/com/ott/api_admin/content/service/BackOfficeContentsService.javaapps/api-admin/src/main/java/com/ott/api_admin/shortform/dto/request/ShortFormUpdateRequest.javaapps/api-admin/src/main/java/com/ott/api_admin/shortform/dto/request/ShortFormUploadRequest.javaapps/api-admin/src/main/java/com/ott/api_admin/shortform/dto/response/ShortFormUpdateResponse.javaapps/api-admin/src/main/java/com/ott/api_admin/shortform/mapper/BackOfficeShortFormMapper.javaapps/api-admin/src/main/java/com/ott/api_admin/shortform/service/BackOfficeShortFormService.javaapps/api-admin/src/main/java/com/ott/api_admin/upload/support/UploadHelper.javamodules/domain/src/main/java/com/ott/domain/contents/domain/Contents.javamodules/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
📝 작업 내용
☑️ 체크 리스트
#️⃣ 연관된 이슈
💬 리뷰 요구사항
Summary by CodeRabbit
릴리스 노트