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

import cn.reghao.jutil.jdk.converter.DateTimeConverter;
import cn.reghao.tnb.user.api.dto.UserCard;
import lombok.Getter;
import lombok.Setter;

/**
 * @author reghao
 * @date 2023-01-31 12:04:50
 */
@Setter
@Getter
public class VideoRecordCard {
    private long id;
    private int currentTime;
    private String createAt;
    private String videoId;
    private String title;
    private String coverUrl;
    private int duration;
    private String publishAt;
    private UserCard user;

    public VideoRecordCard(VideoRecord videoRecord, UserCard user) {
        this.id = videoRecord.getCreateAt();
        this.currentTime = videoRecord.getCurrentTime();
        this.createAt = DateTimeConverter.format(videoRecord.getCreateAt());
        this.videoId = videoRecord.getVideoId();
        this.title = videoRecord.getTitle();
        this.coverUrl = videoRecord.getCoverUrl();
        this.duration = videoRecord.getDuration();
        this.publishAt = DateTimeConverter.format(videoRecord.getPublishAt());
        this.user = user;
    }
}
