From 91d6cd534d6bf59adf3ab6851ba62b818ebf15ba Mon Sep 17 00:00:00 2001 From: HuangZiBo <1278481331@qq.com> Date: Tue, 26 Nov 2024 00:07:12 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9D=93=E5=8F=B7=E6=B1=A0=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E3=80=81=E5=B7=A5=E4=BC=9A=E5=88=86=E9=A1=B5=E3=80=81=E5=B7=A5?= =?UTF-8?q?=E4=BC=9A=E8=AF=A6=E6=83=85=E3=80=81=E8=9C=97=E7=89=9B=E9=AA=91?= =?UTF-8?q?=E5=A3=AB=E5=85=A8=E9=83=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/{HZB.meta => Scripts/GoodId.meta} | 2 +- .../Assets/Scripts/GoodId/GoodIdPage41.cs | 36 ++ .../Scripts/GoodId/GoodIdPage41.cs.meta | 11 + .../Assets/Scripts/Login/Global.cs | 419 ++++++++++++++---- .../Assets/Scripts/SnailKnight52.meta | 8 + .../SnailKnight52/SnailKnightBet523.cs | 55 +++ .../SnailKnight52/SnailKnightBet523.cs.meta | 11 + .../Scripts/SnailKnight52/knightTest.cs | 50 +++ .../Scripts/SnailKnight52/knightTest.cs.meta | 11 + .../SnailKnight52/queryClosestKnight521.cs | 56 +++ .../queryClosestKnight521.cs.meta | 11 + .../SnailKnight52/queryKnightBetResult525.cs | 55 +++ .../queryKnightBetResult525.cs.meta | 11 + .../SnailKnight52/queryKnightKill524.cs | 61 +++ .../SnailKnight52/queryKnightKill524.cs.meta | 11 + .../SnailKnight52/queryKnightRecord526.cs | 77 ++++ .../queryKnightRecord526.cs.meta | 11 + .../SnailKnight52/queryKnightRoomList522.cs | 55 +++ .../queryKnightRoomList522.cs.meta | 11 + TheStrongestSnail/Assets/Scripts/Union16.meta | 8 + .../{HZB => Scripts/Union16}/UnionDetail17.cs | 7 +- .../Union16}/UnionDetail17.cs.meta | 2 +- .../{HZB => Scripts/Union16}/UnionPage16.cs | 0 .../Union16}/UnionPage16.cs.meta | 2 +- 24 files changed, 882 insertions(+), 99 deletions(-) rename TheStrongestSnail/Assets/{HZB.meta => Scripts/GoodId.meta} (77%) create mode 100644 TheStrongestSnail/Assets/Scripts/GoodId/GoodIdPage41.cs create mode 100644 TheStrongestSnail/Assets/Scripts/GoodId/GoodIdPage41.cs.meta create mode 100644 TheStrongestSnail/Assets/Scripts/SnailKnight52.meta create mode 100644 TheStrongestSnail/Assets/Scripts/SnailKnight52/SnailKnightBet523.cs create mode 100644 TheStrongestSnail/Assets/Scripts/SnailKnight52/SnailKnightBet523.cs.meta create mode 100644 TheStrongestSnail/Assets/Scripts/SnailKnight52/knightTest.cs create mode 100644 TheStrongestSnail/Assets/Scripts/SnailKnight52/knightTest.cs.meta create mode 100644 TheStrongestSnail/Assets/Scripts/SnailKnight52/queryClosestKnight521.cs create mode 100644 TheStrongestSnail/Assets/Scripts/SnailKnight52/queryClosestKnight521.cs.meta create mode 100644 TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightBetResult525.cs create mode 100644 TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightBetResult525.cs.meta create mode 100644 TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightKill524.cs create mode 100644 TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightKill524.cs.meta create mode 100644 TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightRecord526.cs create mode 100644 TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightRecord526.cs.meta create mode 100644 TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightRoomList522.cs create mode 100644 TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightRoomList522.cs.meta create mode 100644 TheStrongestSnail/Assets/Scripts/Union16.meta rename TheStrongestSnail/Assets/{HZB => Scripts/Union16}/UnionDetail17.cs (80%) rename TheStrongestSnail/Assets/{HZB => Scripts/Union16}/UnionDetail17.cs.meta (83%) rename TheStrongestSnail/Assets/{HZB => Scripts/Union16}/UnionPage16.cs (100%) rename TheStrongestSnail/Assets/{HZB => Scripts/Union16}/UnionPage16.cs.meta (83%) diff --git a/TheStrongestSnail/Assets/HZB.meta b/TheStrongestSnail/Assets/Scripts/GoodId.meta similarity index 77% rename from TheStrongestSnail/Assets/HZB.meta rename to TheStrongestSnail/Assets/Scripts/GoodId.meta index a00b53f..e30238d 100644 --- a/TheStrongestSnail/Assets/HZB.meta +++ b/TheStrongestSnail/Assets/Scripts/GoodId.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 32d2d8bdea868e946abaa072cd0ae8fc +guid: 112f9d113bc470a49a2fc0ca3814a705 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/TheStrongestSnail/Assets/Scripts/GoodId/GoodIdPage41.cs b/TheStrongestSnail/Assets/Scripts/GoodId/GoodIdPage41.cs new file mode 100644 index 0000000..03af1b9 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/GoodId/GoodIdPage41.cs @@ -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 queryUnionPage() // 4.1 + { + // 准备请求的头部信息,包含授权令牌 + Dictionary head41 = new Dictionary + { + { "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(response41); + Debug.Log("8==================================D"+goodIdResponse.Data.TotalCount); + return goodIdResponse; + + } +} diff --git a/TheStrongestSnail/Assets/Scripts/GoodId/GoodIdPage41.cs.meta b/TheStrongestSnail/Assets/Scripts/GoodId/GoodIdPage41.cs.meta new file mode 100644 index 0000000..ba8fc61 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/GoodId/GoodIdPage41.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5c632a5d90e3a974ca1f15e7e470100f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TheStrongestSnail/Assets/Scripts/Login/Global.cs b/TheStrongestSnail/Assets/Scripts/Login/Global.cs index 62b920c..c754c34 100644 --- a/TheStrongestSnail/Assets/Scripts/Login/Global.cs +++ b/TheStrongestSnail/Assets/Scripts/Login/Global.cs @@ -1,4 +1,4 @@ -using System; +锘縰sing System; using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -17,14 +17,14 @@ public class Global : MonoBehaviour DontDestroyOnLoad(this); } - // 创建请求头,使用最新的 token + // 鍒涘缓璇锋眰澶达紝浣跨敤鏈鏂扮殑 token public Dictionary CreateHeaders() { if (string.IsNullOrEmpty(Global.global.serverResponse.data.token)) { - Debug.LogWarning("尝试创建请求头时,token 未设置。"); + Debug.LogWarning("灏濊瘯鍒涘缓璇锋眰澶存椂锛宼oken 鏈缃"); return new Dictionary(); } @@ -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; // 娓告垙鐨処D + 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;//鍙備笌璁板綍姝e簭鎴栧掑彊锛1姝e簭锛屽叾浠栧掑彊 + public int weekType;//1鏄槰澶╋紝0鏄粖澶 } [Serializable] public class Data { - public int carrySeconds; // 携带时间秒数 - public List gameEscapeRoomResponseVoList; // 房间列表 - public GameEscapeModel gameEscapeModel; // 游戏逃亡模型 (目前未处理) - public object gameEscapeUserModel; // 游戏逃亡用户模型 (目前未处理) + public int carrySeconds; // 鎼哄甫鏃堕棿绉掓暟 + public List 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;//铚楀3 + 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锟斤拷询锟斤拷锟 +public class ClosestKnight : Response +{ + public ClosestKnightData Data { get; set; } +} + +public class ClosestKnightData +{ + public int CarrySeconds { get; set; } + public GameKnightModel GameKnightModel { get; set; } + public List GameKnightRoomResponseVoList { get; set; } + public List 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 +{ + // 锟斤拷锟斤拷锟斤拷姆锟斤拷锟絁SON锟斤拷GameKnightUserModelList锟斤拷一锟斤拷锟斤拷锟斤拷锟介。锟斤拷锟斤拷锟斤拷锟斤拷芯锟斤拷锟斤拷侄危锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷侄巍锟 +} +//====522===================================================== +//锟斤拷锟斤拷锟斤拷 +public class QueryKnightRoomListBody +{ + public int userId { get; set; } + public int knightId { get; set; } +} +//锟斤拷锟斤拷 +public class KnightRoomBetList +{ + public int Code { get; set; } // 锟斤拷应锟斤拷锟斤拷 + public string Message { get; set; } // 锟斤拷应锟斤拷息 + public KnightRoomBetData Data { get; set; } // 锟斤拷锟捷诧拷锟斤拷 +} + +public class KnightRoomBetData +{ + public int CarrySeconds { get; set; } // 携锟斤拷锟斤拷锟斤拷锟斤拷 + public GameKnightModel GameKnightModel { get; set; } // 锟斤拷戏锟斤拷士模锟酵o拷锟斤拷锟斤拷为null + public List GameKnightRoomResponseVoList { get; set; } // 锟斤拷士锟斤拷锟斤拷锟斤拷应锟叫憋拷 + public List GameKnightUserModelList { get; set; } // 锟斤拷士锟矫伙拷模锟斤拷锟叫憋拷锟斤拷锟斤拷锟斤拷为null +} + +public class GameKnightModel2 +{ + // 锟斤拷为示锟斤拷锟叫碉拷 `gameKnightModel` 为 null锟斤拷锟斤拷锟斤拷锟斤拷锟绞憋拷锟斤拷锟斤拷锟街讹拷 + // 锟斤拷锟斤拷锟剿会返锟截该诧拷锟街o拷锟斤拷锟斤拷锟斤拷锟斤拷锟叫╋拷侄锟 + 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; } // 锟斤拷士ID + public int HorseNo { get; set; } // 锟斤拷匹锟斤拷锟 + public int HorseUserNo { get; set; } // 锟斤拷匹锟矫伙拷锟斤拷锟 + public decimal HorseBeansCoin { get; set; } // 锟斤拷匹锟斤拷锟揭o拷注锟斤拷锟斤拷锟斤拷使锟斤拷 decimal 锟皆憋拷锟节达拷锟斤拷锟斤拷锟斤拷确锟侥斤拷锟斤拷锟斤拷荩锟 +} + +public class GameKnightUserModel2 +{ + // 锟斤拷为示锟斤拷锟叫碉拷 `gameKnightUserModelList` 为 null锟斤拷锟斤拷锟斤拷锟斤拷时锟斤拷锟斤拷锟斤拷侄锟 + // 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷侄锟斤拷锟较拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 +} +//========523====================================================== +public class KnightBetBody +{ + public int knightId { get; set; } + public int userId { get; set; } + public int horseNo { get; set; } + public float bet { get; set; } +} +//锟斤拷锟斤拷 +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 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鍙兘涓簄ull锛屼笖绫诲瀷鏈槑纭紝杩欓噷浣跨敤object绫诲瀷锛屽彲鏍规嵁瀹為檯鎯呭喌璋冩暣涓篋ateTime?鎴栧叾浠栫被鍨 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; } // 鍙互鏍规嵁瀹為檯鎯呭喌璋冩暣涓篋ateTime? public string UpdateTime { get; set; } } @@ -380,4 +597,24 @@ public class UnionDetalResponseData public class UnionDetalResponse : Response { public UnionDetalResponseData Data { get; set; } -} \ No newline at end of file +} +//====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 DataList { get; set; } // 鐢变簬dataList涓虹┖鏁扮粍锛屾湭缁欏嚭鍏蜂綋绫诲瀷锛岃繖閲屼娇鐢↙ist +} + +public class GoodIdResponse : Response +{ + public GoodIdData Data { get; set; } +} +//====================== \ No newline at end of file diff --git a/TheStrongestSnail/Assets/Scripts/SnailKnight52.meta b/TheStrongestSnail/Assets/Scripts/SnailKnight52.meta new file mode 100644 index 0000000..9323fcd --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/SnailKnight52.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9b1844214eeaf9f4cb67fe760a9b80a5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TheStrongestSnail/Assets/Scripts/SnailKnight52/SnailKnightBet523.cs b/TheStrongestSnail/Assets/Scripts/SnailKnight52/SnailKnightBet523.cs new file mode 100644 index 0000000..cbfb75b --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/SnailKnight52/SnailKnightBet523.cs @@ -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 SnailKnightBet(int KnightId,float bet,int horseNo) + { + // 准备请求的头部信息,包含授权令牌 + Dictionary head523 = new Dictionary + { + { "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(response522); + + } + catch (Exception ex) + { + Debug.LogError("反序列化响应失败: " + ex.Message); + } + + // 返回解析后的 KnightRoomBetList 对象 + return null; + } +} diff --git a/TheStrongestSnail/Assets/Scripts/SnailKnight52/SnailKnightBet523.cs.meta b/TheStrongestSnail/Assets/Scripts/SnailKnight52/SnailKnightBet523.cs.meta new file mode 100644 index 0000000..46b3c77 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/SnailKnight52/SnailKnightBet523.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6e896077188de3f47b0e618eb84a8fd9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TheStrongestSnail/Assets/Scripts/SnailKnight52/knightTest.cs b/TheStrongestSnail/Assets/Scripts/SnailKnight52/knightTest.cs new file mode 100644 index 0000000..ace4070 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/SnailKnight52/knightTest.cs @@ -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);//查询击杀 + + } + } +} diff --git a/TheStrongestSnail/Assets/Scripts/SnailKnight52/knightTest.cs.meta b/TheStrongestSnail/Assets/Scripts/SnailKnight52/knightTest.cs.meta new file mode 100644 index 0000000..a8d2039 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/SnailKnight52/knightTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 10093cb6eece78d4a95d49de75ff947e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryClosestKnight521.cs b/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryClosestKnight521.cs new file mode 100644 index 0000000..be52bde --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryClosestKnight521.cs @@ -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 queryClosestKnight() // 5.2.1 + + { + // 准备请求的头部信息,包含授权令牌 + Dictionary head521 = new Dictionary + { + { "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(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; + } + +} diff --git a/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryClosestKnight521.cs.meta b/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryClosestKnight521.cs.meta new file mode 100644 index 0000000..9be0826 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryClosestKnight521.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a2d0d821a605ea7498b3cedb2ca28f11 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightBetResult525.cs b/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightBetResult525.cs new file mode 100644 index 0000000..da4cc79 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightBetResult525.cs @@ -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 queryKnightBetResult(int KnightId) // 5.2.2//需传入KightId + { + // 准备请求的头部信息,包含授权令牌 + Dictionary head525 = new Dictionary + { + { "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(response525); + if (knightBetResult != null && knightBetResult.data != null)//==================================================访问之前先判空,未到或已过时间,data[]为空 + { + Debug.Log(knightBetResult.data.beansCoinFee + "=525========"); + } + } + catch (Exception ex) + { + Debug.LogError("反序列化响应失败: " + ex.Message); + } + + // 返回解析后的 对象 + return knightBetResult; + } +} \ No newline at end of file diff --git a/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightBetResult525.cs.meta b/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightBetResult525.cs.meta new file mode 100644 index 0000000..6a893f6 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightBetResult525.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 295cf647a60c88f439ecebe50ce259f3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightKill524.cs b/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightKill524.cs new file mode 100644 index 0000000..ac0b71f --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightKill524.cs @@ -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 queryKnightKill(int KnightId) // 5.2.2//需传入KightId + { + // 准备请求的头部信息,包含授权令牌 + Dictionary head524 = new Dictionary + { + { "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(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; + } +} diff --git a/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightKill524.cs.meta b/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightKill524.cs.meta new file mode 100644 index 0000000..544e1cb --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightKill524.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1b76d6f4e2bc28447a943f506495f9b1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightRecord526.cs b/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightRecord526.cs new file mode 100644 index 0000000..1693d96 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightRecord526.cs @@ -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 queryKnightBetResult(int orderByDesc) // 5.2.6 + { + // 准备请求的头部信息,包含授权令牌 + Dictionary head526 = new Dictionary + { + { "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(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 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; + } +} \ No newline at end of file diff --git a/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightRecord526.cs.meta b/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightRecord526.cs.meta new file mode 100644 index 0000000..f0d9b35 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightRecord526.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 400921030002e814d974d30c49f6298e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightRoomList522.cs b/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightRoomList522.cs new file mode 100644 index 0000000..f23de1a --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightRoomList522.cs @@ -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 queryKnightRoomLis(int KnightId) // 5.2.2//需传入KightId + { + // 准备请求的头部信息,包含授权令牌 + Dictionary head522 = new Dictionary + { + { "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(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; + } +} \ No newline at end of file diff --git a/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightRoomList522.cs.meta b/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightRoomList522.cs.meta new file mode 100644 index 0000000..b188eb7 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightRoomList522.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4529518a2ba53284ab7072b7979ca356 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TheStrongestSnail/Assets/Scripts/Union16.meta b/TheStrongestSnail/Assets/Scripts/Union16.meta new file mode 100644 index 0000000..3fe364e --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/Union16.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3dea1861b2f2903479d9666ec4a49f08 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TheStrongestSnail/Assets/HZB/UnionDetail17.cs b/TheStrongestSnail/Assets/Scripts/Union16/UnionDetail17.cs similarity index 80% rename from TheStrongestSnail/Assets/HZB/UnionDetail17.cs rename to TheStrongestSnail/Assets/Scripts/Union16/UnionDetail17.cs index 1d6937f..b052941 100644 --- a/TheStrongestSnail/Assets/HZB/UnionDetail17.cs +++ b/TheStrongestSnail/Assets/Scripts/Union16/UnionDetail17.cs @@ -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); diff --git a/TheStrongestSnail/Assets/HZB/UnionDetail17.cs.meta b/TheStrongestSnail/Assets/Scripts/Union16/UnionDetail17.cs.meta similarity index 83% rename from TheStrongestSnail/Assets/HZB/UnionDetail17.cs.meta rename to TheStrongestSnail/Assets/Scripts/Union16/UnionDetail17.cs.meta index 5590e85..c8bbda0 100644 --- a/TheStrongestSnail/Assets/HZB/UnionDetail17.cs.meta +++ b/TheStrongestSnail/Assets/Scripts/Union16/UnionDetail17.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 36aa28680afd43b44b8d8d98d252aee4 +guid: c2d3d913add235b478bf80131a3f47c1 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/TheStrongestSnail/Assets/HZB/UnionPage16.cs b/TheStrongestSnail/Assets/Scripts/Union16/UnionPage16.cs similarity index 100% rename from TheStrongestSnail/Assets/HZB/UnionPage16.cs rename to TheStrongestSnail/Assets/Scripts/Union16/UnionPage16.cs diff --git a/TheStrongestSnail/Assets/HZB/UnionPage16.cs.meta b/TheStrongestSnail/Assets/Scripts/Union16/UnionPage16.cs.meta similarity index 83% rename from TheStrongestSnail/Assets/HZB/UnionPage16.cs.meta rename to TheStrongestSnail/Assets/Scripts/Union16/UnionPage16.cs.meta index 2c9857d..daac67c 100644 --- a/TheStrongestSnail/Assets/HZB/UnionPage16.cs.meta +++ b/TheStrongestSnail/Assets/Scripts/Union16/UnionPage16.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 014dd20b3c78ff94c89f0b6607ff6c45 +guid: f1964ad260309f746839b47ae044d662 MonoImporter: externalObjects: {} serializedVersion: 2