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
{
///
/// 上传划船记录到服务端
///
///
public JsonResult Add(RowerRecordModel record, List fileNames)
{
var result = Upload("Rower/AddRecord", record, fileNames);
var jsonResult = JsonConvert.DeserializeObject>(result);
return jsonResult;
}
public async Task>> GetList(int pageIndex, int pageSize)
{
return await GetAsync>>($"Rower/GetList?pageIndex={pageIndex}&pageSize={pageSize}");
}
public async Task> GetDetail(string id)
{
return await GetAsync>($"Rower/GetDetail?Id={id}");
}
public async Task> GetSegmentDataAndRanking(string id)
{
return await GetAsync>($"Rower/GetSegmentDataAndRanking?Id={id}");
}
public async Task> Delete(string Id)
{
return await PostAsync>($"Rower/Delete",new { Id});
}
public async Task>> GetShadowList(RowerTaskPanel.RowerType rowerType)
{
return await GetAsync>>($"Rower/GetShadowList?type={rowerType.type}&typeValue={rowerType.value}");
}
public async Task>> GetReRowShadowList(string id)
{
return await GetAsync>>($"Rower/GetReRowShadowList?Id={id}");
}
}
}