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

import cn.reghao.jutil.jdk.db.BaseObject;
import cn.reghao.tnb.content.api.dto.spider.CrawledVideo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 视频数据统计
 *
 * @author reghao
 * @date 2022-01-22 21:15:33
 */
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Data
public class VideoStatistic extends BaseObject<Integer> {
    private String videoId;
    private Integer view;
    private Integer danmaku;
    private Integer comment;
    private Integer favorite;
    private Integer share;
    private Integer thumbUp;
    private Integer thumbDown;
    private Integer coin;

    public VideoStatistic(String videoId) {
        this.videoId = videoId;
        this.view = 0;
        this.danmaku = 0;
        this.comment = 0;
        this.favorite = 0;
        this.share = 0;
        this.thumbUp = 0;
        this.thumbDown = 0;
        this.coin = 0;
    }

    @Deprecated
    public VideoStatistic(CrawledVideo crawledVideo) {
        this.videoId = crawledVideo.getVideoId();
        this.view = crawledVideo.getView();
        this.danmaku = crawledVideo.getDanmaku();
        this.comment = crawledVideo.getComment();
        this.favorite = crawledVideo.getFavorite();
        this.share = crawledVideo.getShare();
        this.thumbUp = crawledVideo.getThumbUp();
        this.thumbDown = crawledVideo.getCoin();
        this.coin = crawledVideo.getCoin();
    }
}
