Skip to content

Commit

Permalink
feat: 동영상 썸네일 필드 추가
Browse files Browse the repository at this point in the history
- dto 또한 썸네일 필드 추가
  • Loading branch information
SJ70 committed Aug 14, 2024
1 parent 94e3917 commit 1f71f59
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/main/java/com/j9/bestmoments/domain/Video.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class Video {
@Id
private UUID id;
private String videoUrl;
private String thumbnailUrl;
private String title;
@Lob
private String description;
Expand Down Expand Up @@ -88,4 +89,8 @@ public void setVideoUrl(String videoUrl) {
this.videoUrl = videoUrl;
}

public void setThumbnailUrl(String thumbnailUrl) {
this.thumbnailUrl = thumbnailUrl;
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.j9.bestmoments.dto.request;

import com.j9.bestmoments.domain.VideoStatus;
import com.j9.bestmoments.validator.ImageTypeCheck;
import com.j9.bestmoments.validator.VideoTypeCheck;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
Expand All @@ -12,6 +13,9 @@ public record VideoCreateDto(
@VideoTypeCheck
MultipartFile video,

@ImageTypeCheck
MultipartFile thumbnail,

@NotNull
@NotBlank
@Size(max = 100, message = "제목은 100자 이내로 입력해주세요.")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
package com.j9.bestmoments.dto.request;

import com.j9.bestmoments.domain.VideoStatus;
import com.j9.bestmoments.validator.ImageTypeCheck;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import org.springframework.web.multipart.MultipartFile;

public record VideoUpdateDto(

@ImageTypeCheck
MultipartFile thumbnail,

@NotNull
@NotBlank
@Size(max = 100, message = "제목은 100자 이내로 입력해주세요.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

public record VideoFindDto(
UUID id,
String fileUrl,
String videoUrl,
String thumbnailUrl,
String title,
String description,
UUID uploaderId,
Expand All @@ -20,6 +21,7 @@ public static VideoFindDto of (Video video) {
return new VideoFindDto(
video.getId(),
video.getVideoUrl(),
video.getThumbnailUrl(),
video.getTitle(),
video.getDescription(),
video.getUploader().getId(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

public record VideoPreviewDto (
UUID id,
String thumbnailUrl,
String title,
String description,
UUID uploaderId,
Expand All @@ -17,6 +18,7 @@ public record VideoPreviewDto (
public static VideoPreviewDto of (Video video) {
return new VideoPreviewDto(
video.getId(),
video.getThumbnailUrl(),
video.getTitle(),
video.getDescription(),
video.getUploader().getId(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

public record VideoPreviewMoreDto(
UUID id,
String thumbnailUrl,
String title,
UUID uploaderId,
LocalDateTime createdAt,
Expand All @@ -17,6 +18,7 @@ public record VideoPreviewMoreDto(
public static VideoPreviewMoreDto of (Video video) {
return new VideoPreviewMoreDto(
video.getId(),
video.getThumbnailUrl(),
video.getTitle(),
video.getUploader().getId(),
video.getCreatedAt(),
Expand Down

0 comments on commit 1f71f59

Please sign in to comment.