package com.slodon.b2b2c.vo.video;

import com.slodon.b2b2c.core.util.FileUrlUtil;
import com.slodon.b2b2c.core.util.StringUtil;
import com.slodon.b2b2c.video.pojo.SvideoVideo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 *
 * 封装我的视频-喜欢VO对象
 * @author wuxy
 */
@Data
public class VideoLikeVO implements Serializable {

    private static final long serialVersionUID = 6239459544474380643L;
    @ApiModelProperty("视频id")
    private Integer videoId;

    @ApiModelProperty("视频名称")
    private String videoName;

    @ApiModelProperty("视频地址")
    private String videoPath;

    @ApiModelProperty("封面图地址")
    private String videoImage;

    @ApiModelProperty("作者id")
    private Integer authorId;

    @ApiModelProperty("点赞数")
    private Integer likeNum;

    @ApiModelProperty("点击数")
    private Integer clickNum;

    @ApiModelProperty("视频类型:1-视频;2-图文")
    private Integer videoType;

    public VideoLikeVO(SvideoVideo svideoVideo) {
        this.videoId = svideoVideo.getVideoId();
        this.videoName = svideoVideo.getVideoName();
        this.videoPath = FileUrlUtil.getFileUrl(svideoVideo.getVideoPath(), null);
        this.videoImage = StringUtil.isEmpty(svideoVideo.getVideoThemeImage()) ? FileUrlUtil.getFileUrl(svideoVideo.getVideoImage(), null)
                : FileUrlUtil.getFileUrl(svideoVideo.getVideoThemeImage(), null);
        this.authorId = svideoVideo.getAuthorId();
        this.likeNum = svideoVideo.getLikeNum();
        this.clickNum = svideoVideo.getClickNum();
        this.videoType = svideoVideo.getVideoType();
    }
}
