靓号池分页、工会分页、工会详情、蜗牛骑士全部接口

This commit is contained in:
HuangZiBo 2024-11-26 00:07:12 +08:00
parent 1ba30fa04c
commit 91d6cd534d
24 changed files with 882 additions and 99 deletions

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 32d2d8bdea868e946abaa072cd0ae8fc
guid: 112f9d113bc470a49a2fc0ca3814a705
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@ -0,0 +1,36 @@
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;
}
}

View File

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

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@ -17,14 +17,14 @@ public class Global : MonoBehaviour
DontDestroyOnLoad(this);
}
// 创建请求头,使用最新的 token
// 创建请求头,使用最新的 token
public Dictionary<string, string> CreateHeaders()
{
if (string.IsNullOrEmpty(Global.global.serverResponse.data.token))
{
Debug.LogWarning("尝试创建请求头时token 未设置。");
Debug.LogWarning("尝试创建请求头时token 未设置。");
return new Dictionary<string, string>();
}
@ -37,28 +37,28 @@ public class Global : MonoBehaviour
[Serializable]
public class GameEscapeRoomResponseVo
{
public int escapeId; // 游戏的ID
public int roomNo; // 房间编号
public float roomBeansCoin; // 房间下注欢乐豆
public int escapeId; // 游戏的ID
public int roomNo; // 房间编号
public float roomBeansCoin; // 房间下注欢乐豆
public int roomUserNo;
}
[Serializable]
public class userIDgameId
{
public int userId; // 用户id
public int escapeId; // 游戏id
public int orderByDesc;//参与记录正序或倒叙1正序其他倒叙
public int weekType;//1是昨天0是今天
public int userId; // 用户id
public int escapeId; // 游戏id
public int orderByDesc;//参与记录正序或倒叙1正序其他倒叙
public int weekType;//1是昨天0是今天
}
[Serializable]
public class Data
{
public int carrySeconds; // 携带时间秒数
public List<GameEscapeRoomResponseVo> gameEscapeRoomResponseVoList; // 房间列表
public GameEscapeModel gameEscapeModel; // 游戏逃亡模型 (目前未处理)
public object gameEscapeUserModel; // 游戏逃亡用户模型 (目前未处理)
public int carrySeconds; // 携带时间秒数
public List<GameEscapeRoomResponseVo> gameEscapeRoomResponseVoList; // 房间列表
public GameEscapeModel gameEscapeModel; // 游戏逃亡模型 (目前未处理)
public object gameEscapeUserModel; // 游戏逃亡用户模型 (目前未处理)
}
@ -86,71 +86,71 @@ public class Data514
[Serializable]
public class Data515
{
public float bet;//当前用户的下注
public int roomNo;//当前用户下注的房间号
public int outcome;//默认0还没结果1胜利2失败
public float win;//获胜后赢得多少欢乐豆
public float beansCoin;//本局最终获得多少欢乐豆
public float ichorCoin;//本局最终获得的灵液
public float bet;//当前用户的下注
public int roomNo;//当前用户下注的房间号
public int outcome;//默认0还没结果1胜利2失败
public float win;//获胜后赢得多少欢乐豆
public float beansCoin;//本局最终获得多少欢乐豆
public float ichorCoin;//本局最终获得的灵液
}
[Serializable]
public class ServerResponse515 : Response
{
public Data515 data; // 数据对象
public Data515 data; // 数据对象
}
[Serializable]
public class ServerResponse: Response
{
public Data data; // 数据对象
public Data data; // 数据对象
}
[Serializable]
public class ServerResponse514: Response
{
public Data514 data; // 数据对象
public Data514 data; // 数据对象
}
public class Response
{
public int code; // 响应状态码
public string message; // 提示语
public int code; // 响应状态码
public string message; // 提示语
}
// 数据类
// 数据类
[Serializable]
public class GameEscapeModel
{
public int id; // 游戏 ID
public string gameNo; // 游戏编号
public int demonMode; // 恶魔模式
public string startTime; // 开始时间
public string betTime; // 下注时间
public string countTime; // 结算时间
public string settleTime; // 最终结算时间
public int status; // 游戏状态
public string roomNoKill; // 无杀房间号
public string roomNoRemain; // 剩余房间号
public float beansCoinAll; // 总豆币数
public float beansCoinKill; // 击杀豆币数
public float beansCoinRemain; // 剩余豆币数
public float beansCoinFee; // 手续费
public float beansCoinRank; // 排名奖励豆币
public float beansCoinDivide; // 分成豆币
public int id; // 游戏 ID
public string gameNo; // 游戏编号
public int demonMode; // 恶魔模式
public string startTime; // 开始时间
public string betTime; // 下注时间
public string countTime; // 结算时间
public string settleTime; // 最终结算时间
public int status; // 游戏状态
public string roomNoKill; // 无杀房间号
public string roomNoRemain; // 剩余房间号
public float beansCoinAll; // 总豆币数
public float beansCoinKill; // 击杀豆币数
public float beansCoinRemain; // 剩余豆币数
public float beansCoinFee; // 手续费
public float beansCoinRank; // 排名奖励豆币
public float beansCoinDivide; // 分成豆币
}
[Serializable]
public class ServerResponse513 : Response
{
public int code; // 数据对象
public int code; // 数据对象
public string mesage;
}
//玩家信息
//玩家信息
[Serializable]
public class UserInfomation14: Response
{
@ -160,30 +160,30 @@ public class UserInfomation14: Response
public class UserInfomation14Data
{
public int userId;//id
public long userName;//用户名(电话)
public long userName;//用户名(电话)
public string token;
public string nickName;//昵称
public string headImg;//头像
public int gender;//性别1男2女
public string birthday;//出生,"yyyy-MM-dd HH:mm:ss"
public float voluteCoin;//蜗壳
public float beansCoin;//蜗蛋
public float ichorCoin;//灵液
public string nickName;//昵称
public string headImg;//头像
public int gender;//性别1男2女
public string birthday;//出生,"yyyy-MM-dd HH:mm:ss"
public float voluteCoin;//蜗壳
public float beansCoin;//蜗蛋
public float ichorCoin;//灵液
public string idCard;//=========================
public string inviteCodeMy;//=============
public string inviteCodeBind;//==========
public string bindTime;//===========
public int station;//=========
public string cuteNo;//靓号
public string cuteNo;//靓号
public string menberTime;//===============
public bool isMember;
//public int cuteNo;//靓号
//public int cuteNo;//靓号
}
[Serializable]
public class ServerResponse516 : Response
{
public Data516 data; // 数据对象
public Data516 data; // 数据对象
}
[Serializable]
@ -196,8 +196,8 @@ public class Data516
[Serializable]
public class gameEscapeRoomKillCountResponseVo
{
public int roomNo;//房间号
public int kill;//击杀次数
public int roomNo;//房间号
public int kill;//击杀次数
}
@ -205,8 +205,8 @@ public class gameEscapeRoomKillCountResponseVo
[Serializable]
public class gameEscapeModel
{
public string gameNo;//游戏编号
public string roomNoKill;//击杀的房间 "5,6,7,8"这种
public string gameNo;//游戏编号
public string roomNoKill;//击杀的房间 "5,6,7,8"这种
}
@ -215,16 +215,16 @@ public class gameEscapeModel
[Serializable]
public class ServerResponse517 : Response
{
public Data517 data; // 数据对象
public Data517 data; // 数据对象
}
[Serializable]
public class Data517
{
public float beansCoinBet;//当前用户总投入的欢乐豆
public float beansCoinWin;//当前用户总赚取的欢乐豆
public gameEscapeUserRecordResponseVoPageResult gameEscapeUserRecordResponseVoPageResult; //用户参与的大逃亡分页
public float beansCoinBet;//当前用户总投入的欢乐豆
public float beansCoinWin;//当前用户总赚取的欢乐豆
public gameEscapeUserRecordResponseVoPageResult gameEscapeUserRecordResponseVoPageResult; //用户参与的大逃亡分页
@ -242,13 +242,13 @@ public class gameEscapeUserRecordResponseVoPageResult
public class dataList
{
public string gameNo;//游戏编号
public float bet;//下注欢乐豆
public int roomNo;//下注房间号
public string roomNoKill;//击杀房间号
public int outcome;//本局结果默认0还未结束1胜利2失败
public float beansCoin;//本局最终获得欢乐豆
public string createTime;//创建时间
public string gameNo;//游戏编号
public float bet;//下注欢乐豆
public int roomNo;//下注房间号
public string roomNoKill;//击杀房间号
public int outcome;//本局结果默认0还未结束1胜利2失败
public float beansCoin;//本局最终获得欢乐豆
public string createTime;//创建时间
}
@ -256,7 +256,7 @@ public class dataList
[Serializable]
public class ServerResponse518 : Response
{
public Data518 data; // 数据对象
public Data518 data; // 数据对象
}
@ -273,12 +273,12 @@ public class Data518
public class gameEscapeUserBetResponseVoList
{
public string userId;//用户id
public string nickName;// 昵称
public string headImg;// 头像
public float bet;// 下注总额
public int orderNo;// 排名
public float rankBonus;// 排名奖金
public string userId;//用户id
public string nickName;// 昵称
public string headImg;// 头像
public float bet;// 下注总额
public int orderNo;// 排名
public float rankBonus;// 排名奖金
}
@ -286,12 +286,12 @@ public class gameEscapeUserBetResponseVoList
[Serializable]
public class userBetInfo
{
public string userId;//用户id
public string nickName;// 昵称
public string headImg;// 头像
public float bet;// 下注总额
public int orderNo;// 排名
public float rankBonus;// 排名奖金
public string userId;//用户id
public string nickName;// 昵称
public string headImg;// 头像
public float bet;// 下注总额
public int orderNo;// 排名
public float rankBonus;// 排名奖金
@ -300,17 +300,235 @@ public class userBetInfo
[Serializable]
public class Body518
{
public int userId; // 用户id
public int userId; // 用户id
public int weekType;//1是昨天0是今天
public int weekType;//1是昨天0是今天
}
//==================================================================================
//工会分页
public class UnionPageBody//请求体
//========1.7================================================================
//===============================================================================
//===============================================================================
//========================================
//=======================================
//========================================
//========521===================================================================================
//521<32><31>ѯ<EFBFBD><D1AF><EFBFBD>
public class ClosestKnight : Response
{
public ClosestKnightData Data { get; set; }
}
public class ClosestKnightData
{
public int CarrySeconds { get; set; }
public GameKnightModel GameKnightModel { get; set; }
public List<GameKnightRoomResponseVo> GameKnightRoomResponseVoList { get; set; }
public List<GameKnightUserModel> GameKnightUserModelList { get; set; }
}
public class GameKnightModel
{
public int Id { get; set; }
public string GameNo { get; set; }
public int GameSession { get; set; }
public string StartTime { get; set; }
public string BetTime { get; set; }
public string CountTime { get; set; }
public string SettleTime { get; set; }
public int Status { get; set; }
public string HorseNoAll { get; set; }
public string HorseNoKill { get; set; }
public string HorseNoRemain { get; set; }
public float BeansCoinAll { get; set; }
public float BeansCoinKill { get; set; }
public float BeansCoinRemain { get; set; }
public float BeansCoinFee { get; set; }
public float BeansCoinDivide { get; set; }
}
public class GameKnightRoomResponseVo
{
public int KnightId { get; set; }
public int HorseNo { get; set; }
public int HorseUserNo { get; set; }
public float HorseBeansCoin { get; set; }
}
public class GameKnightUserModel
{
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD>JSON<4F><4E>GameKnightUserModelList<73><74>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E9A1A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>о<EFBFBD><D0BE><EFBFBD><EFBFBD>ֶΣ<D6B6><CEA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶΡ<D6B6>
}
//====522=====================================================
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public class QueryKnightRoomListBody
{
public int userId { get; set; }
public int knightId { get; set; }
}
//<2F><><EFBFBD><EFBFBD>
public class KnightRoomBetList
{
public int Code { get; set; } // <20><>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD>
public string Message { get; set; } // <20><>Ӧ<EFBFBD><D3A6>Ϣ
public KnightRoomBetData Data { get; set; } // <20><><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD>
}
public class KnightRoomBetData
{
public int CarrySeconds { get; set; } // Я<><D0AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public GameKnightModel GameKnightModel { get; set; } // <20><>Ϸ<EFBFBD><CFB7>ʿģ<CABF>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD><EFBFBD>Ϊnull
public List<GameKnightRoomResponseVo> GameKnightRoomResponseVoList { get; set; } // <20><>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>б<EFBFBD>
public List<GameKnightUserModel> GameKnightUserModelList { get; set; } // <20><>ʿ<EFBFBD>û<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊnull
}
public class GameKnightModel2
{
// <20><>Ϊʾ<CEAA><CABE><EFBFBD>е<EFBFBD> `gameKnightModel` Ϊ null<6C><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>
// <20><><EFBFBD><EFBFBD><EFBFBD>˻᷵<CBBB>ظò<D8B8><C3B2>֣<EFBFBD><D6A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Щ<EFBFBD>ֶ<EFBFBD>
public int Id { get; set; }
public string GameNo { get; set; }
public int GameSession { get; set; }
public string StartTime { get; set; }
public string BetTime { get; set; }
public string CountTime { get; set; }
public string SettleTime { get; set; }
public int Status { get; set; }
public string HorseNoAll { get; set; }
public string HorseNoKill { get; set; }
public string HorseNoRemain { get; set; }
public float BeansCoinAll { get; set; }
public float BeansCoinKill { get; set; }
public float BeansCoinRemain { get; set; }
public float BeansCoinFee { get; set; }
public float BeansCoinDivide { get; set; }
}
public class GameKnightRoomResponseVo2
{
public int KnightId { get; set; } // <20><>ʿID
public int HorseNo { get; set; } // <20><>ƥ<EFBFBD><C6A5><EFBFBD>
public int HorseUserNo { get; set; } // <20><>ƥ<EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD>
public decimal HorseBeansCoin { get; set; } // <20><>ƥ<EFBFBD><C6A5><EFBFBD>ң<EFBFBD>ע<EFBFBD><D7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9> decimal <20>Ա<EFBFBD><D4B1>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD>Ľ<EFBFBD><C4BD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>
}
public class GameKnightUserModel2
{
// <20><>Ϊʾ<CEAA><CABE><EFBFBD>е<EFBFBD> `gameKnightUserModelList` Ϊ null<6C><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}
//========523======================================================
public class KnightBetBody
{
public int knightId { get; set; }
public int userId { get; set; }
public int horseNo { get; set; }
public float bet { get; set; }
}
//<2F><><EFBFBD><EFBFBD>
public class KnightBetResponse : Response
{
public string knighBetData;
}
//=======524========================================================
public class KnightKill : Response
{
public KnightBetData data { get; set; }
}
public class KnightBetData
{
public int id { get; set; }
public string gameNo { get; set; }
public int gameSession { get; set; }
public string startTime { get; set; }
public string betTime { get; set; }
public string countTime { get; set; }
public string settleTime { get; set; }
public int status { get; set; }
public string horseNoAll { get; set; }
public string horseNoKill { get; set; }
public string horseNoRemain { get; set; }
public float beansCoinAll { get; set; }
public float beansCoinKill { get; set; }
public float beansCoinRemain { get; set; }
public float beansCoinFee { get; set; }
public float beansCoinDivide { get; set; }
}
//======525========================================================
[Serializable]
public class KnightBetResult : Response
{
public Data data;
[Serializable]
public class Data
{
public int id;
public string gameNo;
public int gameSession;
public string startTime;
public string betTime;
public string countTime;
public string settleTime;
public int status;
public string horseNoAll;
public string horseNoKill;
public string horseNoRemain;
public float beansCoinAll;
public float beansCoinKill;
public float beansCoinRemain;
public float beansCoinFee;
public float beansCoinDivide;
}
}
//======526========================================================
public class QueryKnightRecordBody
{
public int userId;
public int orderByDesc { get; set; }
}
public class GameKnightModelRecord
{
public int id { get; set; }
public string gameNo { get; set; }
public int gameSession { get; set; }
public string startTime { get; set; }
public string betTime { get; set; }
public string countTime { get; set; }
public string settleTime { get; set; }
public int status { get; set; }
public string horseNoAll { get; set; }
public string horseNoKill { get; set; }
public string horseNoRemain { get; set; }
public float beansCoinAll { get; set; }
public float beansCoinKill { get; set; }
public float beansCoinRemain { get; set; }
public float beansCoinFee { get; set; }
public float beansCoinDivide { get; set; }
}
public class KnightRecordtData
{
public float beansCoinBet { get; set; }
public float beansCoinWin { get; set; }
public List<GameKnightModelRecord> gameKnightModelList { get; set; }
}
public class KnightRecord : Response
{
public KnightRecordtData data { get; set; }
}
//============================================
//工会分页
public class UnionPageBody//请求体
{
public int orderByDesc { get; set; }
}
@ -324,7 +542,7 @@ public class UnionDataInPage
public string Slogan { get; set; }
public int LeaderId { get; set; }
public string LeaderUserName { get; set; }
public string CreateTime { get; set; } // 由于createTime可能为null且类型未明确这里使用object类型可根据实际情况调整为DateTime?或其他类型
public string CreateTime { get; set; } // 由于createTime可能为null且类型未明确这里使用object类型可根据实际情况调整为DateTime?或其他类型
public string UpdateTime { get; set; }
}
@ -340,7 +558,6 @@ public class UnionPage : Response
{
public UnionPageData Data { get; set; }
}
//========1.7================================================================
public class BizUnionModel
@ -353,7 +570,7 @@ public class BizUnionModel
public string Slogan { get; set; }
public int LeaderId { get; set; }
public string LeaderUserName { get; set; }
public string CreateTime { get; set; } // 可以根据实际情况调整为DateTime?
public string CreateTime { get; set; } // 可以根据实际情况调整为DateTime?
public string UpdateTime { get; set; }
}
@ -380,4 +597,24 @@ public class UnionDetalResponseData
public class UnionDetalResponse : Response
{
public UnionDetalResponseData Data { get; set; }
}
}
//====4.1============================
//查询靓号分页
public class GoodIdPageBody
{
public int orderByDesc { get; set; }
}
public class GoodIdData
{
public int PageNo { get; set; }
public int PageSize { get; set; }
public int TotalCount { get; set; }
public List<object> DataList { get; set; } // 由于dataList为空数组未给出具体类型这里使用List<object>
}
public class GoodIdResponse : Response
{
public GoodIdData Data { get; set; }
}
//======================

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9b1844214eeaf9f4cb67fe760a9b80a5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,55 @@
using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
//5.2.3下注
public class SnailKnightBet523 : MonoBehaviour
{
//返回的(解析后)====================
//public KnightRoomBetList knightRoomBetList;
//async void Start()
//{
// await SnailKnightBet(39592, 1, 3); // =============================== 示例,仅供测试
//}
public async Task<KnightRoomBetList> SnailKnightBet(int KnightId,float bet,int horseNo)
{
// 准备请求的头部信息,包含授权令牌
Dictionary<string, string> head523 = new Dictionary<string, string>
{
{ "Authorization", Global.global.serverResponse.data.token }
};
// 请求体
KnightBetBody knightBetBody = new KnightBetBody
{
userId = Global.global.serverResponse.data.userId,
knightId = KnightId,
bet = bet,
horseNo = horseNo
};
// 异步发送请求
string response523 = await web.SendRequest(web.URL + "/snail/gameKnight/userBet", "POST", JsonConvert.SerializeObject(knightBetBody), head523);
// 调试输出接收到的响应
Debug.Log("入参"+ JsonConvert.SerializeObject(knightBetBody) + "5.2.3下注: " + response523);
// 将响应反序列化为对象
try
{
// knightRoomBetList = JsonConvert.DeserializeObject<KnightRoomBetList>(response522);
}
catch (Exception ex)
{
Debug.LogError("反序列化响应失败: " + ex.Message);
}
// 返回解析后的 KnightRoomBetList 对象
return null;
}
}

View File

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

View File

@ -0,0 +1,50 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//测试仅供参考
public class knightTest : MonoBehaviour
{
queryClosestKnight521 queryClosestKnight1 = new queryClosestKnight521();
queryKnightRoomList522 queryKnightRoomList = new queryKnightRoomList522();
SnailKnightBet523 queryClosestKnightBet5 = new SnailKnightBet523();
queryKnightKill524 queryKnightKill = new queryKnightKill524();
ClosestKnight knight;
queryKnightBetResult525 queryKnightBetResult525 = new queryKnightBetResult525();
queryKnightRecord526 queryKnightRecord = new queryKnightRecord526();
UnionPage16 unionPage = new UnionPage16();
UnionDetail17 unionDetail = new UnionDetail17();
GoodIdPage41 goodIdPage41 = new GoodIdPage41();
GoodIdResponse goodidpage = new GoodIdResponse();
async void Start()
{
UnionPage Page = await unionPage.queryUnionPage(1);
//UnionDetalResponse Detail = await unionDetail.queryUnionDetail(1);
goodidpage = await goodIdPage41.queryUnionPage();
//Debug.Log("+++++++++++++++"+ goodidpage.Data.TotalCount);
//knight = await queryClosestKnight1.queryClosestKnight();//查询最近骑士房间
//queryKnightRoomList.queryKnightRoomLis(knight.Data.GameKnightRoomResponseVoList[0].KnightId);
//Debug.Log("=========================================="+knight.Data.GameKnightRoomResponseVoList[0].KnightId);//查询房间详情
////KnightRoomBetList roomBetList = await queryKnightRoomList.queryKnightRoomLis(knight.Data.GameKnightRoomResponseVoList[0].KnightId);//查询房间下注
//await queryClosestKnightBet5.SnailKnightBet(knight.Data.GameKnightRoomResponseVoList[0].KnightId, 20, 3);//下注
////await queryKnightKill.queryKnightKill(knight.Data.GameKnightRoomResponseVoList[0].KnightId);//查询击杀
////await queryKnightBetResult525.queryKnightBetResult(knight.Data.GameKnightRoomResponseVoList[0].KnightId);//查询结算
//// 调用 queryKnightKill 方法,首次延迟 3 秒,之后每 3 秒调用一次
////KnightRecord knightRecord = await queryKnightRecord.queryKnightBetResult(1);//526查询用户战斗记录
//await queryKnightRecord.queryKnightBetResult(1);//526查询用户战斗记录
////Debug.Log("++++++++++++++++++++++++++++++++++++"+knightRecord.data.beansCoinWin);
//InvokeRepeating("RepeatedQueryKnightKill", 1f, 1f);
}
private void RepeatedQueryKnightKill()
{
if (knight != null && knight.Data.GameKnightRoomResponseVoList.Count > 0)
{
// queryKnightBetResult525.queryKnightBetResult(knight.Data.GameKnightRoomResponseVoList[0].KnightId);//查询结算
//queryKnightKill.queryKnightKill(knight.Data.GameKnightRoomResponseVoList[0].KnightId);//查询击杀
}
}
}

View File

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

View File

@ -0,0 +1,56 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Threading.Tasks;
using Newtonsoft.Json;
using System;
//查询最近一场蜗牛骑士游戏详情
public class queryClosestKnight521 : MonoBehaviour
{
//返回的(解析后)
public ClosestKnight closestKnight;
public async Task<ClosestKnight> queryClosestKnight() // 5.2.1
{
// 准备请求的头部信息,包含授权令牌
Dictionary<string, string> head521 = new Dictionary<string, string>
{
{ "Authorization", Global.global.serverResponse.data.token }
};
// 请求体可以为空对象(即 "{}"
string requestBody = "{}";
// 异步发送请求以获取最新的蜗牛骑士信息
string response521 = await web.SendRequest(web.URL + "/snail/gameKnight/queryLatest", "POST", requestBody, head521);
// 调试输出接收到的响应
Debug.Log("5.2.1查询最近一场蜗牛骑士" + response521);
//将响应反序列化为 ClosestKnight 对象
// 将返回的 JSON 字符串反序列化为 ClosestKnight 对象
ClosestKnight closestKnight = JsonConvert.DeserializeObject<ClosestKnight>(response521);
//if (closestKnight != null && closestKnight.Data != null)
//{
// Debug.Log("携带的秒数: " + closestKnight.Data.CarrySeconds);
// Debug.Log("游戏ID: " + closestKnight.Data.GameKnightModel.Id);
// Debug.Log("游戏开始时间: " + closestKnight.Data.GameKnightModel.StartTime);
// // 遍历房间响应列表
// foreach (var room in closestKnight.Data.GameKnightRoomResponseVoList)
// {
// Debug.Log("骑士ID: " + room.KnightId);
// Debug.Log("马匹编号: " + room.HorseNo);
// Debug.Log("马匹用户编号: " + room.HorseUserNo);
// Debug.Log("马匹豆币: " + room.HorseBeansCoin);
// }
//}
// 返回解析后的 closestKnight 对象
return closestKnight;
}
}

View File

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

View File

@ -0,0 +1,55 @@
using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
//5.2.4查询结算
public class queryKnightBetResult525 : MonoBehaviour
{
//返回的(解析后)
public KnightBetResult knightBetResult;//===========================================================================================
public async Task<KnightBetResult> queryKnightBetResult(int KnightId) // 5.2.2//需传入KightId
{
// 准备请求的头部信息,包含授权令牌
Dictionary<string, string> head525 = new Dictionary<string, string>
{
{ "Authorization", Global.global.serverResponse.data.token }
};
// 请求体
QueryKnightRoomListBody queryKnightRoomListBody = new QueryKnightRoomListBody
{
userId = Global.global.serverResponse.data.userId,
knightId = KnightId
};
Debug.Log("524接收的=========================" + KnightId);
// 异步发送请求
//string response525 = await web.SendRequest(web.URL + "/snail/gameKnight/queryUserBetResult", "POST", JsonUtility.ToJson(queryKnightRoomListBody), head525);
string response525 = await web.SendRequest(web.URL + "/snail/gameKnight/queryKill", "POST", JsonConvert.SerializeObject(queryKnightRoomListBody), head525);
// 调试输出接收到的响应
Debug.Log("5.2.5查询骑士结算:======== " + response525);
// 将响应反序列化为 KnightRoomList 对象
try
{
knightBetResult = JsonConvert.DeserializeObject<KnightBetResult>(response525);
if (knightBetResult != null && knightBetResult.data != null)//==================================================访问之前先判空未到或已过时间data[]为空
{
Debug.Log(knightBetResult.data.beansCoinFee + "=525========");
}
}
catch (Exception ex)
{
Debug.LogError("反序列化响应失败: " + ex.Message);
}
// 返回解析后的 对象
return knightBetResult;
}
}

View File

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

View File

@ -0,0 +1,61 @@
using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
//5.2.4查询击杀
public class queryKnightKill524 : MonoBehaviour
{
//返回的(解析后)
public KnightKill knightKill;
//async void Start()
//{
// KnightKill result = await queryKnightKill(39592); // =============================== 示例,仅供测试
// if (result != null)
// {
// Debug.Log("请求成功Code: " + result.Code);
// }
//}
public async Task<KnightKill> queryKnightKill(int KnightId) // 5.2.2//需传入KightId
{
// 准备请求的头部信息,包含授权令牌
Dictionary<string, string> head524 = new Dictionary<string, string>
{
{ "Authorization", Global.global.serverResponse.data.token }
};
// 请求体
QueryKnightRoomListBody queryKnightRoomListBody = new QueryKnightRoomListBody
{
userId = Global.global.serverResponse.data.userId,
knightId = KnightId
};
Debug.Log(queryKnightRoomListBody);
// 异步发送请求
//string response524 = await web.SendRequest(web.URL + "/snail/gameKnight/queryKill", "POST", JsonUtility.ToJson(queryKnightRoomListBody), head524);
string response524 = await web.SendRequest(web.URL + "/snail/gameKnight/queryKill", "POST", JsonConvert.SerializeObject(queryKnightRoomListBody), head524);
// 调试输出接收到的响应
Debug.Log("5.2.4查询击杀(骑士):=============== " + response524);
// 将响应反序列化为 KnightRoomList 对象
try
{
knightKill = JsonConvert.DeserializeObject<KnightKill>(response524);
if (knightKill != null && knightKill.data != null)//==================================================访问之前先判空未到或已过时间data[]为空
{
Debug.Log(knightKill.data.beansCoinFee + "=524========");
}
}
catch (Exception ex)
{
Debug.LogError("反序列化响应失败: " + ex.Message);
}
//返回解析后的 KnightKill 对象
return knightKill;//knightKill;
}
}

View File

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

View File

@ -0,0 +1,77 @@
using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
//526查询用户战斗记录
public class queryKnightRecord526 : MonoBehaviour
{
KnightRecord knightRecord = new KnightRecord();
public async Task<KnightRecord> queryKnightBetResult(int orderByDesc) // 5.2.6
{
// 准备请求的头部信息,包含授权令牌
Dictionary<string, string> head526 = new Dictionary<string, string>
{
{ "Authorization", Global.global.serverResponse.data.token }
};
// 请求体
QueryKnightRecordBody queryKnightRecordBody = new QueryKnightRecordBody
{
userId = Global.global.serverResponse.data.userId,
orderByDesc = orderByDesc
};
// 异步发送请求
string response526 = await web.SendRequest(web.URL + "/snail/gameKnight/queryUserRecord", "POST", JsonUtility.ToJson(queryKnightRecordBody), head526);
// 调试输出接收到的响应
Debug.Log("5.2.6查询用户战斗记录 =====================" + response526);
// 将响应反序列化为 KnightRoomList 对象
KnightRecord knightRecord = JsonConvert.DeserializeObject<KnightRecord>(response526);
// 检查反序列化是否成功
if (knightRecord != null && knightRecord.data != null)
{
// 打印基本信息
Debug.Log("Code: " + knightRecord.code);
Debug.Log("Message: " + knightRecord.message);
Debug.Log("Total Beans Coin Bet: " + knightRecord.data.beansCoinBet);
Debug.Log("Total Beans Coin Win: " + knightRecord.data.beansCoinWin);
// 获取战斗记录列表
List<GameKnightModelRecord> gameList = knightRecord.data.gameKnightModelList;
if (gameList != null && gameList.Count > 0)
{
foreach (GameKnightModelRecord game in gameList)
{
Debug.Log("Game ID: " + game.id);
Debug.Log("Game No: " + game.gameNo);
Debug.Log("Game Session: " + game.gameSession);
Debug.Log("Start Time: " + game.startTime);
Debug.Log("Bet Time: " + game.betTime);
Debug.Log("Count Time: " + game.countTime);
Debug.Log("Settle Time: " + game.settleTime);
Debug.Log("Status: " + game.status);
Debug.Log("Horse No All: " + game.horseNoAll);
Debug.Log("Horse No Kill: " + game.horseNoKill);
Debug.Log("Horse No Remain: " + game.horseNoRemain);
Debug.Log("Beans Coin All: " + game.beansCoinAll);
Debug.Log("Beans Coin Kill: " + game.beansCoinKill);
Debug.Log("Beans Coin Remain: " + game.beansCoinRemain);
Debug.Log("Beans Coin Fee: " + game.beansCoinFee);
Debug.Log("Beans Coin Divide: " + game.beansCoinDivide);
}
}
}
else
{
Debug.LogError("KnightRecord or KnightRecord data is null");
}
return knightRecord;
}
}

View File

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

View File

@ -0,0 +1,55 @@
using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
//查询马匹最新下注情况5.2.2
public class queryKnightRoomList522 : MonoBehaviour
{
//返回的(解析后)
public KnightRoomBetList knightRoomBetList;
public async Task<KnightRoomBetList> queryKnightRoomLis(int KnightId) // 5.2.2//需传入KightId
{
// 准备请求的头部信息,包含授权令牌
Dictionary<string, string> head522 = new Dictionary<string, string>
{
{ "Authorization", Global.global.serverResponse.data.token }
};
// 请求体
QueryKnightRoomListBody queryKnightRoomListBody = new QueryKnightRoomListBody
{
knightId = KnightId,
userId = Global.global.serverResponse.data.userId
};
// 异步发送请求
string response522 = await web.SendRequest(web.URL + "/snail/gameKnight/queryKnightRoomList", "POST", JsonConvert.SerializeObject(queryKnightRoomListBody), head522);
// 调试输出接收到的响应
Debug.Log("5.2.2马匹最新下注情况: " + response522);
// 将服务器返回的 JSON 字符串反序列化为 KnightRoomBetList 对象
KnightRoomBetList knightRoomBetList = JsonConvert.DeserializeObject<KnightRoomBetList>(response522);
//if (knightRoomBetList != null && knightRoomBetList.Data != null)
//{
// Debug.Log("解析成功,响应代码: " + knightRoomBetList.Code);
// Debug.Log("携带的秒数: " + knightRoomBetList.Data.CarrySeconds);
// foreach (var room in knightRoomBetList.Data.GameKnightRoomResponseVoList)
// {
// Debug.Log("骑士ID: " + room.KnightId);
// Debug.Log("马匹编号: " + room.HorseNo);
// Debug.Log("马匹用户编号: " + room.HorseUserNo);
// Debug.Log("马匹豆币: " + room.HorseBeansCoin);
// }
//}
// 返回解析后的 KnightRoomBetList 对象
return knightRoomBetList;
}
}

View File

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

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3dea1861b2f2903479d9666ec4a49f08
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -14,12 +14,9 @@ public class UnionDetail17 : MonoBehaviour
{
{ "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);
string response17 = await web.SendRequest(web.URL + "/snail/union/queryInfo?unionId=1", "GET","{}", head17);
// 调试输出接收到的响应
Debug.Log("1.7查询工会详情========================================" + response17);

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 36aa28680afd43b44b8d8d98d252aee4
guid: c2d3d913add235b478bf80131a3f47c1
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 014dd20b3c78ff94c89f0b6607ff6c45
guid: f1964ad260309f746839b47ae044d662
MonoImporter:
externalObjects: {}
serializedVersion: 2