|
@@ -11,7 +11,7 @@ using UnityEngine.Networking;
|
|
|
public interface IUpOrDownloadService : IService
|
|
|
{
|
|
|
List<ScenePosRotInfo> PosRot { get; }
|
|
|
- void GetScenePosRot(string Url,int projectID);
|
|
|
+ void GetScenePosRot(int projectID);
|
|
|
void UploadScenePosRot(string Url, string JsonString);
|
|
|
}
|
|
|
|
|
@@ -19,25 +19,26 @@ public class UpOrDownloadService : IUpOrDownloadService
|
|
|
{
|
|
|
public List<ScenePosRotInfo> PosRot { get; private set; }
|
|
|
public int ProjectID { get; private set; }
|
|
|
+ private string UrlPointCloudPosRot;
|
|
|
|
|
|
public void OnInit()
|
|
|
{
|
|
|
-
|
|
|
+ UrlPointCloudPosRot = "https://api-fat1.ghz-tech.com/mr-navigator/v1/project/position";
|
|
|
}
|
|
|
|
|
|
- void IUpOrDownloadService.GetScenePosRot(string Url,int projectID)
|
|
|
+ void IUpOrDownloadService.GetScenePosRot(int projectID)
|
|
|
{
|
|
|
- RootSystem.Instance.StartCoroutine(GetScenePosRotRequest(Url,projectID));
|
|
|
+ CoroutineSystem.Instance.StartCoroutine(GetScenePosRotRequest(projectID));
|
|
|
}
|
|
|
|
|
|
void IUpOrDownloadService.UploadScenePosRot(string Url, string JsonString)
|
|
|
{
|
|
|
- RootSystem.Instance.StartCoroutine(RequestUpload(Url,JsonString));
|
|
|
+ CoroutineSystem.Instance.StartCoroutine(RequestUpload(Url,JsonString));
|
|
|
}
|
|
|
|
|
|
- private IEnumerator GetScenePosRotRequest(string Url,int projectID)
|
|
|
+ private IEnumerator GetScenePosRotRequest(int projectID)
|
|
|
{
|
|
|
- using (UnityWebRequest webRequest = new UnityWebRequest(Url, "POST"))
|
|
|
+ using (UnityWebRequest webRequest = new UnityWebRequest(UrlPointCloudPosRot, "POST"))
|
|
|
{
|
|
|
ProjectID = projectID;
|
|
|
ScenePointBodyInfo TestGet = new ScenePointBodyInfo();
|
|
@@ -86,7 +87,6 @@ public class UpOrDownloadService : IUpOrDownloadService
|
|
|
d2["position"] = data;
|
|
|
d2["id"] = ProjectID;
|
|
|
d2["unity"] = true;
|
|
|
- Debug.LogError("d2.ToJson():" + d2.ToJson());
|
|
|
byte[] bodyRaw = Encoding.UTF8.GetBytes(d2.ToJson());
|
|
|
|
|
|
webRequest.uploadHandler = (UploadHandler)new UploadHandlerRaw(bodyRaw);
|
|
@@ -107,11 +107,10 @@ public class UpOrDownloadService : IUpOrDownloadService
|
|
|
InstantiateCommand Command = new InstantiateCommand(
|
|
|
InstantiateSystem.Instance.BlueObject.WarningPopUp,
|
|
|
InstantiateSystem.Instance.BlueObject.NetErrorText);
|
|
|
- CommandExtensionSystem.Instance.Send(Command);
|
|
|
+ CommandSystem.Instance.Send(Command);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- Debug.LogError(webRequest.downloadHandler.text);
|
|
|
if (!string.IsNullOrWhiteSpace(webRequest.downloadHandler.text))
|
|
|
{
|
|
|
string message = webRequest.downloadHandler.text;
|
|
@@ -129,7 +128,7 @@ public class UpOrDownloadService : IUpOrDownloadService
|
|
|
InstantiateCommand Command = new InstantiateCommand(
|
|
|
InstantiateSystem.Instance.BlueObject.WarningPopUp,
|
|
|
InstantiateSystem.Instance.BlueObject.SuccessText);
|
|
|
- CommandExtensionSystem.Instance.Send(Command);
|
|
|
+ CommandSystem.Instance.Send(Command);
|
|
|
}
|
|
|
}
|
|
|
}
|