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.3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ
|
|
|
|
|
public class buyMiningContract103 : MonoBehaviour
|
|
|
|
|
{
|
2024-12-05 21:23:44 +08:00
|
|
|
|
public async Task<BuyMiningResponse> BuyMiningContract(long contractId) // 9.1
|
2024-12-02 17:51:28 +08:00
|
|
|
|
{
|
|
|
|
|
// <><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 }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
queryPlayerInfo queryPlayerInfo = new queryPlayerInfo();
|
|
|
|
|
RealPlayerInfo realPlayerInfo = await queryPlayerInfo.QueryPlayerInfoPro();
|
|
|
|
|
BuyMiningContractBody body = new BuyMiningContractBody();
|
|
|
|
|
body.userId = realPlayerInfo.data.userId;
|
|
|
|
|
body.contractId = contractId;
|
|
|
|
|
|
2024-12-05 17:02:12 +08:00
|
|
|
|
Debug.Log(JsonConvert.SerializeObject(body)+"====<3D><><EFBFBD><EFBFBD>====");
|
2024-12-02 17:51:28 +08:00
|
|
|
|
// <20>첽<EFBFBD><ECB2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ի<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>ţ<EFBFBD><C5A3>ʿ<EFBFBD><CABF>Ϣ
|
|
|
|
|
string response0103 = await web.SendRequest(web.URL + "/snail/mining/buyMiningContract" , "POST", JsonConvert.SerializeObject(body), head);
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD>Ӧ
|
|
|
|
|
Debug.Log("10.3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ" + response0103);
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>
|
|
|
|
|
BuyMiningResponse buyMiningResponse = JsonConvert.DeserializeObject<BuyMiningResponse>(response0103);
|
2024-12-05 21:23:44 +08:00
|
|
|
|
Debug.Log("10.3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><EFBFBD>ID" + buyMiningResponse.data);
|
2024-12-02 17:51:28 +08:00
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD>ؽ<EFBFBD><D8BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD>
|
2024-12-05 21:23:44 +08:00
|
|
|
|
return buyMiningResponse;
|
2024-12-02 17:51:28 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//==========<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>===========================
|
|
|
|
|
|
|
|
|
|
public class BuyMiningContractBody
|
|
|
|
|
{
|
|
|
|
|
public long contractId;
|
|
|
|
|
public long userId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//==========<3D><><EFBFBD><EFBFBD>ֵ===========================
|
|
|
|
|
public class BuyMiningResponse : Response
|
|
|
|
|
{
|
2024-12-05 21:23:44 +08:00
|
|
|
|
public long data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class BuyResponse
|
|
|
|
|
{
|
|
|
|
|
public long id;
|
|
|
|
|
}
|