package com.platform.modules.live.vo;

import java.util.Date;
import java.util.List;
import java.util.Set;

import com.platform.common.utils.DateUtils;
import com.platform.modules.live.constants.SceneConstants;
import com.platform.modules.live.entity.LiveSceneEntity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang.StringUtils;
import org.springframework.web.util.HtmlUtils;

/**
 * Created by TROY on 2019/1/19.
 */
@ApiModel(value = "现场对象")
public class SceneEntityVo {

	/** 数据ID **/
	@ApiModelProperty(value = "数据ID")
	private Integer id;
	/** 现场标题 **/
	@ApiModelProperty(value = "现场标题")
	private String title;
	//现场类型
	@ApiModelProperty(value = "现场类型")
	private Integer sceneType;
	@ApiModelProperty(hidden = true)
	private String sceneTypeStr;
	//标题图
	@ApiModelProperty(value = "标题图")
	private String titleImage;
	//视频地址
	@ApiModelProperty(value = "视频地址")
	private String videoUrl;
	//现场简介
	@ApiModelProperty(value = "现场简介")
	private String liveDesc;
	// 现场简介链接
	@ApiModelProperty(value = "现场简介链接")
	private String liveDescHref;
	//直播时间
	@ApiModelProperty(value = "直播时间")
	private Date liveStart;
	@ApiModelProperty(hidden = true)
	private String liveStartStr;
	//直播地点
	@ApiModelProperty(value = "直播地点")
	private String livePosition;
	//直播状态
	@ApiModelProperty(hidden = true)
	private Integer liveState;
	@ApiModelProperty(hidden = true)
	private String liveStateStr;
	//现场备注
	@ApiModelProperty(value = "现场备注")
	private String sceneMark;
	//现场状态
	@ApiModelProperty(hidden = true)
	private Integer sceneState;
	@ApiModelProperty(hidden = true)
	private String sceneStateStr;
	//导播状态
	@ApiModelProperty(hidden = true)
	private Integer directState;
	@ApiModelProperty(hidden = true)
	private Integer directStateStr;
	//现场唯一标识
	@ApiModelProperty(hidden = true)
	private String sceneSign;
	//创建时间
	@ApiModelProperty(value = "创建时间")
	private Date createDate;
	@ApiModelProperty(hidden = true)
	private String createDateStr;
	// 创建人
	@ApiModelProperty(value = "创建人")
	private Integer creatorId;
	// 创建人姓名
	@ApiModelProperty(hidden = true)
	private String creatorName;
	//直播记者
	@ApiModelProperty(value = "直播记者ID")
	private List<Integer> userIdList;
	//直播记者姓名
	@ApiModelProperty(value = "直播记者姓名")
	private List<String> userNameList;
	//原画RTMP路径
	@ApiModelProperty(hidden = true)
	private String originalRtmpUrl;
	//原画M3U8路径
	@ApiModelProperty(hidden = true)
	private String originalM3u8Url;
	//原画FLV路径
	@ApiModelProperty(hidden = true)
	private String originalFlvUrl;
	//总访问数
	@ApiModelProperty(value = "总访问数")
	private Integer views;
	//前端显示访问数
	@ApiModelProperty(value = "前端显示访问数")
	private Integer viewsShow;
	//总评论数
	@ApiModelProperty(value = "总评论数")
	private Integer comments;
	//前端显示评论数
	@ApiModelProperty(value = "前端显示评论数")
	private Integer commentsShow;
	@ApiModelProperty(value = "是否送审，0：不送审，1：送审")
	private Integer sendToCheck;
	@ApiModelProperty(value = "允许评论，0：不允许，1：允许")
	private Integer allowComment;
	@ApiModelProperty(value = "允许评论，0：不允许，1：允许")
	private Integer allowCommentShow;
	@ApiModelProperty(value = "导播台ID")
	private Integer caster;
	@ApiModelProperty(value = "导播台ID")
	private String casterId;
	@ApiModelProperty(value = "标题图显示")
	private String titleImageShow;
	@ApiModelProperty(value = "视频地址显示")
	private String videoUrlShow;
	//直播结束时间
	@ApiModelProperty(value = "直播结束时间")
	private Date liveEnd;

	@ApiModelProperty(value = "实际开始时间")
	private Date actualLiveStart;
	@ApiModelProperty(value = "实际结束时间")
	private Date actualLiveEnd;
	
