package com.platform.modules.live.vo;

import com.platform.modules.live.constants.SceneConstants;
import com.platform.modules.live.entity.LiveSceneLiveInfoEntity;
import com.platform.modules.live.entity.LiveSceneLiveInfoExtEntity;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.NotBlank;

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


/**
 * 现场直播信息表
 *
 * @author TROY
 * @email
 * @date 2019-01-19 14:50:50
 */
public class LiveInfoVo {

	//数据ID
	private Integer id;
	//现场ID
	private Integer sceneId;
	//人员ID
	private Integer userId;
	//人员姓名
	private String userName;
	//推流地址
	private String pushUrl;
	//推流状态
	private Integer pushState;
	private String pushStateStr;
	//RMTP播流地址
	private String playUrlRmtp;
	//HLS播流地址
	private String playUrlHls;
	//FLV播流地址
	private String playUrlFlv;
	//推流有效期至
	private Date validityDate;
	/**
	 * 名称
	 */
	private String infoName;
	/**
	 * 流类型,1:手机，2：摄像机
	 */
	private String infoTypeName;


	private String pushDomain;
	/**
	 *
	 */
	private String liveDomain;
	/**
	 *
	 */
	private String appName;
	/**
	 *
	 */
	private String streamName;

	private String titleImage;

	private Integer isDefault;

	private Integer isShow;

	private Integer priority;
	
	@ApiModelProperty(value = "标题图显示")
	private String titleImageShow;

	/**
	 * 推流开始时间
	 */
	@ApiModelProperty(value = "推流开始时间")
	private Date pushStart;
	/**
	 * 推流结束时间
	 */
	@ApiModelProperty(value = " 推流结束时间")
	private Date pushEnd;
	/**
	 * 租户ID
	 * */
	private Long tenantId;
	/**
	 * 是否转写文字
	 * */
	private Integer isTxt;
	//拉流开始时间
	private Date pullStart;
	
	//拉流结束时间
	private Date pullEnd;
	//拉流地址
	private String pullUrl;

	public LiveInfoVo() {

	}

	public LiveInfoVo(LiveSceneLiveInfoEntity entity) {
		if (null == entity) {
			return;
		}
		this.id = entity.getId();
		this.sceneId = entity.getSceneId();
		this.userId = entity.getUserId();
		this.pushState = entity.getPushState();
		this.infoName = entity.getInfoName();
		this.infoTypeName = SceneConstants.InfoTypeEnum.getNameByType(entity.getInfoType());
		this.appName = entity.getAppName();
		this.streamName = entity.getStreamName();
		this.pushDomain = entity.getPushDomain();
		this.liveDomain = entity.getLiveDomain();
		this.titleImage = entity.getTitleImage();
		this.isDefault = entity.getIsDefault();
		this.isShow = entity.getIsShow();
		this.priority = entity.getPriority();
		this.pushStart = entity.getPushStart();
		this.pushEnd = entity.getPushEnd();
		if (entity.getExtEntity() != null) {
			LiveSceneLiveInfoExtEntity extEntity = entity.getExtEntity();
			this.pushUrl = extEntity.getPushUrl();
			this.playUrlRmtp = extEntity.getPlayUrlRmtp();
			this.playUrlHls = extEntity.getPlayUrlHls();
			this.playUrlFlv = extEntity.getPlayUrlFlv();
			
			String endStr = this.pushUrl.substring(this.pushUrl.indexOf("=")+1, this.pushUrl.indexOf("-"));
			this.validityDate = new Date(Long.parseLong(endStr+"000"));
			this.pullUrl = extEntity.getPullUrl();
		}
		this.tenantId = entity.getTenantId();
		this.isTxt = entity.getIsTxt();
		this.pullStart = entity.getPullStart();
		this.pullEnd = entity.getPullEnd();
	}

