package com.mogo.cloud.tanlu.bean;

import android.text.TextUtils;

import com.mogo.cloud.tanlu.bean.location.MarkerLocationCloud;

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

/**
 * @author lixiaopeng
 * @description
 * @since 2021/1/20
 */
public class MarkerExploreWayCloud implements Serializable {
    private String infoId;
    private String type;//卡片类型,

    private String poiType;
    private String sn;
    private MarkerLocationCloud location;//位置信息
    private int direction;//方位角度
    private boolean canLive;//是否可直播（1为可直播，0不可直播）
    private int fileType;//是图片还是视频（1视频，0图片）
    private String addr;//北京市朝阳区三里屯街道108号
    private long generateTime;//时间戳
    private String cityName;//:"城市名称",
    private double distance;//距离
    private MarkerUserInfoCloud userInfo;//用户信息
    private List<MarkerExploreWayItemCloud> items;//视频地址和图片地址
    //上报类型：1-用户上报，2-后台上报 3-三方上报
    private String uploadType;

    private boolean fabulous;

    // http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=42321443
    // 1 需要用户判断是否拥堵 进行UGC问答
    private int infoCheckNode;

    public String getAddr() {
        if (TextUtils.isEmpty(addr)) {
            return "未知道路";
        }
        return addr;
    }

    public void setAddr(String addr) {
        this.addr = addr;
    }

    public boolean getCanLive() {
        return canLive;
    }

    public void setCanLive(boolean canLive) {
        this.canLive = canLive;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public float getDirection() {
        return direction;
    }

    public void setDirection(int direction) {
        this.direction = direction;
    }

    public double getDistance() {
        return distance;
    }

    public void setDistance(double distance) {
        this.distance = distance;
    }

    public double getFileType() {
        return fileType;
    }

    public void setFileType(int fileType) {
        this.fileType = fileType;
    }

    public Long getGenerateTime() {
        return generateTime;
    }

    public void setGenerateTime(Long generateTime) {
        this.generateTime = generateTime;
    }

    public List<MarkerExploreWayItemCloud> getItems() {
        return items;
    }

    public void setItems(List<MarkerExploreWayItemCloud> items) {
        this.items = items;
    }

    public MarkerLocationCloud getLocation() {
        return location;
    }

    public void setLocation(MarkerLocationCloud location) {
        this.location = location;
    }

    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public MarkerUserInfoCloud getUserInfo() {
        return userInfo;
    }

    public void setUserInfo(MarkerUserInfoCloud userInfo) {
        this.userInfo = userInfo;
    }

    public String getInfoId() {
        return infoId;
    }

    public int getInfoIdInt() {
        try {
            return Integer.parseInt(infoId);
        } catch (NumberFormatException e) {
            e.printStackTrace();
            return -1;
        }
    }

    public void setInfoId(String infoId) {
        this.infoId = infoId;
    }

    public String getPoiType() {
        if (TextUtils.isEmpty(poiType)) {
            return "10007"; //拥堵
        }
        return poiType;
    }

    public void setPoiType(String poiType) {
        this.poiType = poiType;
    }

    public String getUploadType() {
        return uploadType;
    }

    public void setUploadType(String uploadType) {
        this.uploadType = uploadType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MarkerExploreWayCloud that = (MarkerExploreWayCloud) o;
        return Objects.equals(infoId, that.infoId) &&
                Objects.equals(type, that.type) &&
                Objects.equals(poiType, that.poiType);
    }

    @Override
    public int hashCode() {
        return Objects.hash(infoId, type, poiType);
    }

    public boolean isCanLive() {
        return canLive;
    }

    public void setGenerateTime(long generateTime) {
        this.generateTime = generateTime;
    }

    public int getInfoCheckNode() {
        return infoCheckNode;
    }

    public void setInfoCheckNode(int infoCheckNode) {
        this.infoCheckNode = infoCheckNode;
    }

    public boolean isFabulous() {
        return fabulous;
    }

    public void setFabulous(boolean fabulous) {
        this.fabulous = fabulous;
    }

    @Override
    public String toString() {
        return "MarkerExploreWay{" +
                "infoId='" + infoId + '\'' +
                ", type='" + type + '\'' +
                ", poiType='" + poiType + '\'' +
                ", sn='" + sn + '\'' +
                ", location=" + location +
                ", direction=" + direction +
                ", canLive=" + canLive +
                ", fileType=" + fileType +
                ", addr='" + addr + '\'' +
                ", generateTime=" + generateTime +
                ", cityName='" + cityName + '\'' +
                ", distance=" + distance +
                ", userInfo=" + userInfo +
                ", items=" + items +
                ", uploadType='" + uploadType + '\'' +
                ", fabulous=" + fabulous +
                ", infoCheckNode=" + infoCheckNode +
                '}';
    }

}
