package com.platform.modules.foreign.entity;/**
 * Created by TROY on 2019/2/22.
 */

import com.platform.modules.live.entity.LiveSceneRecordEntity;
import com.platform.modules.plm.util.MaterialUtils;
import org.apache.commons.lang.StringUtils;

/**
 * @author TROY
 * @version V1.0
 * @ClassName: SceneStreamForeignEntity
 * @Description: TODO
 * @date 2019/2/22 11:48
 */
public class SceneStreamForeignEntity {

	private String name;
	private String coverUrl;
	private String playUrl;

	public SceneStreamForeignEntity() {

	}

	public SceneStreamForeignEntity(LiveSceneRecordEntity record, String domain) {
		if (record==null) {
			return;
		}
		this.name = record.getRecordName();
		this.coverUrl = StringUtils.isBlank(record.getTitleImage()) ? null : MaterialUtils.getMaterialUrl(record
				.getTitleImage(), domain);
		this.playUrl = StringUtils.isBlank(record.getUri()) ? null : (record.getUri().startsWith("http") ? record.getUri() : MaterialUtils.getMaterialUrl(record
				.getUri(), domain));
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCoverUrl() {
		return coverUrl;
	}

	public void setCoverUrl(String coverUrl) {
		this.coverUrl = coverUrl;
	}

	public String getPlayUrl() {
		return playUrl;
	}

	public void setPlayUrl(String playUrl) {
		this.playUrl = playUrl;
	}
}
