diff --git a/xiaofang/Assets/Script/DirllInterface.meta b/xiaofang/Assets/Script/DirllInterface.meta new file mode 100644 index 00000000..97c0e532 --- /dev/null +++ b/xiaofang/Assets/Script/DirllInterface.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 889b64a600f8c5a4a805956401d12ff6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/xiaofang/Assets/Script/DirllInterface/createTemplate.cs b/xiaofang/Assets/Script/DirllInterface/createTemplate.cs new file mode 100644 index 00000000..cb40038d --- /dev/null +++ b/xiaofang/Assets/Script/DirllInterface/createTemplate.cs @@ -0,0 +1,63 @@ +using System.Collections; +using System.Collections.Generic; +using System.Threading.Tasks; +using Newtonsoft.Json; +using UnityEngine; + +public class createTemplateInterface : MonoBehaviour +{ + //新建模板 + public async Task createTemplate() + { + auth_createTemplate CreateTemplateBody = new auth_createTemplate(); + CreateTemplateBody.templateName="模板名称"; + string response = await web.SendRequest(web.URL + "/auth/login", "POST", JsonUtility.ToJson(CreateTemplateBody)); + //string body = "{\"templateName\": \"11111\",\"sceneId\": \"11111\",\"subjectId\": \"111\",\"isTemplate\": \"111\",\"mode\": \"111\",\"playerList\": [{\"userId\": \"111\",\"roleId\": \"1111\",\"birthAreaId\": \"111\",\"chargeAreaId\": \"111\"}],\"npcList\": [{\"npcId\": \"111\",\"areaId\": \"111\",\"npcNum\": 0}],\"materialList\": [{\"materialId\": \"111\",\"num\": 0}]}"; + //string response = await web.SendRequest(web.URL + "/game/gameTemplate/add", "POST", body, CreateHeaders()); + Debug.Log("新建模板列表" + response); + // 解析服务器返回的数据 + newTemplateData newTemplateData = JsonConvert.DeserializeObject(response); + Debug.Log(newTemplateData.data); + return newTemplateData; + } +} +//====新建模板请求体========================== +public class auth_createTemplate +{ + public string templateName;//模板名称 + public string sceneId;//场景编号-----------------------------必须(没有必须就是可选) + public string subjectId;//科目编号---------------------------必须 + public string isTemplate;//是否保存为模板 + public string mode;//模式 + public List playerList;//玩家列表 + public List npcList;//NPC列表 + public List materialList;//设备器材列表 +} + +public class PlayerList//玩家列表 +{ + public string userId;//用户编号------------------------------必须 + public string roleId;//角色编号------------------------------必须 + public string birthAreaId;//出生区域编号---------------------必须 + public string chargeAreaId;//负责区域编号--------------------必须 +} +public class NpcList//NPC列表 +{ + public string userId;//NPC编号-------------------------------必须 + public string roleId;//区域编号------------------------------必须 + public int birthAreaId;//数量--------------------------------必须 +} +public class MaterialList//设备器材列表 +{ + public string materialId;//设备器材编号----------------------必须 + public int num;//数量 +} + + + +//===返回值====================================== + +public class newTemplateData : Response +{ + public string data;//空 +} \ No newline at end of file diff --git a/xiaofang/Assets/Script/DirllInterface/createTemplate.cs.meta b/xiaofang/Assets/Script/DirllInterface/createTemplate.cs.meta new file mode 100644 index 00000000..8fc9e493 --- /dev/null +++ b/xiaofang/Assets/Script/DirllInterface/createTemplate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ec15685532562834f86746af6ec16907 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/xiaofang/Assets/Script/DirllInterface/getTemplateList.cs b/xiaofang/Assets/Script/DirllInterface/getTemplateList.cs new file mode 100644 index 00000000..da167fda --- /dev/null +++ b/xiaofang/Assets/Script/DirllInterface/getTemplateList.cs @@ -0,0 +1,43 @@ +using Newtonsoft.Json; +using System.Collections; +using System.Collections.Generic; +using Unity.VisualScripting.Antlr3.Runtime; +using UnityEditor.PackageManager; +using UnityEngine; + +public class getTemplateList : MonoBehaviour +{ + + // 创建请求头,使用最新的 token + public Dictionary CreateHeaders() + { + + + if (string.IsNullOrEmpty(Global.global.loginResponse.data.access_token)) + { + Debug.LogWarning("尝试创建请求头时,token 未设置。"); + return new Dictionary(); + } + + return new Dictionary + { + { "Authorization","Bearer "+Global.global.loginResponse.data.access_token }, + {"clientId", "e5cd7e4891bf95d1d19206ce24a7b32e" } + }; + } + //获取模板列表 + public async void TemplaRst() + { + string response = await web.SendRequest(web.URL + "/game/gameTemplate/list", "GET", "", CreateHeaders()); + Debug.Log("获取模板列表" + response); + //解析服务器返回的数据 + TemplateListData templateListData = JsonConvert.DeserializeObject(response); + Debug.Log("================" + templateListData.msg); + } +} +//======================================================================================================= +public class TemplateListData : Response +{ + public string[] data; +} +//================= \ No newline at end of file diff --git a/xiaofang/Assets/Script/DirllInterface/getTemplateList.cs.meta b/xiaofang/Assets/Script/DirllInterface/getTemplateList.cs.meta new file mode 100644 index 00000000..8b83e7a5 --- /dev/null +++ b/xiaofang/Assets/Script/DirllInterface/getTemplateList.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ebf1a137f8ff7be4ebc15918c07cf94d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/xiaofang/Assets/Script/DirllInterface/loginP.cs b/xiaofang/Assets/Script/DirllInterface/loginP.cs new file mode 100644 index 00000000..400a7fd4 --- /dev/null +++ b/xiaofang/Assets/Script/DirllInterface/loginP.cs @@ -0,0 +1,15 @@ +//using System.Collections; +//using System.Collections.Generic; +//using UnityEngine; + +//public class loginP : MonoBehaviour +//{ + +//} +////=====登录请求体================================= +//public class auth_login +//{ +// public string clientId = "e5cd7e4891bf95d1d19206ce24a7b32e"; +// public string grantType = "password"; +//} + diff --git a/xiaofang/Assets/Script/DirllInterface/loginP.cs.meta b/xiaofang/Assets/Script/DirllInterface/loginP.cs.meta new file mode 100644 index 00000000..0aa5b9cd --- /dev/null +++ b/xiaofang/Assets/Script/DirllInterface/loginP.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2f31b06d24bd8f744a8101b6a84accf1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/xiaofang/Assets/Script/DirllInterface/querySenceList.cs b/xiaofang/Assets/Script/DirllInterface/querySenceList.cs new file mode 100644 index 00000000..5428ad59 --- /dev/null +++ b/xiaofang/Assets/Script/DirllInterface/querySenceList.cs @@ -0,0 +1,104 @@ +using Newtonsoft.Json; +using System.Collections; +using System.Collections.Generic; +using System.Threading.Tasks; +using UnityEngine; + +public class querySenceList : MonoBehaviour +{ + + // 创建请求头,使用最新的 token + public Dictionary CreateHeaders() + { + + + if (string.IsNullOrEmpty(Global.global.loginResponse.data.access_token)) + { + Debug.LogWarning("尝试创建请求头时,token 未设置。"); + return new Dictionary(); + } + + return new Dictionary + { + { "Authorization","Bearer "+Global.global.loginResponse.data.access_token }, + {"clientId", "e5cd7e4891bf95d1d19206ce24a7b32e" } + }; + } + //查询场景信息列表 + public async Task QueryScene() + { + // 发送请求并获取返回数据 + string response = await web.SendRequest(web.URL + "/game/scene/list", "GET", "", CreateHeaders()); + Debug.Log("查询场景信息列表" + response); + + // 使用Newtonsoft.Json来反序列化JSON数据到QuerySceneData对象 + QuerySceneData senceData = JsonConvert.DeserializeObject(response); + + // 打印整体响应数据的某些属性 + if (senceData != null && senceData.data != null) + { + foreach (var scene in senceData.data) + { + Debug.Log("场景ID: " + scene.id); + Debug.Log("场景名称: " + scene.name); + Debug.Log("描述: " + scene.description); + Debug.Log("价格: " + scene.price); + Debug.Log("行业: " + scene.industryName); + + if (scene.fileList != null) + { + foreach (var file in scene.fileList) + { + Debug.Log("文件名称: " + file.name); + Debug.Log("文件URL: " + file.url); + } + } + } + } + else + { + Debug.Log("解析服务器数据失败"); + } + return senceData; + } +} +//============================================================================ +// 根数据类 +public class QuerySceneData +{ + public int code { get; set; } + public string msg { get; set; } + public List data { get; set; } +} + +// 场景信息类 +public class Scene +{ + public string id { get; set; } + public string name { get; set; }//场景名称 + public string type { get; set; }//场景类型 + public string description { get; set; }//场景描述 + public int suitIndustry { get; set; }//适用行业 + public string price { get; set; }//价格 分 + public int companyId { get; set; }//单位(**小学之类) + public string status { get; set; }//场景状态(0启用,1停用) + public string delFlag { get; set; } + public string remark { get; set; } + public string gameName { get; set; } + public string gameType { get; set; } + public string ossId { get; set; } + public List fileList { get; set; } + public string gameStoreroom { get; set; } + public string industryName { get; set; } + public string companyName { get; set; } +} + +// 文件信息类 +public class File +{ + public string ossId { get; set; } + public string name { get; set; } + public string url { get; set; } + public string originalName { get; set; } + public string fileSuffix { get; set; } +} diff --git a/xiaofang/Assets/Script/DirllInterface/querySenceList.cs.meta b/xiaofang/Assets/Script/DirllInterface/querySenceList.cs.meta new file mode 100644 index 00000000..7cab047d --- /dev/null +++ b/xiaofang/Assets/Script/DirllInterface/querySenceList.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 48ff46eafb8924748a1844646686c408 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/xiaofang/Assets/Script/DirllInterface/querySubjectList.cs b/xiaofang/Assets/Script/DirllInterface/querySubjectList.cs new file mode 100644 index 00000000..5a0d99f5 --- /dev/null +++ b/xiaofang/Assets/Script/DirllInterface/querySubjectList.cs @@ -0,0 +1,71 @@ +using Newtonsoft.Json; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class querySubjectList : MonoBehaviour +{ + + // 创建请求头,使用最新的 token + public Dictionary CreateHeaders() + { + + + if (string.IsNullOrEmpty(Global.global.loginResponse.data.access_token)) + { + Debug.LogWarning("尝试创建请求头时,token 未设置。"); + return new Dictionary(); + } + + return new Dictionary + { + { "Authorization","Bearer "+Global.global.loginResponse.data.access_token }, + {"clientId", "e5cd7e4891bf95d1d19206ce24a7b32e" } + }; + } + //查询演练科目信息列表 + public async void QueryDrillSubject() + { + + + string response = await web.SendRequest(web.URL + "/game/subject/list", "GET", "", CreateHeaders()); + Debug.Log("查询演练科目信息列表: " + response); + + // 使用 Newtonsoft.Json 进行反序列化 + DrillSubject drillSubject = JsonConvert.DeserializeObject(response); + + // 检查反序列化结果 + if (drillSubject == null) + { + Debug.LogError("Failed to deserialize JSON. DrillSubject is null."); + return; + } + + if (drillSubject.data == null || drillSubject.data.Count == 0) + { + Debug.LogWarning("No subjects found in the returned data."); + return; + } + + // 遍历反序列化后的 data 列表 + foreach (var subject in drillSubject.data) + { + Debug.Log("ID: " + subject.id); + Debug.Log("Scene Names: " + subject.sceneNames); + Debug.Log("Name: " + subject.name); + Debug.Log("Suit Version: " + subject.suitVersion); + Debug.Log("Type: " + subject.type); + Debug.Log("Description: " + subject.description); + Debug.Log("Price: " + subject.price); + Debug.Log("Company ID: " + subject.companyId); + Debug.Log("Status: " + subject.status); + Debug.Log("Delete Flag: " + subject.delFlag); + Debug.Log("Remark: " + subject.remark); + Debug.Log("Game Name: " + subject.gameName); + Debug.Log("OSS ID: " + subject.ossId); + Debug.Log("File List: " + subject.fileList); + // 如果需要进一步处理字段,可以在这里进行 + // 比如,将价格转换为数字计算,或根据特定类型执行逻辑 + } + } +} diff --git a/xiaofang/Assets/Script/DirllInterface/querySubjectList.cs.meta b/xiaofang/Assets/Script/DirllInterface/querySubjectList.cs.meta new file mode 100644 index 00000000..97c6eb74 --- /dev/null +++ b/xiaofang/Assets/Script/DirllInterface/querySubjectList.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0f70eb725b6c69f4d87bf12740bb8fbc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/xiaofang/Assets/Script/login/Global.cs b/xiaofang/Assets/Script/login/Global.cs index 4bcf9d31..8e47f771 100644 --- a/xiaofang/Assets/Script/login/Global.cs +++ b/xiaofang/Assets/Script/login/Global.cs @@ -6,9 +6,24 @@ using UnityEngine; public class Global : Singleton { public static Global global; - public server response; + public loginResponse loginResponse; + + // 创建请求头,使用最新的 token + public Dictionary CreateHeaders() + { + if (string.IsNullOrEmpty(Global.global.loginResponse.data.access_token)) + { + Debug.LogWarning("尝试创建请求头时,token 未设置。"); + return new Dictionary(); + } + + return new Dictionary + { + { "Authorization", Global.global.loginResponse.data.access_token } + }; + } //// 创建请求头,使用最新的 token //public Dictionary CreateHeaders() //{ @@ -30,9 +45,9 @@ public class Global : Singleton } -public class server : Response +public class loginResponse : Response { - public Data data; + public loginData data; //public string access_token; } public class Response @@ -40,7 +55,7 @@ public class Response public int code; public string msg; } -public class Data +public class loginData { public string access_token; public string companyId; @@ -50,54 +65,54 @@ public class Data public string isCreater;//是否是模板创建者,Y是则跳蓝湖预定演练01页面开始创建模板,N否则跳蓝狐回放1页面 } //==================================================== -public class TemplateListData: Response -{ - public string[] data; -} -public class newTemplateData: Response -{ - public string data; -} +//public class TemplateListData: Response +//{ +// public string[] data; +//} +//public class newTemplateData: Response +//{ +// public string data; +//} //============================================================= // 根数据类 -public class QuerySceneData -{ - public int code { get; set; } - public string msg { get; set; } - public List data { get; set; } -} +//public class QuerySceneData +//{ +// public int code { get; set; } +// public string msg { get; set; } +// public List data { get; set; } +//} -// 场景信息类 -public class Scene -{ - public string id { get; set; } - public string name { get; set; } - public string type { get; set; } - public string description { get; set; } - public int suitIndustry { get; set; } - public string price { get; set; } - public int companyId { get; set; } - public string status { get; set; } - public string delFlag { get; set; } - public string remark { get; set; } - public string gameName { get; set; } - public string gameType { get; set; } - public string ossId { get; set; } - public List fileList { get; set; } - public string gameStoreroom { get; set; } - public string industryName { get; set; } - public string companyName { get; set; } -} +//// 场景信息类 +//public class Scene +//{ +// public string id { get; set; } +// public string name { get; set; } +// public string type { get; set; } +// public string description { get; set; } +// public int suitIndustry { get; set; } +// public string price { get; set; } +// public int companyId { get; set; } +// public string status { get; set; } +// public string delFlag { get; set; } +// public string remark { get; set; } +// public string gameName { get; set; } +// public string gameType { get; set; } +// public string ossId { get; set; } +// public List fileList { get; set; } +// public string gameStoreroom { get; set; } +// public string industryName { get; set; } +// public string companyName { get; set; } +//} -// 文件信息类 -public class File -{ - public string ossId { get; set; } - public string name { get; set; } - public string url { get; set; } - public string originalName { get; set; } - public string fileSuffix { get; set; } -} +//// 文件信息类 +//public class File +//{ +// public string ossId { get; set; } +// public string name { get; set; } +// public string url { get; set; } +// public string originalName { get; set; } +// public string fileSuffix { get; set; } +//} //================================================================= public class DrillSubject : Response { diff --git a/xiaofang/Assets/Script/login/login.cs b/xiaofang/Assets/Script/login/login.cs index 6956685f..3fd2799c 100644 --- a/xiaofang/Assets/Script/login/login.cs +++ b/xiaofang/Assets/Script/login/login.cs @@ -10,37 +10,36 @@ public class auth_login { public string clientId = "e5cd7e4891bf95d1d19206ce24a7b32e"; public string grantType = "password"; - -} -public class auth_createTemplate -{ - public string templateName; - public string sceneId; - public string subjectId; - public string isTemplate; - public string mode; - public List playerList; - public List npcList; - public List materialList; -} -public class PlayerList -{ - public string userId; - public string roleId; - public string birthAreaId; - public string chargeAreaId; -} -public class NpcList -{ - public string userId; - public string roleId; - public int birthAreaId; -} -public class MaterialList -{ - public string materialId; - public int num; } +//public class auth_createTemplate +//{ +// public string templateName; +// public string sceneId; +// public string subjectId; +// public string isTemplate; +// public string mode; +// public List playerList; +// public List npcList; +// public List materialList; +//} +//public class PlayerList +//{ +// public string userId; +// public string roleId; +// public string birthAreaId; +// public string chargeAreaId; +//} +//public class NpcList +//{ +// public string userId; +// public string roleId; +// public int birthAreaId; +//} +//public class MaterialList +//{ +// public string materialId; +// public int num; +//} //public class TemplateList//可空 @@ -51,19 +50,18 @@ public class MaterialList // public string subjectId; // public string queryType; //} -public class createTemplate -{ - public string templateName; - public string sceneId; - public string subjectId; - public string isTemplate; - public string mode; -} +//public class createTemplate +//{ +// public string templateName; +// public string sceneId; +// public string subjectId; +// public string isTemplate; +// public string mode; +//} //============================================================================================ public class login : MonoBehaviour - { public string token;//登录返回的token public Global Global; @@ -76,7 +74,7 @@ public class login : MonoBehaviour { - if (string.IsNullOrEmpty(token)) + if (string.IsNullOrEmpty(Global.global.loginResponse.data.access_token)) { Debug.LogWarning("尝试创建请求头时,token 未设置。"); return new Dictionary(); @@ -84,23 +82,23 @@ public class login : MonoBehaviour return new Dictionary { - { "Authorization","Bearer "+token }, - {"clientId", clientId } + { "Authorization","Bearer "+Global.global.loginResponse.data.access_token }, + {"clientId", "e5cd7e4891bf95d1d19206ce24a7b32e" } }; } //================================================================================================= public async void Start() { await loging(); - SubmitTemplate(); - BindNPC(); - BindMaterial(); - BindPlayer(); - QueryDrillSubject(); - TemplateList(); - createTemplate(); - QueryScene(); - queryRoleList(); + //SubmitTemplate(); + //BindNPC(); + //BindMaterial(); + //BindPlayer(); + //QueryDrillSubject(); + //TemplateList(); + //createTemplate(); + //QueryScene(); + //queryRoleList(); } //登录 public async Task loging() @@ -110,67 +108,73 @@ public class login : MonoBehaviour string response = await web.SendRequest(web.URL + "/auth/login", "POST", JsonUtility.ToJson(auth_Login)); Debug.Log("登录" + response); // 解析服务器返回的数据 - server serverData = JsonConvert.DeserializeObject(response); + loginResponse serverData = JsonConvert.DeserializeObject(response); token = serverData.data.access_token; Debug.Log("===========" + serverData.data.isCreater); } //获取模板列表 - public async void TemplateList() - { - string response = await web.SendRequest(web.URL + "/game/gameTemplate/list", "GET", "", CreateHeaders()); - Debug.Log("获取模板列表" + response); - //解析服务器返回的数据 - TemplateListData templateListData = JsonConvert.DeserializeObject(response); - Debug.Log("================" + templateListData.msg); - } + //public async void TemplaRst() + //{ + // string response = await web.SendRequest(web.URL + "/game/gameTemplate/list", "GET", "", CreateHeaders()); + // Debug.Log("获取模板列表" + response); + // //解析服务器返回的数据 + // TemplateListData templateListData = JsonConvert.DeserializeObject(response); + // Debug.Log("================" + templateListData.msg); + //} + + + //新建模板 - public async void createTemplate() - { - auth_createTemplate auth_CreateTemplate = new auth_createTemplate(); - string response = await web.SendRequest(web.URL + "/auth/login", "POST", JsonUtility.ToJson(auth_CreateTemplate)); - //string body = "{\"templateName\": \"11111\",\"sceneId\": \"11111\",\"subjectId\": \"111\",\"isTemplate\": \"111\",\"mode\": \"111\",\"playerList\": [{\"userId\": \"111\",\"roleId\": \"1111\",\"birthAreaId\": \"111\",\"chargeAreaId\": \"111\"}],\"npcList\": [{\"npcId\": \"111\",\"areaId\": \"111\",\"npcNum\": 0}],\"materialList\": [{\"materialId\": \"111\",\"num\": 0}]}"; - //string response = await web.SendRequest(web.URL + "/game/gameTemplate/add", "POST", body, CreateHeaders()); - Debug.Log("新建模板列表" + response); - // 解析服务器返回的数据 - newTemplateData newTemplateData = JsonConvert.DeserializeObject(response); - Debug.Log(newTemplateData.data); - } + //public async void createTemplate() + //{ + // auth_createTemplate auth_CreateTemplate = new auth_createTemplate(); + // string response = await web.SendRequest(web.URL + "/auth/login", "POST", JsonUtility.ToJson(auth_CreateTemplate)); + // //string body = "{\"templateName\": \"11111\",\"sceneId\": \"11111\",\"subjectId\": \"111\",\"isTemplate\": \"111\",\"mode\": \"111\",\"playerList\": [{\"userId\": \"111\",\"roleId\": \"1111\",\"birthAreaId\": \"111\",\"chargeAreaId\": \"111\"}],\"npcList\": [{\"npcId\": \"111\",\"areaId\": \"111\",\"npcNum\": 0}],\"materialList\": [{\"materialId\": \"111\",\"num\": 0}]}"; + // //string response = await web.SendRequest(web.URL + "/game/gameTemplate/add", "POST", body, CreateHeaders()); + // Debug.Log("新建模板列表" + response); + // // 解析服务器返回的数据 + // newTemplateData newTemplateData = JsonConvert.DeserializeObject(response); + // Debug.Log(newTemplateData.data); + //} + + + //查询场景信息列表 - public async void QueryScene() - { - // 发送请求并获取返回数据 - string response = await web.SendRequest(web.URL + "/game/scene/list", "GET", "", CreateHeaders()); - Debug.Log("查询场景信息列表" + response); + //public async void QueryScene() + //{ + // // 发送请求并获取返回数据 + // string response = await web.SendRequest(web.URL + "/game/scene/list", "GET", "", CreateHeaders()); + // Debug.Log("查询场景信息列表" + response); - // 使用Newtonsoft.Json来反序列化JSON数据到QuerySceneData对象 - QuerySceneData serverData = JsonConvert.DeserializeObject(response); + // // 使用Newtonsoft.Json来反序列化JSON数据到QuerySceneData对象 + // QuerySceneData serverData = JsonConvert.DeserializeObject(response); - // 打印整体响应数据的某些属性 - if (serverData != null && serverData.data != null) - { - foreach (var scene in serverData.data) - { - Debug.Log("场景ID: " + scene.id); - Debug.Log("场景名称: " + scene.name); - Debug.Log("描述: " + scene.description); - Debug.Log("价格: " + scene.price); - Debug.Log("行业: " + scene.industryName); + // // 打印整体响应数据的某些属性 + // if (serverData != null && serverData.data != null) + // { + // foreach (var scene in serverData.data) + // { + // Debug.Log("场景ID: " + scene.id); + // Debug.Log("场景名称: " + scene.name); + // Debug.Log("描述: " + scene.description); + // Debug.Log("价格: " + scene.price); + // Debug.Log("行业: " + scene.industryName); - if (scene.fileList != null) - { - foreach (var file in scene.fileList) - { - Debug.Log("文件名称: " + file.name); - Debug.Log("文件URL: " + file.url); - } - } - } - } - else - { - Debug.Log("解析服务器数据失败"); - } - } + // if (scene.fileList != null) + // { + // foreach (var file in scene.fileList) + // { + // Debug.Log("文件名称: " + file.name); + // Debug.Log("文件URL: " + file.url); + // } + // } + // } + // } + // else + // { + // Debug.Log("解析服务器数据失败"); + // } + //} //查询演练科目信息列表 public async void QueryDrillSubject()