Skip to content
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

비디오 업로드 예외처리 #164

Merged
merged 8 commits into from
Dec 1, 2023
Merged

Conversation

5tarry
Copy link
Collaborator

@5tarry 5tarry commented Nov 30, 2023

resolved: #163

작업 내용

  • videoId 체크 (ObjectId 타입인지 & 중복되지 않았는지)
  • 비디오 파일 업로드했는지 확인
  • 썸네일 파일 업로드 했는지 확인

@5tarry 5tarry added backend feat 새로운 기능 추가 labels Nov 30, 2023
@5tarry 5tarry added this to the Week 4 milestone Nov 30, 2023
@5tarry 5tarry requested a review from msjang4 November 30, 2023 09:18
@5tarry 5tarry self-assigned this Nov 30, 2023
msjang4
msjang4 previously approved these changes Nov 30, 2023
Copy link
Collaborator

@msjang4 msjang4 left a comment

Choose a reason for hiding this comment

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

고생하셨어요!

@@ -150,10 +154,20 @@ export class VideoService {
}

async uploadVideo(videoDto: VideoDto, uuid: string, videoId: string) {
if (!Types.ObjectId.isValid(videoId)) throw new VideoNotFoundException();
Copy link
Collaborator

Choose a reason for hiding this comment

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

비디오 업로드 시 비디오를 찾을 수 없는 오류는 조금 어색해보여요
id가 잘못된거니까 BadRequestFormat이 좋아보이는데 어떠신가요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

넵 좋아요~!

Comment on lines +69 to +72
/**
* 회원가입 시 프로필 이미지를 PUT하는 url 발급
*/
@Get('signup/presigned-url/profile')
Copy link
Collaborator

Choose a reason for hiding this comment

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

이렇게 프로필이미지 put presigned Url 발급을 나눈게 굉장히 좋은 거 같아요!
프로필 변경시 발급에서는 본인 Id만 발급가능하도록 할 수 있고, 회원가입시 발급에서는 DB에 없는 Id만 발급가능하게 해서 예외처리 할 수 있으니까요

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ㅎㅎㅎ

@msjang4 msjang4 self-requested a review December 1, 2023 14:09
[ErrorCode.ProfileUploadRequired]: '프로필 이미지를 먼저 업로드 해야합니다.',
[ErrorCode.ThumbnailUploadRequired]: '썸네일을 먼저 업로드 해야합니다.',
[ErrorCode.VideoUploadRequired]: '비디오를 먼저 업로드 해야합니다.',
[ErrorCode.BadRequestFormat]: '요청 형식이 잘못됨',
Copy link
Collaborator

@msjang4 msjang4 Dec 1, 2023

Choose a reason for hiding this comment

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

리뷰 반영 감사합니다! 👍

@msjang4 msjang4 merged commit 279e9dd into develop Dec 1, 2023
@5tarry 5tarry deleted the feat/presigned_url_exception branch December 8, 2023 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend feat 새로운 기능 추가
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Backend] 비디오 업로드 예외처리
2 participants