package com.slodon.b2b2c.vo.video;

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

import java.io.Serializable;
import java.util.List;

/**
 *
 * 封装推荐主题详情VO对象
 * @author wuxy
 */
@Data
public class ThemeDetailVO implements Serializable {

    private static final long serialVersionUID = -929435102673784087L;
    @ApiModelProperty("主题id")
    private Integer themeId;

    @ApiModelProperty("主题名称")
    private String themeName;

    @ApiModelProperty("排序:0-255,0表示最前")
    private Integer sort;

    @ApiModelProperty("是否显示0:不显示，1显示")
    private Integer isShow;

    @ApiModelProperty("绑定视频数量")
    private Integer videoNum;

    @ApiModelProperty("主题图片")
    private String image;

    @ApiModelProperty("主题图片")
    private String imageUrl;

    @ApiModelProperty("封面图，用于轮播")
    private String carouselImage;

    @ApiModelProperty("封面图，用于轮播")
    private String carouselImageUrl;

    @ApiModelProperty("标签id")
    private Integer labelId;

    @ApiModelProperty("标签名称")
    private String labelName;

    @ApiModelProperty("视频列表")
    private List<SelectVideoVO> videoList;

    public ThemeDetailVO(SvideoTheme svideoTheme) {
        this.themeId = svideoTheme.getThemeId();
        this.themeName = svideoTheme.getThemeName();
        this.sort = svideoTheme.getSort();
        this.isShow = svideoTheme.getIsShow();
        this.videoNum = svideoTheme.getVideoNum();
        this.image = svideoTheme.getImage();
        this.imageUrl = FileUrlUtil.getFileUrl(svideoTheme.getImage(), null);
        this.carouselImage = svideoTheme.getCarouselImage();
        this.carouselImageUrl = FileUrlUtil.getFileUrl(svideoTheme.getCarouselImage(), null);
        this.labelId = svideoTheme.getLabelId();
        this.labelName = svideoTheme.getLabelName();
    }

}
