package cn.reghao.tnb.content.api.dto;

import cn.reghao.tnb.user.api.dto.UserCard;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

/**
 * @author reghao
 * @date 2023-04-24 03:07:22
 */
@Setter
@Getter
public class VideoCard implements Serializable {
    private static final long serialVersionUID = 1L;

    private String videoId;
    private String title;
    private String coverUrl;
    private String duration;
    private boolean horizontal;
    private boolean cached;
    private String pubDateStr;
    private UserCard user;
    private int view;
    private int comment;

    public VideoCard(VideoPostCard videoPostCard, String durationStr, boolean cached, String pubDateStr, UserCard user) {
        this.videoId = videoPostCard.getVideoId();
        this.title = videoPostCard.getTitle();
        this.coverUrl = videoPostCard.getCoverUrl();
        this.duration = durationStr;
        this.horizontal = videoPostCard.isHorizontal();
        this.cached = cached;
        this.pubDateStr = pubDateStr;
        this.user = user;
        this.view = videoPostCard.getView();
        this.comment = videoPostCard.getComment();
    }
}
