2022-04-22 18:24:56 +08:00

32 lines
1.0 KiB
C#

using Assets.Scripts.Apis.Models;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Assets.Scripts.Apis
{
public class GameRoomApi : ApiBase
{
public JsonResult<object> Add(GameRoomModel record, List<string> fileNames)
{
var result = Upload("GameRoom/Add", record, fileNames);
var jsonResult = JsonConvert.DeserializeObject<JsonResult<object>>(result);
return jsonResult;
}
public async Task<JsonResult<List<GameRoomModel>>> GetList(int pageIndex, int pageSize,int? id = null)
{
return await GetAsync<JsonResult<List<GameRoomModel>>>($"GameRoom/GetList?pageIndex={pageIndex}&pageSize={pageSize}&id={id}");
}
public async Task<JsonResult<JObject>> GetDetail(int id)
{
return await GetAsync<JsonResult<JObject>>($"GameRoom/GetDetail?Id={id}");
}
}
}