41 lines
1.3 KiB
C#
41 lines
1.3 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 RowerApi : ApiBase
|
|
{
|
|
/// <summary>
|
|
/// 上传划船记录到服务端
|
|
/// </summary>
|
|
/// <param name="interruptRecord"></param>
|
|
public JsonResult<object> Add(RowerRecordModel record, List<string> fileNames)
|
|
{
|
|
var result = Upload("Rower/AddRecord", record, fileNames);
|
|
var jsonResult = JsonConvert.DeserializeObject<JsonResult<object>>(result);
|
|
return jsonResult;
|
|
}
|
|
|
|
public async Task<JsonResult<List<JObject>>> GetList(int pageIndex, int pageSize)
|
|
{
|
|
return await GetAsync<JsonResult<List<JObject>>>($"Rower/GetList?pageIndex={pageIndex}&pageSize={pageSize}");
|
|
}
|
|
|
|
public async Task<JsonResult<RowerResultModel>> GetDetail(string id)
|
|
{
|
|
return await GetAsync<JsonResult<RowerResultModel>>($"Rower/GetDetail?Id={id}");
|
|
}
|
|
|
|
public async Task<JsonResult<object>> Delete(string Id)
|
|
{
|
|
return await PostAsync<JsonResult<object>>($"Rower/Delete",new { Id});
|
|
}
|
|
}
|
|
}
|