_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/GoodId/GoodIdPage41.cs

37 lines
1.1 KiB
C#

using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
//查询靓号分页
public class GoodIdPage41 : MonoBehaviour
{
public async Task<GoodIdResponse> queryUnionPage() // 4.1
{
// 准备请求的头部信息,包含授权令牌
Dictionary<string, string> head41 = new Dictionary<string, string>
{
{ "Authorization", Global.global.serverResponse.data.token }
};
// 请求体
GoodIdPageBody goodIdPageBody = new GoodIdPageBody
{
//userId = Global.global.serverResponse.data.userId,
orderByDesc = 1
};
// 异步发送请求
string response41 = await web.SendRequest(web.URL + "/snail/cutePool/page", "POST", JsonUtility.ToJson(goodIdPageBody), head41);
// 调试输出接收到的响应
Debug.Log("4.1查询靓号分页" + response41);
// 将响应反序列化为对象
GoodIdResponse goodIdResponse = JsonConvert.DeserializeObject<GoodIdResponse>(response41);
Debug.Log("8==================================D"+goodIdResponse.Data.TotalCount);
return goodIdResponse;
}
}