	//是否置顶 0未置顶 1 置顶
	@ApiModelProperty(value = "是否置顶 0未置顶 1 置顶")
	private Integer isTop;
	//排序，数字越大，排序越靠前
	@ApiModelProperty(value = "排序，数字越大，排序越靠前")
	private Integer priority;
//	//审核人ID
//	@ApiModelProperty(value = "审核人ID")
//	private List<Integer> auditorIdList;
//	//审核人姓名
//	@ApiModelProperty(value = "审核人姓名")
//	private List<String> auditorNameList;
	//实际审核人Id
	@ApiModelProperty(value = "实际审核人Id")
	private Integer auditorId;
	//实际审核人姓名
	@ApiModelProperty(value = "实际审核人姓名")
	private String auditorName;
	//审核时间
	@ApiModelProperty(value = "审核时间")
	private Date auditDate;
	// wapurl
	@ApiModelProperty(hidden = true)
	private String wapUrl;
	//是否删除
	@ApiModelProperty(value = "是否删除")
	private Integer deleteFlag;
	//栏目名称（多选）
	@ApiModelProperty(value = "栏目名称（多选）")
	private String channelsName;
	//栏目ID
	@ApiModelProperty(value = "栏目ID")
	private List<Integer> channelIdList;
	//栏目名称
	@ApiModelProperty(value = "栏目名称;")
	private List<String> channelNameList;
	
	private Set<ReporterVo> reporterVos;

	private List<LiveReportVo> reportList;
	/**
	 * 租户ID
	 * */
	@ApiModelProperty(value = "租户ID")
	private Long tenantId;
	/**
	 * 机构名称
	 * */
	@ApiModelProperty(value = "机构名称")
	private String tenantName;

	/**
	 * 20210419_Matt
	 *
	 * 是否自动开关播，0：关闭；1：启用
	 * */
	@ApiModelProperty(value = "是否自动开关播，0：关闭；1：启用")
	private Integer isAutoLive;

	public SceneEntityVo() {

	}

