43 lines
1.5 KiB
C#
43 lines
1.5 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;
|
|
using UnityEngine;
|
|
|
|
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;
|
|
}
|
|
|
|
public async Task<JsonResult<List<JObject>>> GetMapInterruptRecord(string keyword, int pageIndex, int pageSize, string type)
|
|
{
|
|
//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}");
|
|
}
|
|
}
|
|
}
|