package com.platform.modules.live.vo;

import com.platform.common.utils.DateUtils;
import com.platform.modules.live.entity.LiveSceneRecordEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Description:
 * Author:zj
 * Date:2019/2/21 11:12
 */
@Data
@NoArgsConstructor
public class LiveSceneRecordVo {

    private static SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    private Integer id;
    /**
     * 现场id
     */
    @ApiModelProperty(value = "现场id")
    private Integer sceneId;
    /**
     * 回顾名称
     */
    @ApiModelProperty(value = "回顾名称")
    private String recordName;
    /**
     * 标题图
     */
    @ApiModelProperty(value = "标题图")
    private String titleImage;
    /**
     * 视频时长
     */
    @ApiModelProperty(value = "地址")
    private String uri;
    /**
     * 视频时长
     */
    @ApiModelProperty(value = "视频时长")
    private Double duration;
    /**
     * 开始unix时间
     */
    @ApiModelProperty(value = "开始unix时间")
    private Integer startTime;
    /**
     * 结束unix时间
     */
    @ApiModelProperty(value = "结束unix时间")
    private Integer stopTime;

    @ApiModelProperty(value = "开始时间")
    private Date startDate;

    @ApiModelProperty(value = "结束时间")
    private Date endDate;
    /**
     *
     */
    @ApiModelProperty(value = "创建人id")
    private Integer creatorId;
    /**
     *
     */
    @ApiModelProperty(value = "创建时间")
    private Date createDate;
    /**
     *
     */
    @ApiModelProperty(value = "修改人id")
    private Integer lastUpdaterId;
    /**
     *
     */
    @ApiModelProperty(value = "修改时间")
    private Date lastUpdateDate;

    @ApiModelProperty(value = "创建人姓名")
    private String creatorName;

    @ApiModelProperty(value = "修改人姓名")
    private String lastUpdaterName;
    /**
     * 0:未审核；1：审核显示
     */
    @ApiModelProperty(value = "状态，0:未审核；1：审核显示")
    private Integer recordStatus;

    @ApiModelProperty(value = "排序，数字越大，排序越靠前")
    private Integer priority;
    @ApiModelProperty(value = "媒体信息id")
    private Integer mediaId;
    
    @ApiModelProperty(value = "标题图显示")
    private String titleImageShow;
    @ApiModelProperty(value="视频显示地址")
    private String uriShow;
    /**
     * 租户ID
     * */
    @ApiModelProperty(value = "租户ID")
    private Long tenantId;
    /**
     * 回顾类型，0：直播时移；1：m3u8；2：mp4；3.快速剪辑
     * */
    @ApiModelProperty(value = "回顾类型，0：直播时移；1：m3u8；2：mp4；3.快速剪辑")
    private Integer recordType;
    @ApiModelProperty(value = "转写语音文字后的文字")
    private String text;
    @ApiModelProperty(value = "是否转写语音文字，0：不转文字，1：转文字")
    private Integer isTxt;
    @ApiModelProperty(value = "语音转写文字状态，0：未转；1：转码成功；2：转码中")
    private Integer toTxtStatus;

    public LiveSceneRecordVo(LiveSceneRecordEntity entity) throws ParseException {
        this.id = entity.getId();
        this.createDate = entity.getCreateDate();
        this.creatorId = entity.getCreatorId();
        this.duration = entity.getDuration();
        this.lastUpdateDate = entity.getLastUpdateDate();
        this.lastUpdaterId = entity.getLastUpdatorId();
        this.recordName = entity.getRecordName();
        this.titleImage = entity.getTitleImage();
        this.recordStatus = entity.getRecordStatus();
        this.sceneId = entity.getSceneId();
        this.startTime = entity.getStartTime();
        this.stopTime = entity.getStopTime();
        this.uri = entity.getUri();
        this.startDate = DateUtils.unixTimeToDate(format, entity.getStartTime());
        this.endDate = DateUtils.unixTimeToDate(format, entity.getStopTime());
        this.priority = entity.getPriority();
        this.mediaId = entity.getMediaId();
        this.tenantId = entity.getTenantId();
        this.recordType = entity.getRecordType();
        this.text = entity.getText();
        this.isTxt = entity.getIsTxt();
        this.toTxtStatus = entity.getToTxtStatus();
    }
    
}
