package cn.reghao.tnb.content.app.vod.model.po;

import cn.reghao.jutil.jdk.web.db.BaseObject;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * @author reghao
 * @date 2024-12-07 15:16:57
 */
@NoArgsConstructor
@Setter
@Getter
public class VideoCategoryPost extends BaseObject<Integer> {
    @NotBlank
    private String videoId;
    @NotNull
    private Integer categoryPid;
    @NotNull
    private Integer categoryId;
    @NotNull
    private Integer duration;
    @NotNull
    private Boolean horizontal;
    @NotNull
    private Integer scope;
    @NotNull
    private LocalDateTime publishAt;
    @NotNull
    private Long publishBy;

    public VideoCategoryPost(VideoPost videoPost) {
        this.videoId = videoPost.getVideoId();
        this.categoryPid = videoPost.getCategoryPid();
        this.categoryId = videoPost.getCategoryId();
        this.duration = videoPost.getDuration();
        this.horizontal = videoPost.getHorizontal();
        this.scope = videoPost.getScope();
        this.publishAt = videoPost.getPublishAt();
        this.publishBy = videoPost.getPublishBy();
    }
}
