From 4295e0f2b57fda26514a47233c804b4fc884989e Mon Sep 17 00:00:00 2001 From: huyulong <1838407198@qq.com> Date: Mon, 25 Nov 2024 22:57:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E4=BA=86=E6=8E=A5=E5=8F=A3=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TheStrongestSnail/Assets/HZB/UnionDetail17.cs | 33 +++++++++++++++ .../Assets/HZB/UnionDetail17.cs.meta | 11 +++++ .../Assets/Scripts/Login/Global.cs | 41 +++++++++++++++++++ .../Assets/Scripts/Trade/UnionInfo.cs | 26 ++++++++++++ .../Assets/Scripts/Trade/UnionInfo.cs.meta | 11 +++++ .../prefabs/HYLPrefabs/GongHuiInfox.prefab | 13 ++++++ 6 files changed, 135 insertions(+) create mode 100644 TheStrongestSnail/Assets/HZB/UnionDetail17.cs create mode 100644 TheStrongestSnail/Assets/HZB/UnionDetail17.cs.meta create mode 100644 TheStrongestSnail/Assets/Scripts/Trade/UnionInfo.cs create mode 100644 TheStrongestSnail/Assets/Scripts/Trade/UnionInfo.cs.meta diff --git a/TheStrongestSnail/Assets/HZB/UnionDetail17.cs b/TheStrongestSnail/Assets/HZB/UnionDetail17.cs new file mode 100644 index 0000000..1d6937f --- /dev/null +++ b/TheStrongestSnail/Assets/HZB/UnionDetail17.cs @@ -0,0 +1,33 @@ +using Newtonsoft.Json; +using System.Collections; +using System.Collections.Generic; +using System.Threading.Tasks; +using UnityEngine; +//1.7查询工会详情 +public class UnionDetail17 : MonoBehaviour +{ + // UnionDetail unionDetail = new UnionDetail(); + public async Task queryUnionDetail(int orderByDesc) // 1.7 + { + // 准备请求的头部信息,包含授权令牌 + Dictionary head17 = new Dictionary + { + { "Authorization", Global.global.serverResponse.data.token } + }; + UnionPage16 unionPage16 = new UnionPage16(); + UnionPage unionPage = new UnionPage(); + unionPage = await unionPage16.queryUnionPage(2); + Debug.Log(unionPage); + // 异步发送请求 + string response17 = await web.SendRequest(web.URL + "/snail/union/queryInfo?unionId="+ orderByDesc.ToString(), "GET","{}", head17); + + // 调试输出接收到的响应 + Debug.Log("1.7查询工会详情========================================" + response17); + + // 将响应反序列化为对象 + UnionDetalResponse unionDetailResponse = JsonConvert.DeserializeObject(response17); + Debug.Log("8==================================D"+ unionDetailResponse.Data.BizUnionUserModelList[0].CreateTime); + return unionDetailResponse; + + } +} diff --git a/TheStrongestSnail/Assets/HZB/UnionDetail17.cs.meta b/TheStrongestSnail/Assets/HZB/UnionDetail17.cs.meta new file mode 100644 index 0000000..5590e85 --- /dev/null +++ b/TheStrongestSnail/Assets/HZB/UnionDetail17.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 36aa28680afd43b44b8d8d98d252aee4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TheStrongestSnail/Assets/Scripts/Login/Global.cs b/TheStrongestSnail/Assets/Scripts/Login/Global.cs index a07113b..62b920c 100644 --- a/TheStrongestSnail/Assets/Scripts/Login/Global.cs +++ b/TheStrongestSnail/Assets/Scripts/Login/Global.cs @@ -340,3 +340,44 @@ public class UnionPage : Response { public UnionPageData Data { get; set; } } + +//========1.7================================================================ + +public class BizUnionModel +{ + + public int Id { get; set; } + public string Name { get; set; } + public string Cover { get; set; } + public int Level { get; set; } + public string Slogan { get; set; } + public int LeaderId { get; set; } + public string LeaderUserName { get; set; } + public string CreateTime { get; set; } // 可以根据实际情况调整为DateTime? + public string UpdateTime { get; set; } +} + +public class BizUnionUserModel +{ + public int Id { get; set; } + public int UnionId { get; set; } + public int UserId { get; set; } + public string UserName { get; set; } + public int Station { get; set; } + public int HigherUserId { get; set; } + public int HigherStation { get; set; } + public int Status { get; set; } + public string CreateTime { get; set; } + public string UpdateTime { get; set; } +} + +public class UnionDetalResponseData +{ + public BizUnionModel BizUnionModel { get; set; } + public List BizUnionUserModelList { get; set; } +} + +public class UnionDetalResponse : Response +{ + public UnionDetalResponseData Data { get; set; } +} \ No newline at end of file diff --git a/TheStrongestSnail/Assets/Scripts/Trade/UnionInfo.cs b/TheStrongestSnail/Assets/Scripts/Trade/UnionInfo.cs new file mode 100644 index 0000000..8dc6085 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/Trade/UnionInfo.cs @@ -0,0 +1,26 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class UnionInfo : MonoBehaviour +{ + + // Start is called before the first frame update + void Start() + { + GetData(); + } + + public async void GetData() + { + UnionDetail17 unionDetail = new UnionDetail17(); + UnionDetalResponse Detail = await unionDetail.queryUnionDetail(1); + Debug.Log(Detail.Data.BizUnionUserModelList[0].CreateTime); + } + + // Update is called once per frame + void Update() + { + + } +} diff --git a/TheStrongestSnail/Assets/Scripts/Trade/UnionInfo.cs.meta b/TheStrongestSnail/Assets/Scripts/Trade/UnionInfo.cs.meta new file mode 100644 index 0000000..a19808e --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/Trade/UnionInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d28b93aa3e27efe459ed3371d2072596 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TheStrongestSnail/Assets/prefabs/HYLPrefabs/GongHuiInfox.prefab b/TheStrongestSnail/Assets/prefabs/HYLPrefabs/GongHuiInfox.prefab index 688ce71..4976666 100644 --- a/TheStrongestSnail/Assets/prefabs/HYLPrefabs/GongHuiInfox.prefab +++ b/TheStrongestSnail/Assets/prefabs/HYLPrefabs/GongHuiInfox.prefab @@ -458,6 +458,7 @@ GameObject: m_Component: - component: {fileID: 1001758454263862281} - component: {fileID: 1001758454263862279} + - component: {fileID: 7953962115897863522} - component: {fileID: 1001758454263862280} m_Layer: 5 m_Name: GongHuiInfox @@ -499,6 +500,18 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1001758454263862282} m_CullTransparentMesh: 1 +--- !u!114 &7953962115897863522 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1001758454263862282} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d28b93aa3e27efe459ed3371d2072596, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!114 &1001758454263862280 MonoBehaviour: m_ObjectHideFlags: 0