From ce9392a015072fc06877e31452eace6df72644f6 Mon Sep 17 00:00:00 2001 From: HuangZiBo <1278481331@qq.com> Date: Mon, 2 Dec 2024 17:51:28 +0800 Subject: [PATCH] =?UTF-8?q?10.*=E8=9C=97=E7=89=9B=E7=9F=BF=E5=9C=BA?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Scripts/kuangChang10.meta | 8 ++ .../Scripts/kuangChang10/KuangChangTest.cs | 40 +++++++ .../kuangChang10/KuangChangTest.cs.meta | 11 ++ .../Assets/Scripts/kuangChang10/bindSlot.cs | 44 ++++++++ .../Scripts/kuangChang10/bindSlot.cs.meta | 11 ++ .../kuangChang10/buyMiningContract103.cs | 51 +++++++++ .../kuangChang10/buyMiningContract103.cs.meta | 11 ++ .../Scripts/kuangChang10/openSlot105.cs | 39 +++++++ .../Scripts/kuangChang10/openSlot105.cs.meta | 11 ++ .../queryMiningContracDetail102.cs | 58 ++++++++++ .../queryMiningContracDetail102.cs.meta | 11 ++ .../queryMiningContractList101.cs | 63 +++++++++++ .../queryMiningContractList101.cs.meta | 11 ++ .../kuangChang10/queryMyPureContract106.cs | 75 +++++++++++++ .../queryMyPureContract106.cs.meta | 11 ++ .../kuangChang10/queryUserMiningSlot104.cs | 100 ++++++++++++++++++ .../queryUserMiningSlot104.cs.meta | 11 ++ .../kuangChang10/queryUserVoluteCoin108.cs | 32 ++++++ .../queryUserVoluteCoin108.cs.meta | 11 ++ 19 files changed, 609 insertions(+) create mode 100644 TheStrongestSnail/Assets/Scripts/kuangChang10.meta create mode 100644 TheStrongestSnail/Assets/Scripts/kuangChang10/KuangChangTest.cs create mode 100644 TheStrongestSnail/Assets/Scripts/kuangChang10/KuangChangTest.cs.meta create mode 100644 TheStrongestSnail/Assets/Scripts/kuangChang10/bindSlot.cs create mode 100644 TheStrongestSnail/Assets/Scripts/kuangChang10/bindSlot.cs.meta create mode 100644 TheStrongestSnail/Assets/Scripts/kuangChang10/buyMiningContract103.cs create mode 100644 TheStrongestSnail/Assets/Scripts/kuangChang10/buyMiningContract103.cs.meta create mode 100644 TheStrongestSnail/Assets/Scripts/kuangChang10/openSlot105.cs create mode 100644 TheStrongestSnail/Assets/Scripts/kuangChang10/openSlot105.cs.meta create mode 100644 TheStrongestSnail/Assets/Scripts/kuangChang10/queryMiningContracDetail102.cs create mode 100644 TheStrongestSnail/Assets/Scripts/kuangChang10/queryMiningContracDetail102.cs.meta create mode 100644 TheStrongestSnail/Assets/Scripts/kuangChang10/queryMiningContractList101.cs create mode 100644 TheStrongestSnail/Assets/Scripts/kuangChang10/queryMiningContractList101.cs.meta create mode 100644 TheStrongestSnail/Assets/Scripts/kuangChang10/queryMyPureContract106.cs create mode 100644 TheStrongestSnail/Assets/Scripts/kuangChang10/queryMyPureContract106.cs.meta create mode 100644 TheStrongestSnail/Assets/Scripts/kuangChang10/queryUserMiningSlot104.cs create mode 100644 TheStrongestSnail/Assets/Scripts/kuangChang10/queryUserMiningSlot104.cs.meta create mode 100644 TheStrongestSnail/Assets/Scripts/kuangChang10/queryUserVoluteCoin108.cs create mode 100644 TheStrongestSnail/Assets/Scripts/kuangChang10/queryUserVoluteCoin108.cs.meta diff --git a/TheStrongestSnail/Assets/Scripts/kuangChang10.meta b/TheStrongestSnail/Assets/Scripts/kuangChang10.meta new file mode 100644 index 0000000..22dea8b --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/kuangChang10.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 42fa19d4f4852ea47975d89b06e107d8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TheStrongestSnail/Assets/Scripts/kuangChang10/KuangChangTest.cs b/TheStrongestSnail/Assets/Scripts/kuangChang10/KuangChangTest.cs new file mode 100644 index 0000000..cb393bd --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/kuangChang10/KuangChangTest.cs @@ -0,0 +1,40 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class KuangChangTest : MonoBehaviour +{ + queryMiningContractList101 queryMiningContractList = new queryMiningContractList101();//10.110.1,查询可购买的挖矿合约 + queryMiningContracDetail102 queryMiningContracDetail = new queryMiningContracDetail102();//10.2 + MiningContracDetail miningContracDetail = new MiningContracDetail(); + buyMiningContract103 buyMiningContract = new buyMiningContract103();//10.3 + queryUserMiningSlot104 queryUserMiningSlot = new queryUserMiningSlot104();//10.4 + openSlot105 openSlot5 = new openSlot105();//10.5 + queryMyPureContract106 queryMyPureContract = new queryMyPureContract106();//10.6 + bindSlot107 bindSlot = new bindSlot107(); + queryUserVoluteCoin108 queryUserVoluteCoin = new queryUserVoluteCoin108(); + + async void Start() + { + queryMiningContractList.QueryMiningContract(); + miningContracDetail = await queryMiningContracDetail.QueryMiningContracDetail(2L); + //Debug.Log("====bbb======" + miningContracDetail.data.createTime); + bool isBuySucceed = await buyMiningContract.BuyMiningContract(1); + //Debug.Log("====购买===" + isBuySucceed); + //Debug.Log(buyMiningContract.BuyMiningContract(2) + "==========买"); + //Debug.Log(openSlot5.OpenSlot() + "===============开卡槽"); + queryMyPureContract.QueryMyPureContract(); + queryUserMiningSlot.QueryUserMiningSlot(); + bool isSucceed = await bindSlot.BindSlot(1, 1); + //Debug.Log(isSucceed + "========绑定卡槽"); + QueryUserVoluteCoinResponse queryUserVoluteCoinResponse = await queryUserVoluteCoin.QueryUserVoluteCoin(); + //Debug.Log(queryUserVoluteCoinResponse.data + "============================"); + + } + + // Update is called once per frame + void Update() + { + + } +} diff --git a/TheStrongestSnail/Assets/Scripts/kuangChang10/KuangChangTest.cs.meta b/TheStrongestSnail/Assets/Scripts/kuangChang10/KuangChangTest.cs.meta new file mode 100644 index 0000000..a169f9a --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/kuangChang10/KuangChangTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ee3458e7da434c4419e107eb11b1e6c4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TheStrongestSnail/Assets/Scripts/kuangChang10/bindSlot.cs b/TheStrongestSnail/Assets/Scripts/kuangChang10/bindSlot.cs new file mode 100644 index 0000000..43f99d3 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/kuangChang10/bindSlot.cs @@ -0,0 +1,44 @@ +锘縰sing Newtonsoft.Json; +using System.Collections; +using System.Collections.Generic; +using System.Threading.Tasks; +using UnityEngine; +//10.7锛岀粦瀹氬崱妲 +public class bindSlot107 : MonoBehaviour +{ + public async Task BindSlot(long miningUserId,long slotId) + { + // 鍑嗗璇锋眰鐨勫ご閮ㄤ俊鎭紝鍖呭惈鎺堟潈浠ょ墝 + Dictionary head = new Dictionary + { + { "Authorization", Global.global.serverResponse.data.token } + }; + BindSlotBody107 body = new BindSlotBody107(); + body.slotId = slotId; + body.miningUserId = miningUserId; + // 寮傛鍙戦佽姹備互鑾峰彇鏈鏂扮殑铚楃墰楠戝+淇℃伅 + string response0107 = await web.SendRequest(web.URL + "/snail/mining/bindSlot", "POST", JsonConvert.SerializeObject(body), head); + + // 璋冭瘯杈撳嚭鎺ユ敹鍒扮殑鍝嶅簲 + Debug.Log("10.7缁戝畾鍗℃Ы" + response0107); + BindSlotResponse bindSlotResponse = JsonConvert.DeserializeObject(response0107); + bool isSucceed; + if (bindSlotResponse.code == 200) { isSucceed = true; }else{ isSucceed = false; } + return isSucceed; + + } +} +//======璇锋眰浣========================== +public class BindSlotBody107 +{ + public long miningUserId; + public long slotId; +} +//璇锋眰鍙傛暟锛歨eader锛欰uthorization锛1.2鎺ュ彛杩斿洖鐨則oken +//聽聽 聽 聽 聽 body锛歮iningUserId锛歀ong锛岀敤鎴峰悎绾d +//聽聽 聽 聽 聽 聽 聽 聽 slotId锛歀ong, 鍗℃Ыid +//===========杩斿洖=============================== +public class BindSlotResponse : Response +{ + public string data; +} \ No newline at end of file diff --git a/TheStrongestSnail/Assets/Scripts/kuangChang10/bindSlot.cs.meta b/TheStrongestSnail/Assets/Scripts/kuangChang10/bindSlot.cs.meta new file mode 100644 index 0000000..be1cf38 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/kuangChang10/bindSlot.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4a2290ed1af6fbf4d9a46ed338f4c485 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TheStrongestSnail/Assets/Scripts/kuangChang10/buyMiningContract103.cs b/TheStrongestSnail/Assets/Scripts/kuangChang10/buyMiningContract103.cs new file mode 100644 index 0000000..be3cc31 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/kuangChang10/buyMiningContract103.cs @@ -0,0 +1,51 @@ +using Newtonsoft.Json; +using System.Collections; +using System.Collections.Generic; +using System.Threading.Tasks; +using UnityEngine; +//10.3,购买合约 +public class buyMiningContract103 : MonoBehaviour +{ + public async Task BuyMiningContract(long contractId) // 9.1 + { + // 准备请求的头部信息,包含授权令牌 + Dictionary head = new Dictionary + { + { "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; + + //Debug.Log(JsonConvert.SerializeObject(body)+"====================================="); + // 异步发送请求以获取最新的蜗牛骑士信息 + string response0103 = await web.SendRequest(web.URL + "/snail/mining/buyMiningContract" , "POST", JsonConvert.SerializeObject(body), head); + + // 调试输出接收到的响应 + Debug.Log("10.3购买合约" + response0103); + + // 将响应反序列化为对象 + BuyMiningResponse buyMiningResponse = JsonConvert.DeserializeObject(response0103); + bool isSucceed; + if (buyMiningResponse.code == 200) { isSucceed = true; } else { isSucceed = false; } + + // 返回解析后的对象 + return isSucceed; + } +} +//==========请求体=========================== + +public class BuyMiningContractBody +{ + public long contractId; + public long userId; +} + +//==========返回值=========================== +public class BuyMiningResponse : Response +{ + public string data; +} \ No newline at end of file diff --git a/TheStrongestSnail/Assets/Scripts/kuangChang10/buyMiningContract103.cs.meta b/TheStrongestSnail/Assets/Scripts/kuangChang10/buyMiningContract103.cs.meta new file mode 100644 index 0000000..b296f02 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/kuangChang10/buyMiningContract103.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 547a1a8c0d4f9484a9ce192f84a2334c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TheStrongestSnail/Assets/Scripts/kuangChang10/openSlot105.cs b/TheStrongestSnail/Assets/Scripts/kuangChang10/openSlot105.cs new file mode 100644 index 0000000..8614500 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/kuangChang10/openSlot105.cs @@ -0,0 +1,39 @@ +using Newtonsoft.Json; +using System.Collections; +using System.Collections.Generic; +using System.Threading.Tasks; +using UnityEngine; +//10.5开启卡槽 +public class openSlot105 : MonoBehaviour +{ + public async Task OpenSlot() + { + // 准备请求的头部信息,包含授权令牌 + Dictionary head = new Dictionary + { + { "Authorization", Global.global.serverResponse.data.token } + }; + + + + // 异步发送请求以获取最新的蜗牛骑士信息 + string response0105 = await web.SendRequest(web.URL + "/snail/mining/openSlot", "POST", "{}", head); + + // 调试输出接收到的响应 + Debug.Log("10.5开启卡槽" + response0105); + + // 将响应反序列化为对象 + OpenSlot openSlot = JsonConvert.DeserializeObject(response0105); + bool isSucceed; + if (openSlot.code == 200) { isSucceed = true; } else { isSucceed = false; } + + // 返回解析后的对象 + return isSucceed; + } +} +//===========返回================================== +public class OpenSlot:Response +{ + public string data; +} + diff --git a/TheStrongestSnail/Assets/Scripts/kuangChang10/openSlot105.cs.meta b/TheStrongestSnail/Assets/Scripts/kuangChang10/openSlot105.cs.meta new file mode 100644 index 0000000..aefeed8 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/kuangChang10/openSlot105.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2652070c59330a04181bcc871e591093 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TheStrongestSnail/Assets/Scripts/kuangChang10/queryMiningContracDetail102.cs b/TheStrongestSnail/Assets/Scripts/kuangChang10/queryMiningContracDetail102.cs new file mode 100644 index 0000000..dd9d8b3 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/kuangChang10/queryMiningContracDetail102.cs @@ -0,0 +1,58 @@ +锘縰sing Newtonsoft.Json; +using System.Collections; +using System.Collections.Generic; +using System.Threading.Tasks; +using UnityEngine; +//10.2鏌ヨ鍚堢害璇︽儏 +public class queryMiningContracDetail102 : MonoBehaviour +{ + public async Task QueryMiningContracDetail(long contractId) + { + // 鍑嗗璇锋眰鐨勫ご閮ㄤ俊鎭紝鍖呭惈鎺堟潈浠ょ墝 + Dictionary head = new Dictionary + { + { "Authorization", Global.global.serverResponse.data.token } + }; + + + + // 寮傛鍙戦佽姹備互鑾峰彇鏈鏂扮殑铚楃墰楠戝+淇℃伅 + string response0102 = await web.SendRequest(web.URL + "/snail/mining/queryMiningContractInfo?contractId=" + contractId, "GET","{}", head); + + // 璋冭瘯杈撳嚭鎺ユ敹鍒扮殑鍝嶅簲 + Debug.Log("10.2锛屾煡璇㈠悎绾﹁鎯" + response0102); + + // 灏嗗搷搴斿弽搴忓垪鍖栦负瀵硅薄 + MiningContracDetail miningContracDetail = JsonConvert.DeserializeObject(response0102); + + // 杩斿洖瑙f瀽鍚庣殑瀵硅薄 + return miningContracDetail; + } +} +//================杩斿洖============================== +public class MiningContracDetail : Response +{ + public MiningDetailData data; +} +public class MiningDetailData +{ + public long id; + public string name; + public int status; + public double voluteCoinBuy; + public int miningDays; + public double voluteCoinReward; + public double eachSecondsReward; + public string createTime; + public string updateTime; +} + + +//杩斿洖鍙傛暟锛歝ode锛200锛屾垚鍔 +//聽 聽 聽 聽 message锛氭垚鍔燂紝鎻愮ず璇 +//聽 聽 聽 聽 data锛氬悎绾﹁鎯 +//聽聽 聽 聽 聽 聽 聽 id锛歀ong锛屽悎绾d +//聽聽 聽 聽 聽 聽 聽 name锛歋tring锛屽悎绾﹀悕绉 +//聽聽 聽 聽 聽 聽 聽 voluteCoinBuy锛欴ecimal锛岃喘涔板悎绾︾殑铚楀3 +//聽聽 聽 聽 聽 聽 聽 voluteCoinReward锛欴ecimal锛屽悎绾︾殑鍥炴姤铚楀3 +//聽聽 聽 聽 聽 聽 聽 miningDays锛欼nteger锛屾寲鐭垮ぉ鏁 diff --git a/TheStrongestSnail/Assets/Scripts/kuangChang10/queryMiningContracDetail102.cs.meta b/TheStrongestSnail/Assets/Scripts/kuangChang10/queryMiningContracDetail102.cs.meta new file mode 100644 index 0000000..4eba0a6 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/kuangChang10/queryMiningContracDetail102.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4df814f1e75b83145ae57163b0e3cddb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TheStrongestSnail/Assets/Scripts/kuangChang10/queryMiningContractList101.cs b/TheStrongestSnail/Assets/Scripts/kuangChang10/queryMiningContractList101.cs new file mode 100644 index 0000000..467913e --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/kuangChang10/queryMiningContractList101.cs @@ -0,0 +1,63 @@ +using Newtonsoft.Json; +using System.Collections; +using System.Collections.Generic; +using System.Threading.Tasks; +using UnityEngine; +//10.1,查询可购买的挖矿合约 +public class queryMiningContractList101 : MonoBehaviour +{ + public async Task QueryMiningContract() + { + // 准备请求的头部信息,包含授权令牌 + Dictionary head = new Dictionary + { + { "Authorization", Global.global.serverResponse.data.token } + }; + + // 异步发送请求以获取最新的蜗牛骑士信息 + string response0101 = await web.SendRequest(web.URL + "/snail/mining/queryMiningContractList", "POST", "{}", head); + + // 调试输出接收到的响应 + Debug.Log("10.1,查询可购买的挖矿合约" + response0101); + + // 将响应反序列化为对象 + MiningContractList miningContractList = JsonConvert.DeserializeObject(response0101); + + //// 遍历 miningContractList.data 列表中的每个 MiningContract 对象 + //foreach (var contract in miningContractList.data) + //{ + // Debug.Log($"合约ID: {contract.id}"); + // Debug.Log($"合约名称: {contract.name}"); + // Debug.Log($"状态: {contract.status}"); + // Debug.Log($"上架状态: {contract.onShelves}"); + // Debug.Log($"购买所需 VoluteCoin: {contract.voluteCoinBuy}"); + // Debug.Log($"挖矿天数: {contract.miningDays}"); + // Debug.Log($"挖矿奖励 VoluteCoin: {contract.voluteCoinReward}"); + // Debug.Log($"每秒奖励: {contract.eachSecondsReward}"); + // Debug.Log($"创建时间: {contract.createTime}"); + // Debug.Log($"更新时间: {contract.updateTime}"); + //} + + // 返回解析后的对象 + return miningContractList; + } +} +//=====返回================================================================ +public class MiningContractList:Response +{ + public List 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; } +} \ No newline at end of file diff --git a/TheStrongestSnail/Assets/Scripts/kuangChang10/queryMiningContractList101.cs.meta b/TheStrongestSnail/Assets/Scripts/kuangChang10/queryMiningContractList101.cs.meta new file mode 100644 index 0000000..f571acd --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/kuangChang10/queryMiningContractList101.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0af9ad2dd63b0794bbc29fdafce5621c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TheStrongestSnail/Assets/Scripts/kuangChang10/queryMyPureContract106.cs b/TheStrongestSnail/Assets/Scripts/kuangChang10/queryMyPureContract106.cs new file mode 100644 index 0000000..ce8d9aa --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/kuangChang10/queryMyPureContract106.cs @@ -0,0 +1,75 @@ +锘縰sing Newtonsoft.Json; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Threading.Tasks; +using UnityEngine; +//10.6鏌ヨ瀵绘湭婵娲荤殑鏉$害 +public class queryMyPureContract106 : MonoBehaviour +{ + public async Task QueryMyPureContract() + { + // 鍑嗗璇锋眰鐨勫ご閮ㄤ俊鎭紝鍖呭惈鎺堟潈浠ょ墝 + Dictionary head = new Dictionary + { + { "Authorization", Global.global.serverResponse.data.token } + }; + + // 寮傛鍙戦佽姹備互鑾峰彇鏈縺娲荤殑鍚堢害淇℃伅 + string response0106 = await web.SendRequest(web.URL + "/snail/mining/queryMyPureContract", "POST", "{}", head); + + // 璋冭瘯杈撳嚭鎺ユ敹鍒扮殑鍝嶅簲 + Debug.Log("10.6 鏌ヨ鏈縺娲荤殑鍚堢害: " + response0106); + + // 灏嗗搷搴斿弽搴忓垪鍖栦负瀵硅薄 + MyPureContractResponse contractResponse = JsonConvert.DeserializeObject(response0106); + + // 妫鏌ヨ繑鍥炵殑鏁版嵁 + if (contractResponse != null && contractResponse.data != null) + { + //foreach (var contract in contractResponse.data) + //{ + // // 璁块棶鍚堢害瀛楁 + // Debug.Log($"鍚堢害 ID: {contract.id}"); + // Debug.Log($"鍚堢害鍚嶇О: {contract.contractName}"); + // Debug.Log($"姣忕濂栧姳: {contract.eachSecondsReward}"); + // Debug.Log($"鍚堢害鍒涘缓鏃堕棿: {contract.createTime}"); + // Debug.Log($"鍚堢害鏇存柊鏃堕棿: {contract.updateTime}"); + + // // 杩欓噷鍙互鏍规嵁闇瑕佽繘琛屽叾浠栧鐞 + //} + } + else + { + Debug.LogError("鏈兘鑾峰彇鍒板悎绾︽暟鎹紒"); + } + } +} +//==============杩斿洖鍊=================================== +public class MyPureContractResponse:Response +{ + public List data { get; set; } +} +public class MyPureContract +{ + public long id { get; set; } + public long userId { get; set; } + public long contractId { get; set; } + public string contractName { get; set; } + public long slotId { get; set; } + public string miningBegin { get; set; } + public string miningEnd { get; set; } + public string miningNow { get; set; } + public double eachSecondsReward { get; set; } + public int status { get; set; } + public string createTime { get; set; } + public string updateTime { get; set; } +} + +//code锛200锛屾垚鍔 +//聽 聽 聽 聽 message锛氭垚鍔燂紝鎻愮ず璇 +//聽 聽 聽 聽 data锛氬悎绾﹀垪琛 +//聽 聽 聽 聽 聽 聽 id锛歀ong, 鐢ㄦ埛鍚堢害id +//聽 聽 聽 聽 聽 聽 userId锛歀ong, 鐢ㄦ埛id +//聽 聽 聽 聽 聽 聽 contractId锛歀ong锛屽悎绾d +//聽 聽 聽 聽 聽 聽 contractName锛歋tring锛屽悎绾﹀悕绉 \ No newline at end of file diff --git a/TheStrongestSnail/Assets/Scripts/kuangChang10/queryMyPureContract106.cs.meta b/TheStrongestSnail/Assets/Scripts/kuangChang10/queryMyPureContract106.cs.meta new file mode 100644 index 0000000..c62f6ee --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/kuangChang10/queryMyPureContract106.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 52d5a0e68db288146b6bf48a0d4c05a8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TheStrongestSnail/Assets/Scripts/kuangChang10/queryUserMiningSlot104.cs b/TheStrongestSnail/Assets/Scripts/kuangChang10/queryUserMiningSlot104.cs new file mode 100644 index 0000000..8d21a40 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/kuangChang10/queryUserMiningSlot104.cs @@ -0,0 +1,100 @@ +using Newtonsoft.Json; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Threading.Tasks; +using UnityEngine; +//10.4查询矿场卡槽分页 +public class queryUserMiningSlot104 : MonoBehaviour +{ + public async Task QueryUserMiningSlot() + { + // 准备请求的头部信息,包含授权令牌 + Dictionary head = new Dictionary + { + { "Authorization", Global.global.serverResponse.data.token } + }; + + queryPlayerInfo queryPlayerInfo = new queryPlayerInfo(); + RealPlayerInfo realPlayerInfo = await queryPlayerInfo.QueryPlayerInfoPro(); + UserMiningSlotBody body = new UserMiningSlotBody(); + body.userId = realPlayerInfo.data.userId; + + + // 异步发送请求以获取最新的蜗牛骑士信息 + string response0104 = await web.SendRequest(web.URL + "/snail/mining/queryUserMiningSlot", "POST", JsonConvert.SerializeObject(body), head); + + // 调试输出接收到的响应 + Debug.Log("10.4查询矿场卡槽分页" + response0104); + + // 将响应反序列化为对象 + UserMiningSlotResponse userMiningSlotResponse = JsonConvert.DeserializeObject(response0104); + //Debug.Log("===========88============="+ userMiningSlotResponse.data.dataList[0].userId); + + // 返回解析后的对象 + return userMiningSlotResponse; + } +} +//======请求体================================== +public class UserMiningSlotBody +{ + public long userId; +} +//===========返回值============================== +public class UserMiningSlotResponse:Response +{ + public UserMiningSlotData data { get; set; } +} + +public class UserMiningSlotData +{ + public int pageNo { get; set; } + public int pageSize { get; set; } + public int totalCount { get; set; } + public List dataList { get; set; } +} + +public class UserMiningSlot +{ + public long id { get; set; } + public long userId { get; set; } + public long snailId { get; set; } + public long contractId { get; set; } + public long contractUserId { get; set; } + public string bindTime { get; set; } + public int source { get; set; } + public int useType { get; set; } + public int status { get; set; } + public string createTime { get; set; } + public string miningBegin { get; set; } + public string miningEnd { get; set; } + public int carry { get; set; } + public string contractName { get; set; } +} +//{ +// "code": 200, +// "message": "请求成功", +// "data": { +// "pageNo": 1, +// "pageSize": 20, +// "totalCount": 1, +// "dataList": [ +// { +// "id": 13, +// "userId": 106, +// "snailId": 0, +// "contractId": 0, +// "contractUserId": 0, +// "bindTime": null, +// "source": 0, +// "useType": 2, +// "status": 0, +// "createTime": null, +// "miningBegin": null, +// "miningEnd": null, +// "carry": 0, +// "contractName": null +// } +// ] +// } +//} \ No newline at end of file diff --git a/TheStrongestSnail/Assets/Scripts/kuangChang10/queryUserMiningSlot104.cs.meta b/TheStrongestSnail/Assets/Scripts/kuangChang10/queryUserMiningSlot104.cs.meta new file mode 100644 index 0000000..bd4bd7f --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/kuangChang10/queryUserMiningSlot104.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: adf0d750fe73e4d49853f565e07de4f4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TheStrongestSnail/Assets/Scripts/kuangChang10/queryUserVoluteCoin108.cs b/TheStrongestSnail/Assets/Scripts/kuangChang10/queryUserVoluteCoin108.cs new file mode 100644 index 0000000..ef87a6c --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/kuangChang10/queryUserVoluteCoin108.cs @@ -0,0 +1,32 @@ +using Newtonsoft.Json; +using System.Collections; +using System.Collections.Generic; +using System.Threading.Tasks; +using UnityEngine; +//10.8,矿厂主页刷新蜗壳值 +public class queryUserVoluteCoin108 : MonoBehaviour +{ + public async Task QueryUserVoluteCoin() + { + // 准备请求的头部信息,包含授权令牌 + Dictionary head = new Dictionary + { + { "Authorization", Global.global.serverResponse.data.token } + }; + + // 异步发送请求 + string response0108 = await web.SendRequest(web.URL + "/snail/mining/queryUserVoluteCoin", "POST","{}", head); + + // 调试输出接收到的响应 + Debug.Log("10.8,矿厂主页刷新蜗壳值" + response0108); + + QueryUserVoluteCoinResponse queryUserVoluteCoinResponse = JsonConvert.DeserializeObject(response0108); + return queryUserVoluteCoinResponse; + + } +} +//============返回值====================================== +public class QueryUserVoluteCoinResponse:Response +{ + public double data; +} \ No newline at end of file diff --git a/TheStrongestSnail/Assets/Scripts/kuangChang10/queryUserVoluteCoin108.cs.meta b/TheStrongestSnail/Assets/Scripts/kuangChang10/queryUserVoluteCoin108.cs.meta new file mode 100644 index 0000000..e51b661 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/kuangChang10/queryUserVoluteCoin108.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b49f6a4966f47f84b803332f4eea8b7e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: