This commit is contained in:
liuliang 2024-11-25 22:58:47 +08:00
commit fd1f1f3bbc
6 changed files with 135 additions and 0 deletions

View File

@ -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<UnionDetalResponse> queryUnionDetail(int orderByDesc) // 1.7
{
// 准备请求的头部信息,包含授权令牌
Dictionary<string, string> head17 = new Dictionary<string, string>
{
{ "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<UnionDetalResponse>(response17);
Debug.Log("8==================================D"+ unionDetailResponse.Data.BizUnionUserModelList[0].CreateTime);
return unionDetailResponse;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 36aa28680afd43b44b8d8d98d252aee4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -340,3 +340,44 @@ public class UnionPage : Response
{ {
public UnionPageData Data { get; set; } 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<BizUnionUserModel> BizUnionUserModelList { get; set; }
}
public class UnionDetalResponse : Response
{
public UnionDetalResponseData Data { get; set; }
}

View File

@ -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()
{
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d28b93aa3e27efe459ed3371d2072596
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -458,6 +458,7 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 1001758454263862281} - component: {fileID: 1001758454263862281}
- component: {fileID: 1001758454263862279} - component: {fileID: 1001758454263862279}
- component: {fileID: 7953962115897863522}
- component: {fileID: 1001758454263862280} - component: {fileID: 1001758454263862280}
m_Layer: 5 m_Layer: 5
m_Name: GongHuiInfox m_Name: GongHuiInfox
@ -499,6 +500,18 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1001758454263862282} m_GameObject: {fileID: 1001758454263862282}
m_CullTransparentMesh: 1 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 --- !u!114 &1001758454263862280
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0