-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 영상 청크 업로드 기능 구현 #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Claude finished @eric-jy-park's task —— View job 영상 청크 업로드 기능 구현 코드 리뷰리뷰 요약이번 PR은 영상 청크 업로드 기능을 구현한 작업입니다. 새로운 엔티티( 발견된 문제점UploadSession.java:30 - [issue:] UploadSession.java:48 - [issue:] UploadStatusChunkResponse.java:20 - [issue:] AttemptServiceImpl.java:135 - [suggestion:] 너무 긴 빌더 패턴 체인으로 가독성 저하 - 줄바꿈과 들여쓰기로 개선 필요 UploadSessionNotfoundException.java:1 - [issue:] 클래스명 오타 AttemptController.java:303 - [question:] 청크 업로드 메서드가 빈 응답만 반환 - 실제 업로드 로직 구현 계획이 있는지 확인 필요 Chunk.java:28 - [suggestion:] boolean 필드 |
|
Claude finished @eric-jy-park's task —— View job 영상 청크 업로드 기능 구현 코드 리뷰이번 PR은 영상 파일의 분할 업로드를 위한 청크 업로드 기능을 구현했습니다. 발견된 문제점UploadStatusChunkResponse.java:20 - [issue:] AttemptServiceImpl.java:135 - [suggestion:] 긴 빌더 패턴 체인으로 가독성 저하 - 줄바꿈과 들여쓰기 적용으로 가독성 개선 필요 AttemptController.java:302 - [question:] 청크 업로드 메서드가 빈 응답만 반환하고 실제 업로드 로직 없음 - 실제 청크 업로드 처리 로직 구현 계획 확인 필요 AttemptController.java:333 - [question:] 업로드 세션 마무리 메서드도 빈 응답만 반환 - 실제 파일 병합 및 완료 처리 로직 구현 계획 확인 필요 |
42d7bc8 to
cb0a568
Compare
|
Claude finished @eric-jy-park's task —— View job \uccad\ud06c \uc5c5\ub85c\ub4dc \uae30\ub2a5 \ucf54\ub4dc \ub9ac\ubdf0
\uc774\ubc88 PR\uc740 \ub300\uc6a9\ub7c9 \uc601\uc0c1 \ud30c\uc77c\uc758 \ubd84\ud560 \uc5c5\ub85c\ub4dc\ub97c \uc704\ud55c \uccad\ud06c \uc5c5\ub85c\ub4dc \uae30\ub2a5\uc744 \uad6c\ud604\ud588\uc2b5\ub2c8\ub2e4. \ubc1c\uacac\ub41c \ubb38\uc81c\uc810UploadStatusChunkResponse.java:20 - [issue:] AttemptServiceImpl.java:135 - [suggestion:] \uae34 \ube4c\ub354 \ud328\ud134 \uccb4\uc778\uc73c\ub85c \uac00\ub3c5\uc131 \uc800\ud558 - \uc904\ubc14\uafc8\uacfc \ub4e4\uc5ec\uc4f0\uae30 \uc801\uc6a9\uc73c\ub85c \uac00\ub3c5\uc131 \uac1c\uc120 \ud544\uc694 AttemptController.java:154 - [question:] \uccad\ud06c \uc5c5\ub85c\ub4dc \uba54\uc11c\ub4dc\uac00 \ube48 \uc751\ub2f5\ub9cc \ubc18\ud658\ud558\uace0 \uc2e4\uc81c \uc5c5\ub85c\ub4dc \ub85c\uc9c1 \uc5c6\uc74c - \uc2e4\uc81c \uccad\ud06c \uc5c5\ub85c\ub4dc \ucc98\ub9ac \ub85c\uc9c1 \uad6c\ud604 \uacc4\ud68d \ud655\uc778 \ud544\uc694 AttemptController.java:167 - [question:] \uc5c5\ub85c\ub4dc \uc138\uc158 \ub9c8\ubb34\ub9ac \uba54\uc11c\ub4dc\ub3c4 \ube48 \uc751\ub2f5\ub9cc \ubc18\ud658 - \uc2e4\uc81c \ud30c\uc77c \ubcd1\ud569 \ubc0f \uc644\ub8cc \ucc98\ub9ac \ub85c\uc9c1 \uad6c\ud604 \uacc4\ud68d \ud655\uc778 \ud544\uc694 |
|
Claude finished @eric-jy-park's task —— View job 청크 업로드 기능 코드 리뷰
이번 PR은 대용량 영상 파일의 분할 업로드를 위한 청크 업로드 기능을 구현했습니다. 발견된 문제점UploadSession.java:48 - [issue:] AttemptServiceImpl.java:161 - [suggestion:] 긴 빌더 패턴 체인으로 가독성 저하 - 줄바꿈과 들여쓰기 적용으로 가독성 개선 필요 AttemptController.java:167 - [question:] 업로드 세션 마무리 메서드가 빈 응답만 반환하고 실제 로직 없음 - 실제 파일 병합 및 완료 처리 로직 구현 계획 확인 필요 AttemptServiceImpl.java:233 - [question:] 청크 결합 기능이 주석으로만 표시되어 있고 실제 구현 없음 - 파일 병합 로직 구현 일정 확인 필요 |
|
Claude finished @eric-jy-park's task —— View job 청크 업로드 기능 코드 리뷰
이번 PR은 대용량 영상 파일의 분할 업로드를 위한 청크 업로드 기능을 구현했습니다. 발견된 문제점UploadSession.java:48 - [issue:] AttemptServiceImpl.java:200 - [suggestion:] 긴 빌더 패턴 체인으로 가독성 저하 - 줄바꿈과 들여쓰기 적용으로 가독성 개선 필요 AttemptController.java:167 - [question:] 업로드 세션 마무리 메서드가 빈 응답만 반환하고 실제 로직 없음 - 실제 파일 병합 및 완료 처리 로직 구현 계획 확인 필요 AttemptServiceImpl.java:272 - [question:] 청크 결합 기능이 주석으로만 표시되어 있고 실제 구현 없음 - 파일 병합 로직 구현 일정 확인 필요 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements video chunk upload functionality for route mission attempts, enabling users to upload large video files in chunks for better reliability and performance.
- Adds complete upload session and chunk management system with entities, repositories, and services
- Implements chunked video upload API endpoints for initializing sessions, uploading chunks, and finalizing uploads
- Creates comprehensive error handling for upload-related scenarios
Reviewed Changes
Copilot reviewed 22 out of 24 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| application.yaml | Changes Hibernate DDL mode from create to update |
| ErrorCode.java | Adds upload-related error codes |
| ErrorCategory.java | Adds UPLOAD_SESSION error category |
| UploadSession.java | Defines upload session entity with chunk management methods |
| Chunk.java | Defines chunk entity for individual file pieces |
| AttemptServiceImpl.java | Implements core upload logic including chunk storage and file combination |
| AttemptController.java | Adds REST endpoints for upload operations |
| UserMissionAttempt.java | Links attempts to upload sessions |
| try { | ||
| FileOutputStream fos = new FileOutputStream(finalFilePath.toFile()); | ||
| BufferedOutputStream bos = new BufferedOutputStream(fos); |
Copilot
AI
Aug 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resources are not properly closed. The FileOutputStream and BufferedOutputStream should be used within try-with-resources blocks to ensure they are closed even if an exception occurs.
| try { | |
| FileOutputStream fos = new FileOutputStream(finalFilePath.toFile()); | |
| BufferedOutputStream bos = new BufferedOutputStream(fos); | |
| try (FileOutputStream fos = new FileOutputStream(finalFilePath.toFile()); | |
| BufferedOutputStream bos = new BufferedOutputStream(fos)) { |
| byte[] chunkData = Files.readAllBytes(chunkPath); | ||
| bos.write(chunkData); | ||
| } | ||
| bos.flush(); |
Copilot
AI
Aug 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The flush() and close() operations are outside the try block but the streams are declared inside. This will cause compilation errors as the variables are not in scope.
|
|
||
| private final AttemptService attemptService; | ||
| private final RecommendationService recommendationService; | ||
| private final UploadSessionRepository uploadSessionRepository; |
Copilot
AI
Aug 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UploadSessionRepository is injected but never used in the controller. Controllers should delegate business logic to services rather than directly accessing repositories.
| private final UploadSessionRepository uploadSessionRepository; |
|
|
||
| chunkRepository.save(chunk); | ||
|
|
||
| uploadSession.getChunks().add(chunk); |
Copilot
AI
Aug 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modifying the chunks collection directly can cause issues with JPA entity state management. The addChunk() method defined in UploadSession should be used instead, or the relationship should be properly managed by setting both sides of the bidirectional relationship.
| uploadSession.getChunks().add(chunk); | |
| uploadSession.addChunk(chunk); |
| return this.chunks.stream().anyMatch(chunk -> chunk.getChunkIndex() == index); | ||
| } | ||
|
|
||
| public void addChunk(Chunk chunk) { |
Copilot
AI
Aug 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The addChunk method only sets one side of the bidirectional relationship. It should also call chunk.setUploadSession(this) to properly maintain the relationship integrity.
| public void addChunk(Chunk chunk) { | |
| public void addChunk(Chunk chunk) { | |
| chunk.setUploadSession(this); |
|
Claude finished @eric-jy-park's task —— View job 청크 업로드 기능 코드 리뷰
이번 PR은 대용량 영상 파일의 분할 업로드를 위한 청크 업로드 기능을 구현했습니다. 발견된 문제점UploadSession.java:48 - [issue:] AttemptServiceImpl.java:199 - [suggestion:] 긴 빌더 패턴 체인으로 가독성 저하 - 줄바꿈과 들여쓰기 적용으로 가독성 개선 필요 AttemptController.java:45 - [suggestion:] AttemptServiceImpl.java:278 - [question:] NCP 스토리지 업로드 로직이 주석으로만 표시되어 있고 실제 구현 없음 - 파일 업로드 로직 구현 일정 확인 필요 |
📌 PR 제목
📋 작업 내용
✅ 체크리스트
🚨 주의사항