2024-12-12 19:14:48 +08:00
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class gameRoomReserve : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD> token
|
|
|
|
|
public Dictionary<string, string> CreateHeaders()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
Debug.Log("====5555=====" + GlobalData.ServerData.data.access_token);
|
|
|
|
|
return new Dictionary<string, string>
|
|
|
|
|
{
|
|
|
|
|
{ "Authorization","Bearer "+GlobalData.ServerData.data.access_token },
|
|
|
|
|
{"clientId", "e5cd7e4891bf95d1d19206ce24a7b32e" }
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
//Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
public async Task<ScheduledDrillResponse> scheduledDrill(string reserveDate,string templateId)
|
|
|
|
|
{
|
|
|
|
|
ScheduledDrillBody body = new ScheduledDrillBody();
|
|
|
|
|
body.reserveDate= reserveDate;
|
|
|
|
|
//body.templateId = GlobalData.newTemplateData.data;
|
|
|
|
|
body.templateId=templateId;
|
|
|
|
|
//=====================================================================================================================================================
|
|
|
|
|
Debug.Log(JsonConvert.SerializeObject(body) + "Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
string response = await web.SendRequest(web.URL + "/game/gameRoom/reserve", "POST", JsonConvert.SerializeObject(body), CreateHeaders());
|
|
|
|
|
|
|
|
|
|
Debug.Log("Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" + response);
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
ScheduledDrillResponse scheduledDrillResponse = JsonConvert.DeserializeObject<ScheduledDrillResponse>(response);
|
2024-12-25 17:24:22 +08:00
|
|
|
|
//<2F>澲̬
|
|
|
|
|
GlobalData.scheduledDrillResponse = scheduledDrillResponse;
|
|
|
|
|
Debug.Log("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǿ<EFBFBD>̬<EFBFBD><CCAC>" + scheduledDrillResponse.data);
|
|
|
|
|
Debug.Log("<22><><EFBFBD><EFBFBD><EFBFBD>Ǿ<EFBFBD>̬<EFBFBD><CCAC>"+GlobalData.scheduledDrillResponse.data);
|
2024-12-12 19:14:48 +08:00
|
|
|
|
return scheduledDrillResponse;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//====================================
|
|
|
|
|
public class ScheduledDrillBody
|
|
|
|
|
{
|
|
|
|
|
public string templateId;
|
|
|
|
|
public string reserveDate;
|
|
|
|
|
}
|
|
|
|
|
public class ScheduledDrillResponse : Response
|
|
|
|
|
{
|
|
|
|
|
public string data;//<2F><>
|
|
|
|
|
}
|