using LitJson;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class HttpAction :Singleton<HttpAction>
{
    public string officeport
    {
        get
        {
            try
            {

                if (HttpSDKAction.Instance.jsonData != "")
                {
                    string pt = "pro";
                #if UNITY_EDITOR
                         pt = "dev";
                #endif
                    JsonData data = JsonMapper.ToObject(HttpSDKAction.Instance.jsonData);
                    if (data["unity"]["url"][pt] != null)
                    {
                        return data["unity"]["url"][pt]["officePort"].ToString();
                    }
                    else
                    {

                        return "1883";
                    }
                }
                else
                {

                    return "1883";
                }
            }
            catch
            {
                return "1883";

            }
        }
    }
    public string mqtturl
    {
        get
        {
            if (HttpSDKAction.Instance.officeSocket == "")
            {
                HttpSDKAction.Instance.officeSocket = "api-fat1.ghz-tech.com";
            }
            return HttpSDKAction.Instance.officeSocket;
        }
    }

    public string baseurl20
    {
        get
        {
            if (HttpSDKAction.Instance.loginUrl == "")
            {
                // HttpSDKAction.Instance.loginUrl = "https://api-fat2.ghz-tech.com/mr-navigator/v1";
               // HttpSDKAction.Instance.loginUrl = HttpSDKAction.Instance.managerUrl;
            }
            return HttpSDKAction.Instance.loginUrl;
        }
    }
    


    public  string baseurl
            {
        get
        {
            if (HttpSDKAction.Instance.loginUrl == "")
            {
                // HttpSDKAction.Instance.loginUrl = "https://api-fat2.ghz-tech.com/mr-navigator/v1";
              //  HttpSDKAction.Instance.loginUrl = HttpSDKAction.Instance.managerUrl;
            }
            return HttpSDKAction.Instance.loginUrl;
        }
    }

    //初始化场景
    public const string client_snInfo = "/client/snInfo";

    //public const string project_detail = "/project/detail";
    //初始化景点 
    public const string sn_init = "/sn/init";
    //下载
    public const string file_download = "/file/download";

    //获取资源 
    public const string material_init = "/material/init";

    //获取账号下场景id 
    public const string project_init = "/project/index";

    //保存景点位
    public const string viewpoint_update = "/viewpoint/update";

    //电量
    public const string sn_electricity = "/sn/electricity";

    //识别的景点
    public const string sn_viewpoint = "/sn/viewpoint";

    // 偏移角
    public const string refrence = "/project/unityReference";

    public const string pointcloud = "/project/pointcloudInfo";
}