_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/kuangChang10/queryMiningContractList101.cs

63 lines
2.3 KiB
C#
Raw Normal View History

2024-12-02 17:51:28 +08:00
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
//10.1<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڿ<EFBFBD><EFBFBD><EFBFBD>Լ
public class queryMiningContractList101 : MonoBehaviour
{
public async Task<MiningContractList> QueryMiningContract()
{
// ׼<><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> head = new Dictionary<string, string>
{
{ "Authorization", Global.global.serverResponse.data.token }
};
// <20><EFBFBD><ECB2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ի<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>ţ<EFBFBD><C5A3>ʿ<EFBFBD><CABF>Ϣ
string response0101 = await web.SendRequest(web.URL + "/snail/mining/queryMiningContractList", "POST", "{}", head);
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD>Ӧ
Debug.Log("10.1<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڿ<EFBFBD><EFBFBD><EFBFBD>Լ" + response0101);
// <20><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>
MiningContractList miningContractList = JsonConvert.DeserializeObject<MiningContractList>(response0101);
2024-12-05 15:49:54 +08:00
// <20><><EFBFBD><EFBFBD> miningContractList.data <20>б<EFBFBD><D0B1>е<EFBFBD>ÿ<EFBFBD><C3BF> MiningContract <20><><EFBFBD><EFBFBD>
2024-12-05 17:02:12 +08:00
//foreach (var contract in miningContractList.data)
//{
// Debug.Log($"<22><>ԼID: {contract.id}");
// Debug.Log($"<22><>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD>: {contract.name}");
// Debug.Log($"״̬: {contract.status}");
// Debug.Log($"<22>ϼ<EFBFBD>״̬: {contract.onShelves}");
// Debug.Log($"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> VoluteCoin: {contract.voluteCoinBuy}");
// Debug.Log($"<22>ڿ<EFBFBD><DABF><EFBFBD><EFBFBD><EFBFBD>: {contract.miningDays}");
// Debug.Log($"<22>ڿ<EFBFBD><DABF><EFBFBD><EFBFBD><EFBFBD> VoluteCoin: {contract.voluteCoinReward}");
// Debug.Log($"ÿ<><EFBFBD><EBBDB1>: {contract.eachSecondsReward}");
// Debug.Log($"<22><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>: {contract.createTime}");
// Debug.Log($"<22><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>: {contract.updateTime}");
//}
2024-12-02 17:51:28 +08:00
// <20><><EFBFBD>ؽ<EFBFBD><D8BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD>
return miningContractList;
}
}
//=====<3D><><EFBFBD><EFBFBD>================================================================
public class MiningContractList:Response
{
public List<MiningContract> data { get; set; }
}
public class MiningContract
{
public long id { get; set; }
public string name { get; set; }
public int status { get; set; }
public int onShelves { get; set; }
public double voluteCoinBuy { get; set; }
public int miningDays { get; set; }
public double voluteCoinReward { get; set; }
public double eachSecondsReward { get; set; }
public string createTime { get; set; }
public string updateTime { get; set; }
}