12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- using Blue;
- using LitJson;
- using Newtonsoft.Json;
- using Newtonsoft.Json.Linq;
- using UnityEngine;
- public class InspectionService : IInspectionService
- {
- public InspectionInfo InspectionInfo { get; private set; }
- public void OnInit()
- {
- }
- public void Get()
- {
- CoroutineSystem.Instance.StartCoroutine(
- HttpTool.Instance.SendHttp(HttpActionLang.inspection_begin, "", message =>
- {
- JObject jobject = JObject.Parse(message);
- if (jobject["code"].ToString() == "200" && !string.IsNullOrWhiteSpace(jobject["data"].ToString()))
- {
- Debug.LogError("data:" + jobject["data"].ToString());
- InspectionInfo = JsonConvert.DeserializeObject<InspectionInfo>(jobject["data"].ToString());
-
- }
- }));
- }
- public void Set(int ItemID,bool Normal,string Label,int InspectionId)
- {
- JsonData data = new JsonData();
- data["itemId"] = ItemID;
- data["normal"] = Normal;
- data["label"] = Label;
- data["inspectionId"] = InspectionId;
- CoroutineSystem.Instance.StartCoroutine(HttpTool.Instance.SendHttp(HttpActionLang.inspection_step, data.ToJson(), message =>
- {
- JObject jobject = JObject.Parse(message);
- if (jobject["code"].ToString() == "200" && !string.IsNullOrWhiteSpace(jobject["data"].ToString()))
- {
-
- }
- }));
- }
- }
|