	/**
	 * 设置：数据ID
	 */
	public void setId(Integer id) {
		this.id = id;
	}
	/**
	 * 获取：数据ID
	 */
	public Integer getId() {
		return id;
	}
	/**
	 * 设置：现场ID
	 */
	public void setSceneId(Integer sceneId) {
		this.sceneId = sceneId;
	}
	/**
	 * 获取：现场ID
	 */
	public Integer getSceneId() {
		return sceneId;
	}
	/**
	 * 设置：人员ID
	 */
	public void setUserId(Integer userId) {
		this.userId = userId;
	}
	/**
	 * 获取：人员ID
	 */
	public Integer getUserId() {
		return userId;
	}
	/**
	 * 设置：推流地址
	 */
	public void setPushUrl(String pushUrl) {
		this.pushUrl = pushUrl;
	}
	/**
	 * 获取：推流地址
	 */
	public String getPushUrl() {
		return pushUrl;
	}
	/**
	 * 设置：推流状态
	 */
	public void setPushState(Integer pushState) {
		this.pushState = pushState;
	}
	/**
	 * 获取：推流状态
	 */
	public Integer getPushState() {
		return pushState;
	}
	/**
	 * 设置：RMTP播流地址
	 */
	public void setPlayUrlRmtp(String playUrlRmtp) {
		this.playUrlRmtp = playUrlRmtp;
	}
	/**
	 * 获取：RMTP播流地址
	 */
	public String getPlayUrlRmtp() {
		return playUrlRmtp;
	}
	/**
	 * 设置：HLS播流地址
	 */
	public void setPlayUrlHls(String playUrlHls) {
		this.playUrlHls = playUrlHls;
	}
	/**
	 * 获取：HLS播流地址
	 */
	public String getPlayUrlHls() {
		return playUrlHls;
	}
	/**
	 * 设置：FLV播流地址
	 */
	public void setPlayUrlFlv(String playUrlFlv) {
		this.playUrlFlv = playUrlFlv;
	}
	/**
	 * 获取：FLV播流地址
	 */
	public String getPlayUrlFlv() {
		return playUrlFlv;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPushStateStr() {
		return pushStateStr;
	}

	public void setPushStateStr(String pushStateStr) {
		this.pushStateStr = pushStateStr;
	}

	public String getInfoName() {
		return infoName;
	}

	public void setInfoName(String infoName) {
		this.infoName = infoName;
	}

	public String getInfoTypeName() {
		return infoTypeName;
	}

	public void setInfoTypeName(String infoTypeName) {
		this.infoTypeName = infoTypeName;
	}

	public String getPushDomain() {
		return pushDomain;
	}

	public void setPushDomain(String pushDomain) {
		this.pushDomain = pushDomain;
	}

	public String getLiveDomain() {
		return liveDomain;
	}

	public void setLiveDomain(String liveDomain) {
		this.liveDomain = liveDomain;
	}

	public String getAppName() {
		return appName;
	}

	public void setAppName(String appName) {
		this.appName = appName;
	}

	public String getStreamName() {
		return streamName;
	}

	public void setStreamName(String streamName) {
		this.streamName = streamName;
	}

	public String getTitleImage() {
		return titleImage;
	}

	public void setTitleImage(String titleImage) {
		this.titleImage = titleImage;
	}

	public Integer getIsDefault() {
		return isDefault;
	}

	public void setIsDefault(Integer isDefault) {
		this.isDefault = isDefault;
	}

    public Integer getIsShow() {
        return isShow;
    }

    public void setIsShow(Integer isShow) {
        this.isShow = isShow;
    }

	public Date getPushStart() {
		return pushStart;
	}

	public void setPushStart(Date pushStart) {
		this.pushStart = pushStart;
	}

	public Date getPushEnd() {
		return pushEnd;
	}

	public void setPushEnd(Date pushEnd) {
		this.pushEnd = pushEnd;
	}

	public Integer getPriority() {
		return priority;
	}

	public void setPriority(Integer priority) {
		this.priority = priority;
	}

	public String getTitleImageShow() {
		return titleImageShow;
	}

	public void setTitleImageShow(String titleImageShow) {
		this.titleImageShow = titleImageShow;
	}

	public Long getTenantId() {
		return tenantId;
	}

	public void setTenantId(Long tenantId) {
		this.tenantId = tenantId;
	}

	public Date getValidityDate() {
		return validityDate;
	}

	public void setValidityDate(Date validityDate) {
		this.validityDate = validityDate;
	}

	public Integer getIsTxt() {
		return isTxt;
	}

	public void setIsTxt(Integer isTxt) {
		this.isTxt = isTxt;
	}

	public Date getPullStart() {
		return pullStart;
	}

	public void setPullStart(Date pullStart) {
		this.pullStart = pullStart;
	}

	public Date getPullEnd() {
		return pullEnd;
	}

	public void setPullEnd(Date pullEnd) {
		this.pullEnd = pullEnd;
	}

	public String getPullUrl() {
		return pullUrl;
	}

	public void setPullUrl(String pullUrl) {
		this.pullUrl = pullUrl;
	}
}
