79 lines
2.1 KiB
C#
79 lines
2.1 KiB
C#
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using UnityEngine;
|
|
|
|
public class MotherFuck532 : MonoBehaviour
|
|
{
|
|
public async Task<Lottery532> Result() //
|
|
{
|
|
// 准备请求的头部信息,包含授权令牌
|
|
Dictionary<string, string> head118 = new Dictionary<string, string>
|
|
{
|
|
{ "Authorization", Global.global.serverResponse.data.token }
|
|
};
|
|
// 请求体
|
|
QueryLottery532Body Body = new QueryLottery532Body
|
|
{
|
|
userId = Global.global.serverResponse.data.userId
|
|
};
|
|
|
|
|
|
// 异步发送请求
|
|
string response118 = await web.SendRequest(web.URL + "/snail/gameLottery/queryLotteryUserList", "POST", JsonConvert.SerializeObject(Body), head118);
|
|
|
|
// 调试输出接收到的响应
|
|
Debug.Log("5.3.2查询用户下的摇奖机 =====================" + "请求体:" + JsonConvert.SerializeObject(Body) + "||返回数据" + response118);
|
|
|
|
// 将响应反序列化为 KnightRoomList 对象
|
|
Lottery532 directlist = JsonConvert.DeserializeObject<Lottery532>(response118);
|
|
|
|
// 检查反序列化是否成功
|
|
if (directlist != null && directlist.data != null)
|
|
{
|
|
|
|
//Debug.Log("获取成功");
|
|
|
|
}
|
|
else
|
|
{
|
|
Debug.LogError("directlist 数据为空");
|
|
}
|
|
//Debug.Log(directlist.data.UserResponseVoList.Count);
|
|
return directlist;
|
|
}
|
|
}
|
|
public class QueryLottery532Body
|
|
{
|
|
|
|
public int userId { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
public class Lottery532 : Response
|
|
{
|
|
public List<Lottery532Data> data { get; set; }
|
|
|
|
}
|
|
|
|
public class Lottery532Data
|
|
{
|
|
public int id { get; set; }
|
|
public int lotteryId { get; set; }
|
|
public int source { get; set; }
|
|
public int userId { get; set; }
|
|
public int status { get; set; }
|
|
public double beansCoinOpen { get; set; }
|
|
public double beansCoinReward { get; set; }
|
|
public int type { get; set; }
|
|
public int snailId { get; set; }
|
|
public int slotId { get; set; }
|
|
public DateTime createTime { get; set; }
|
|
public DateTime updateTime { get; set; }
|
|
|
|
}
|