100 lines
3.1 KiB
C#
100 lines
3.1 KiB
C#
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using UnityEngine;
|
|
//10.4查询矿场卡槽分页
|
|
public class queryUserMiningSlot104 : MonoBehaviour
|
|
{
|
|
public async Task<UserMiningSlotResponse> QueryUserMiningSlot()
|
|
{
|
|
// 准备请求的头部信息,包含授权令牌
|
|
Dictionary<string, string> head = new Dictionary<string, string>
|
|
{
|
|
{ "Authorization", Global.global.serverResponse.data.token }
|
|
};
|
|
|
|
queryPlayerInfo queryPlayerInfo = new queryPlayerInfo();
|
|
RealPlayerInfo realPlayerInfo = await queryPlayerInfo.QueryPlayerInfoPro();
|
|
UserMiningSlotBody body = new UserMiningSlotBody();
|
|
body.userId = realPlayerInfo.data.userId;
|
|
|
|
|
|
// 异步发送请求以获取最新的蜗牛骑士信息
|
|
string response0104 = await web.SendRequest(web.URL + "/snail/mining/queryUserMiningSlot", "POST", JsonConvert.SerializeObject(body), head);
|
|
|
|
// 调试输出接收到的响应
|
|
Debug.Log("10.4查询矿场卡槽分页" + response0104);
|
|
|
|
// 将响应反序列化为对象
|
|
UserMiningSlotResponse userMiningSlotResponse = JsonConvert.DeserializeObject<UserMiningSlotResponse>(response0104);
|
|
Debug.Log("===========88============="+ userMiningSlotResponse.data.dataList[0].userId);
|
|
|
|
// 返回解析后的对象
|
|
return userMiningSlotResponse;
|
|
}
|
|
}
|
|
//======请求体==================================
|
|
public class UserMiningSlotBody
|
|
{
|
|
public long userId;
|
|
}
|
|
//===========返回值==============================
|
|
public class UserMiningSlotResponse:Response
|
|
{
|
|
public UserMiningSlotData data { get; set; }
|
|
}
|
|
|
|
public class UserMiningSlotData
|
|
{
|
|
public int pageNo { get; set; }
|
|
public int pageSize { get; set; }
|
|
public int totalCount { get; set; }
|
|
public List<UserMiningSlot> dataList { get; set; }
|
|
}
|
|
|
|
public class UserMiningSlot
|
|
{
|
|
public long id { get; set; }
|
|
public long userId { get; set; }
|
|
public long snailId { get; set; }
|
|
public long contractId { get; set; }
|
|
public long contractUserId { get; set; }
|
|
public string bindTime { get; set; }
|
|
public int source { get; set; }
|
|
public int useType { get; set; }
|
|
public int status { get; set; }
|
|
public string createTime { get; set; }
|
|
public string miningBegin { get; set; }
|
|
public string miningEnd { get; set; }
|
|
public float carry { get; set; }
|
|
public string contractName { get; set; }
|
|
}
|
|
//{
|
|
// "code": 200,
|
|
// "message": "请求成功",
|
|
// "data": {
|
|
// "pageNo": 1,
|
|
// "pageSize": 20,
|
|
// "totalCount": 1,
|
|
// "dataList": [
|
|
// {
|
|
// "id": 13,
|
|
// "userId": 106,
|
|
// "snailId": 0,
|
|
// "contractId": 0,
|
|
// "contractUserId": 0,
|
|
// "bindTime": null,
|
|
// "source": 0,
|
|
// "useType": 2,
|
|
// "status": 0,
|
|
// "createTime": null,
|
|
// "miningBegin": null,
|
|
// "miningEnd": null,
|
|
// "carry": 0,
|
|
// "contractName": null
|
|
// }
|
|
// ]
|
|
// }
|
|
//} |