80 lines
1.9 KiB
C#
80 lines
1.9 KiB
C#
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using UnityEngine;
|
|
|
|
|
|
public class MotherFuck531 : MonoBehaviour
|
|
{
|
|
|
|
|
|
|
|
public async Task<Lottery531> Result(int id) //
|
|
{
|
|
// 准备请求的头部信息,包含授权令牌
|
|
Dictionary<string, string> head118 = new Dictionary<string, string>
|
|
{
|
|
{ "Authorization", Global.global.serverResponse.data.token }
|
|
};
|
|
// 请求体
|
|
QueryLottery531Body Body = new QueryLottery531Body
|
|
{
|
|
lotteryId = id
|
|
};
|
|
|
|
|
|
// 异步发送请求
|
|
string response118 = await web.SendRequest(web.URL + "/snail/gameLottery/queryLotteryRewardList", "POST", JsonConvert.SerializeObject(Body), head118);
|
|
|
|
// 调试输出接收到的响应
|
|
Debug.Log("5.3.1查询摇奖机奖励列表 =====================" + response118);
|
|
|
|
// 将响应反序列化为 KnightRoomList 对象
|
|
Lottery531 directlist = JsonConvert.DeserializeObject<Lottery531>(response118);
|
|
|
|
// 检查反序列化是否成功
|
|
if (directlist != null && directlist.data != null)
|
|
{
|
|
|
|
//Debug.Log("获取成功");
|
|
|
|
}
|
|
else
|
|
{
|
|
Debug.LogError("directlist 数据为空");
|
|
}
|
|
//Debug.Log(directlist.data.UserResponseVoList.Count);
|
|
return directlist;
|
|
}
|
|
}
|
|
|
|
public class QueryLottery531Body {
|
|
|
|
public int lotteryId { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
public class Lottery531 : Response
|
|
{
|
|
public List<Lottery531Data> data { get; set; }
|
|
|
|
}
|
|
|
|
public class Lottery531Data {
|
|
public int Id { get; set; }
|
|
public int LotteryId { get; set; }
|
|
public int Type { get; set; }
|
|
public decimal BeansCoin { get; set; }
|
|
public int RateSurface { get; set; }
|
|
public int RateActual { get; set; }
|
|
public int Status { get; set; }
|
|
public DateTime CreateTime { get; set; }
|
|
public DateTime UpdateTime { get; set; }
|
|
|
|
}
|
|
|