_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/SnailKnight52/queryKnightBetResult525.cs

98 lines
3.0 KiB
C#
Raw Normal View History

using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
2024-12-04 14:42:07 +08:00
//5.2.5<EFBFBD><EFBFBD>ѯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public class queryKnightBetResult525 : MonoBehaviour
{
//<2F><><EFBFBD>صģ<D8B5><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public KnightBetResult knightBetResult;//===========================================================================================
2024-12-04 14:42:07 +08:00
public async Task<KnightBetResult> queryKnightBetResult(int KnightId) //
{
// ׼<><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><C8A8><EFBFBD><EFBFBD>
Dictionary<string, string> head525 = new Dictionary<string, string>
{
{ "Authorization", Global.global.serverResponse.data.token }
};
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
QueryKnightRoomListBody queryKnightRoomListBody = new QueryKnightRoomListBody
{
userId = Global.global.serverResponse.data.userId,
knightId = KnightId
};
2024-12-04 14:42:07 +08:00
Debug.Log("525<32><35><EFBFBD>յ<EFBFBD>=========================" + KnightId);
// <20><EFBFBD><ECB2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//string response525 = await web.SendRequest(web.URL + "/snail/gameKnight/queryUserBetResult", "POST", JsonUtility.ToJson(queryKnightRoomListBody), head525);
2024-12-04 14:42:07 +08:00
string response525 = await web.SendRequest(web.URL + "/snail/gameKnight/queryUserBetResult", "POST", JsonConvert.SerializeObject(queryKnightRoomListBody), head525);
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD>Ӧ
Debug.Log("5.2.5<EFBFBD><EFBFBD>ѯ<EFBFBD><EFBFBD>ʿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:======== " + response525);
// <20><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD>Ϊ KnightRoomList <20><><EFBFBD><EFBFBD>
try
{
knightBetResult = JsonConvert.DeserializeObject<KnightBetResult>(response525);
if (knightBetResult != null && knightBetResult.data != null)//==================================================<3D><><EFBFBD><EFBFBD>֮ǰ<D6AE><C7B0><EFBFBD>пգ<D0BF>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD>ʱ<EFBFBD>䣬data[]Ϊ<><CEAA>
{
2024-12-04 14:42:07 +08:00
Debug.Log(knightBetResult.data.updateTime + "=525=8=======D");
}
}
catch (Exception ex)
{
Debug.LogError("<22><><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><D0BB><EFBFBD>Ӧʧ<D3A6><CAA7>: " + ex.Message);
}
// <20><><EFBFBD>ؽ<EFBFBD><D8BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
return knightBetResult;
}
2024-12-04 14:42:07 +08:00
}
//==========525====================================================
[Serializable]
public class KnightBetResult : Response
{
public KnightBetResultData data;
[Serializable]
public class KnightBetResultData
{
public int id;
public string gameNo;
public int knightId;
public int userId;
public float bet;
public int horseNo;
public int outcome;
public float win;
public float beansCoin;
public float ichorCoin;
public string createTime;
public string updateTime;
}
}
//{
// "code": 200,
// "message": "<22><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>",
// "data": [
// {
// "id": 2706972,
// "gameNo": "202412041130",
// "knightId": 54695,
// "userId": 112,
// "bet": 50,
// "horseNo": 1,
// "outcome": 2,
// "win": 1,
// "beansCoin": 0,
// "ichorCoin": 5,
// "createTime": null,
// "updateTime": "2024-12-04 11:31:49"
// }
// ]
//}