powerfun-unity/Assets/Scripts/Apis/MapInterruptRecordApi.cs

48 lines
1.7 KiB
C#
Raw Normal View History

2021-03-22 16:05:40 +08:00
using Assets.Scripts.Apis.Models;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
2021-03-22 16:05:40 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
2021-03-22 16:05:40 +08:00
namespace Assets.Scripts.Apis
{
public class MapInterruptRecordApi:ApiBase
{
/// <summary>
/// 上传骑行记录到服务端
/// </summary>
/// <param name="interruptRecord"></param>
public JsonResult<AddMapRecordResultModel> Add(MapInterruptRecord interruptRecord, List<string> fileNames)
{
var result = Upload("MapRecord/AddMapInterruptRecord", interruptRecord, fileNames);
var jsonResult = JsonConvert.DeserializeObject<JsonResult<AddMapRecordResultModel>>(result);
return jsonResult;
}
2022-03-10 18:32:53 +08:00
public async Task<JsonResult<List<JObject>>> GetMapInterruptRecord(string keyword, int pageIndex, int pageSize, string type= "routes")
{
2021-09-23 18:14:53 +08:00
//RouteResult
return await GetAsync<JsonResult<List<JObject>>>($"MapRecord/v1/GetList?keyword={keyword}&pageIndex={pageIndex}&pageSize={pageSize}&type={type}");
}
/// <summary>
/// 通过ID获取设备商
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public JsonResult<AntManufacturer> GetAntManufacturer(int id)
{
return Get<JsonResult<AntManufacturer>>($"MapRecord/GetAntManufacturerById?id={id}");
}
2022-03-07 15:29:37 +08:00
public async Task<JsonResult<byte[]>> GetRecordSnapShot(int id)
{
return await GetAsync<JsonResult<byte[]>>($"Share/GetRecordSnapShot?id={id}");
}
2021-03-22 16:05:40 +08:00
}
}