diff --git a/server/src/presigned-url/dto/profile-presigned-url-request.dto.ts b/server/src/presigned-url/dto/profile-presigned-url-request.dto.ts index 4b05228..0506dd5 100644 --- a/server/src/presigned-url/dto/profile-presigned-url-request.dto.ts +++ b/server/src/presigned-url/dto/profile-presigned-url-request.dto.ts @@ -1,12 +1,4 @@ -import { IsUUID } from 'class-validator'; - export class ProfilePresignedUrlRequestDto { - /** - * user uuid - */ - @IsUUID() - uuid: string; - /** * 프로필 이미지 확장자 * @example 'webp' diff --git a/server/src/presigned-url/presigned-url.controller.ts b/server/src/presigned-url/presigned-url.controller.ts index 76a4e90..dc55cf6 100644 --- a/server/src/presigned-url/presigned-url.controller.ts +++ b/server/src/presigned-url/presigned-url.controller.ts @@ -5,6 +5,7 @@ import { AuthGuard } from 'src/auth/auth.guard'; import { InvalidTokenException } from 'src/exceptions/invalid-token.exception'; import { TokenExpiredException } from 'src/exceptions/token-expired.exception'; import { ApiSuccessResponse } from 'src/decorators/api-succes-response'; +import { RequestUser, User } from 'src/decorators/request-user'; import { PresignedUrlService } from './presigned-url.service'; import { AdvertisementPresignedUrlRequestDto } from './dto/advertisement-presigned-url-request.dto'; import { ProfilePresignedUrlRequestDto } from './dto/profile-presigned-url-request.dto'; @@ -46,8 +47,14 @@ export class PresignedUrlController { '프로필 이미지를 업로드하는 url 발급 성공', PresignedUrlResponseDto, ) - putProfilePresignedUrl(@Query() query: ProfilePresignedUrlRequestDto) { - return this.presignedUrlService.putProfilePresignedUrl(query); + putProfilePresignedUrl( + @Query() query: ProfilePresignedUrlRequestDto, + @RequestUser() user: User, + ) { + return this.presignedUrlService.putProfilePresignedUrl( + user.id, + query.profileExtension, + ); } /** diff --git a/server/src/presigned-url/presigned-url.service.ts b/server/src/presigned-url/presigned-url.service.ts index 9a0a8c9..7d5012e 100644 --- a/server/src/presigned-url/presigned-url.service.ts +++ b/server/src/presigned-url/presigned-url.service.ts @@ -41,10 +41,10 @@ export class PresignedUrlService { return { advertisements }; } - async putProfilePresignedUrl({ - uuid, - profileExtension, - }): Promise { + async putProfilePresignedUrl( + uuid: string, + profileExtension: string, + ): Promise { const objectName = `${uuid}.${profileExtension}`; const presignedUrl = await createPresignedUrl( process.env.PROFILE_BUCKET, diff --git a/server/src/video/dto/video-rating.dto.ts b/server/src/video/dto/video-rating.dto.ts index a96fbfa..7caf858 100644 --- a/server/src/video/dto/video-rating.dto.ts +++ b/server/src/video/dto/video-rating.dto.ts @@ -6,7 +6,7 @@ export class VideoRatingDTO { * @example 2 */ @IsNumber() - @Min(1) + @Min(0) @Max(5) rating: number;