60 lines
1.9 KiB
C#
60 lines
1.9 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 JsonResult<List<RouteResult>> GetMapInterruptRecord(string keyword, int pageIndex, int pageSize)
|
|
{
|
|
var result = new JsonResult<List<RouteResult>>()
|
|
{
|
|
result = false,
|
|
data = null,
|
|
errMsg = ""
|
|
};
|
|
try
|
|
{
|
|
var r = Get<List<RouteResult>>($"MapRecord/GetMapInterruptRecord?keyword={keyword}&pageIndex={pageIndex}&pageSize={pageSize}");
|
|
result.result = true;
|
|
result.data = r;
|
|
return result;
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Debug.Log(e.ToString());
|
|
return result;
|
|
}
|
|
|
|
}
|
|
/// <summary>
|
|
/// 通过ID获取设备商
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <returns></returns>
|
|
public JsonResult<AntManufacturer> GetAntManufacturer(int id)
|
|
{
|
|
return Get<JsonResult<AntManufacturer>>($"MapRecord/GetAntManufacturerById?id={id}");
|
|
}
|
|
}
|
|
}
|