55 lines
2.1 KiB
C#
55 lines
2.1 KiB
C#
|
using Newtonsoft.Json;
|
|||
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using UnityEngine;
|
|||
|
//<2F><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ
|
|||
|
public class announcementPage31 : MonoBehaviour
|
|||
|
{
|
|||
|
public async Task<announcementPage> announcementPage(int pageNo,int pageSize)
|
|||
|
{
|
|||
|
// <><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> head31 = new Dictionary<string, string>
|
|||
|
{
|
|||
|
{ "Authorization", Global.global.serverResponse.data.token }
|
|||
|
};
|
|||
|
RealPlayerInfo realPlayerInfo = new RealPlayerInfo();
|
|||
|
queryPlayerInfo queryPlayerInfo = new queryPlayerInfo();
|
|||
|
realPlayerInfo = await queryPlayerInfo.QueryPlayerInfoPro();
|
|||
|
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
announcementPageBody announcementPageBody = new announcementPageBody()
|
|||
|
{
|
|||
|
userId = realPlayerInfo.data.userId,
|
|||
|
pageNo = pageNo,
|
|||
|
pageSize = pageSize
|
|||
|
|
|||
|
};
|
|||
|
|
|||
|
Debug.Log("====<3D><><EFBFBD><EFBFBD>====" + JsonConvert.SerializeObject(announcementPageBody));
|
|||
|
// <20>첽<EFBFBD><ECB2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
string response31 = await web.SendRequest(web.URL + "/snail/notice/page", "POST", JsonConvert.SerializeObject(announcementPageBody), head31);
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD>Ӧ
|
|||
|
Debug.Log("3.1<EFBFBD><EFBFBD>ѯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ:=============== " + response31);
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6> JSON <20><><EFBFBD><EFBFBD>
|
|||
|
announcementPage announcementPage = JsonConvert.DeserializeObject<announcementPage>(response31);
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
|||
|
foreach (var announcement in announcementPage.data.dataList)
|
|||
|
{
|
|||
|
int id = announcement.id; // <20><><EFBFBD><EFBFBD>ID
|
|||
|
string title = announcement.title; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
string icon = announcement.icon; // <20><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>URL
|
|||
|
string content = announcement.content; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
int onShelves = announcement.onShelves; // <20>Ƿ<EFBFBD><C7B7>ϼ<EFBFBD>
|
|||
|
string createTime = announcement.createTime; // <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD>Щ<EFBFBD>ֶν<D6B6><CEBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>չʾ<D5B9><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
Debug.Log($"<22><><EFBFBD><EFBFBD>ID: {id}, <20><><EFBFBD><EFBFBD>: {title}, ͼ<><CDBC>: {icon}, <20><><EFBFBD><EFBFBD>: {content}, <20>ϼ<EFBFBD>״̬: {onShelves}, <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>: {createTime}");
|
|||
|
}
|
|||
|
return announcementPage;
|
|||
|
}
|
|||
|
}
|