	public SceneEntityVo(LiveSceneEntity entity) {
		if (null == entity) {
			return;
		}
		this.id = entity.getId();
		this.title = entity.getTitle();
		this.sceneType = entity.getSceneType();
		this.titleImage = entity.getTitleImage();
		this.videoUrl = entity.getVideoUrl();
		this.liveDesc = entity.getLiveDesc();
		// 20190530 TROY xss
		if (StringUtils.isNotBlank(entity.getLiveDescHref())) {
			this.liveDescHref = HtmlUtils.htmlUnescape(entity.getLiveDescHref());
		}
		this.liveStart = entity.getLiveStart();
		this.livePosition = entity.getLivePosition();
		this.liveState = entity.getLiveState();
		this.sceneMark = entity.getSceneMark();
		this.sceneState = entity.getSceneState();
		this.directState = entity.getDirectState();
		this.sceneSign = entity.getSceneSign();
		this.createDate = entity.getCreateDate();
		this.creatorId = entity.getCreatorId();
		this.views = entity.getViews();
		this.viewsShow = entity.getViewsShow();
		this.comments = entity.getComments();
		this.commentsShow = entity.getCommentsShow();
		this.liveEnd = entity.getLiveEnd();
		this.actualLiveEnd = entity.getActualLiveEnd();
		this.actualLiveStart = entity.getActualLiveStart();
		this.isTop = entity.getIsTop();
		this.priority = entity.getPriority();
		this.allowComment = entity.getAllowComment();
		this.caster = entity.getCasterId();
		this.auditorId = entity.getAuditorId();
		this.auditDate = entity.getAuditDate();
		this.deleteFlag = entity.getDeleteFlag();
		this.channelsName = entity.getChannelsName();
		this.channelIdList = entity.getChannelIdList();
		this.channelNameList = entity.getChannelNameList();

		// 现场类型
		if(null != entity.getSceneType()) {
			this.sceneTypeStr = SceneConstants.SceneType.getNameByKey(entity.getSceneType());
		}
		// 直播状态
		if (null!=entity.getLiveState()) {
			this.liveStateStr = SceneConstants.liveStates.get(entity.getLiveState());
		}
		//创建时间客户端呈现
		if (null!=entity.getCreateDate()) {
			this.createDateStr = DateUtils.format(entity.getCreateDate(), "yyyy年M月d日 H时m分");
		}
		//直播开始时间客户端呈现
		if (null!=entity.getLiveStart()) {
			this.liveStartStr = DateUtils.format(entity.getLiveStart(), "yyyy年M月d日 H时m分");
		}

		this.tenantId = entity.getTenantId();
		this.tenantName = entity.getTenantName();

		this.isAutoLive = entity.getIsAutoLive();
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Integer getSceneType() {
		return sceneType;
	}

	public void setSceneType(Integer sceneType) {
		this.sceneType = sceneType;
	}

	public String getSceneTypeStr() {
		return sceneTypeStr;
	}

	public void setSceneTypeStr(String sceneTypeStr) {
		this.sceneTypeStr = sceneTypeStr;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Integer getCreatorId() {
		return creatorId;
	}

	public void setCreatorId(Integer creatorId) {
		this.creatorId = creatorId;
	}

	public String getTitleImage() {
		return titleImage;
	}

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

	public String getVideoUrl() {
		return videoUrl;
	}

	public void setVideoUrl(String videoUrl) {
		this.videoUrl = videoUrl;
	}

	public String getLiveDesc() {
		return liveDesc;
	}

	public void setLiveDesc(String liveDesc) {
		this.liveDesc = liveDesc;
	}

	public Date getLiveStart() {
		return liveStart;
	}

	public void setLiveStart(Date liveStart) {
		this.liveStart = liveStart;
	}

	public String getLivePosition() {
		return livePosition;
	}

	public void setLivePosition(String livePosition) {
		this.livePosition = livePosition;
	}

	public Integer getLiveState() {
		return liveState;
	}

	public void setLiveState(Integer liveState) {
		this.liveState = liveState;
	}

	public String getLiveStateStr() {
		return liveStateStr;
	}

	public void setLiveStateStr(String liveStateStr) {
		this.liveStateStr = liveStateStr;
	}

	public String getSceneMark() {
		return sceneMark;
	}

	public void setSceneMark(String sceneMark) {
		this.sceneMark = sceneMark;
	}

	public Integer getSceneState() {
		return sceneState;
	}

	public void setSceneState(Integer sceneState) {
		this.sceneState = sceneState;
	}

	public String getSceneStateStr() {
		return sceneStateStr;
	}

	public void setSceneStateStr(String sceneStateStr) {
		this.sceneStateStr = sceneStateStr;
	}

	public Integer getDirectState() {
		return directState;
	}

	public void setDirectState(Integer directState) {
		this.directState = directState;
	}

	public Integer getDirectStateStr() {
		return directStateStr;
	}

	public void setDirectStateStr(Integer directStateStr) {
		this.directStateStr = directStateStr;
	}

	public String getSceneSign() {
		return sceneSign;
	}

	public void setSceneSign(String sceneSign) {
		this.sceneSign = sceneSign;
	}

	public List<Integer> getUserIdList() {
		return userIdList;
	}

	public void setUserIdList(List<Integer> userIdList) {
		this.userIdList = userIdList;
	}

	public List<String> getUserNameList() {
		return userNameList;
	}

	public void setUserNameList(List<String> userNameList) {
		this.userNameList = userNameList;
	}

	public String getOriginalRtmpUrl() {
		return originalRtmpUrl;
	}

	public void setOriginalRtmpUrl(String originalRtmpUrl) {
		this.originalRtmpUrl = originalRtmpUrl;
	}

	public String getOriginalM3u8Url() {
		return originalM3u8Url;
	}

	public void setOriginalM3u8Url(String originalM3u8Url) {
		this.originalM3u8Url = originalM3u8Url;
	}

	public String getOriginalFlvUrl() {
		return originalFlvUrl;
	}

	public void setOriginalFlvUrl(String originalFlvUrl) {
		this.originalFlvUrl = originalFlvUrl;
	}

	public String getCreatorName() {
		return creatorName;
	}

	public void setCreatorName(String creatorName) {
		this.creatorName = creatorName;
	}

	public String getLiveStartStr() {
		return liveStartStr;
	}

	public void setLiveStartStr(String liveStartStr) {
		this.liveStartStr = liveStartStr;
	}

	public String getCreateDateStr() {
		return createDateStr;
	}

	public void setCreateDateStr(String createDateStr) {
		this.createDateStr = createDateStr;
	}
	public Integer getViews() {
		return views;
	}

	public void setViews(Integer views) {
		this.views = views;
	}

	public Integer getViewsShow() {
		return viewsShow;
	}

	public void setViewsShow(Integer viewsShow) {
		this.viewsShow = viewsShow;
	}

	public Integer getComments() {
		return comments;
	}

	public void setComments(Integer comments) {
		this.comments = comments;
	}

	public Integer getCommentsShow() {
		return commentsShow;
	}

	public void setCommentsShow(Integer commentsShow) {
		this.commentsShow = commentsShow;
	}

	public Date getLiveEnd() {
		return liveEnd;
	}

	public void setLiveEnd(Date liveEnd) {
		this.liveEnd = liveEnd;
	}

	public Date getActualLiveStart() {
		return actualLiveStart;
	}

	public void setActualLiveStart(Date actualLiveStart) {
		this.actualLiveStart = actualLiveStart;
	}

	public Date getActualLiveEnd() {
		return actualLiveEnd;
	}

	public void setActualLiveEnd(Date actualLiveEnd) {
		this.actualLiveEnd = actualLiveEnd;
	}

	public Integer getSendToCheck() {
		return sendToCheck;
	}

	public void setSendToCheck(Integer sendToCheck) {
		this.sendToCheck = sendToCheck;
	}

	public List<LiveReportVo> getReportList() {
		return reportList;
	}

	public void setReportList(List<LiveReportVo> reportList) {
		this.reportList = reportList;
	}

	public Set<ReporterVo> getReporterVos() {
		return reporterVos;
	}

	public void setReporterVos(Set<ReporterVo> reporterVos) {
		this.reporterVos = reporterVos;
	}

	public Integer getIsTop() {
		return isTop;
	}

	public void setIsTop(Integer isTop) {
		this.isTop = isTop;
	}

	public Integer getPriority() {
		return priority;
	}

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

	public void setAllowComment(Integer allowComment) {
		this.allowComment = allowComment;
	}

	public Integer getAllowCommentShow() {
		return allowCommentShow;
	}

	public void setAllowCommentShow(Integer allowCommentShow) {
		this.allowCommentShow = allowCommentShow;
	}

	public Integer getCaster() {
		return caster;
	}

	public void setCaster(Integer caster) {
		this.caster = caster;
	}

	public String getCasterId() {
		return casterId;
	}

	public void setCasterId(String casterId) {
		this.casterId = casterId;
	}

	public String getTitleImageShow() {
		return titleImageShow;
	}

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

	public String getVideoUrlShow() {
		return videoUrlShow;
	}

	public void setVideoUrlShow(String videoUrlShow) {
		this.videoUrlShow = videoUrlShow;
	}
//
//	public List<Integer> getAuditorIdList() {
//		return auditorIdList;
//	}
//
//	public void setAuditorIdList(List<Integer> auditorIdList) {
//		this.auditorIdList = auditorIdList;
//	}
//
//	public List<String> getAuditorNameList() {
//		return auditorNameList;
//	}
//
//	public void setAuditorNameList(List<String> auditorNameList) {
//		this.auditorNameList = auditorNameList;
//	}

	public Integer getAuditorId() {
		return auditorId;
	}

	public void setAuditorId(Integer auditorId) {
		this.auditorId = auditorId;
	}

	public Date getAuditDate() {
		return auditDate;
	}

	public void setAuditDate(Date auditDate) {
		this.auditDate = auditDate;
	}

	public String getAuditorName() {
		return auditorName;
	}

	public void setAuditorName(String auditorName) {
		this.auditorName = auditorName;
	}

	public String getWapUrl() {
		return wapUrl;
	}

	public void setWapUrl(String wapUrl) {
		this.wapUrl = wapUrl;
	}

	public Integer getDeleteFlag() {
		return deleteFlag;
	}

	public void setDeleteFlag(Integer deleteFlag) {
		this.deleteFlag = deleteFlag;
	}

	public String getChannelsName() {
		return channelsName;
	}

	public void setChannelsName(String channelsName) {
		this.channelsName = channelsName;
	}

	public List<Integer> getChannelIdList() {
		return channelIdList;
	}

	public void setChannelIdList(List<Integer> channelIdList) {
		this.channelIdList = channelIdList;
	}

	public List<String> getChannelNameList() {
		return channelNameList;
	}

	public void setChannelNameList(List<String> channelNameList) {
		this.channelNameList = channelNameList;
	}

	public String getLiveDescHref() {
		return liveDescHref;
	}

	public void setLiveDescHref(String liveDescHref) {
		this.liveDescHref = liveDescHref;
	}

	public Long getTenantId() {
		return tenantId;
	}

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

	public String getTenantName() {
		return tenantName;
	}

	public void setTenantName(String tenantName) {
		this.tenantName = tenantName;
	}

	public Integer getIsAutoLive() {
		return isAutoLive;
	}

	public void setIsAutoLive(Integer isAutoLive) {
		this.isAutoLive = isAutoLive;
	}
}
