forked from powerfun/udpservice
39 lines
1.2 KiB
C#
39 lines
1.2 KiB
C#
using Newtonsoft.Json;
|
|
|
|
using OnlineUserPool.Model;
|
|
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Net.Http;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace OnlineUserPool.Api
|
|
{
|
|
public class WebService : BaseApi
|
|
{
|
|
/// <summary>
|
|
/// 从服务端获取记录信息
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static List<MapRecordRanking> GetRecordFileFromServer(List<long> id)
|
|
{
|
|
if (!id.Any())
|
|
{
|
|
return new List<MapRecordRanking>();
|
|
}
|
|
return PostAsync<JsonResult<List<MapRecordRanking>>>("MapRecord/GetRandomList", id).ConfigureAwait(false).GetAwaiter().GetResult().data;
|
|
}
|
|
|
|
public static List<MapRouteAndUserQueryVM> GetMapRouteRandomRecord(int top, IEnumerable<int> routeIds)
|
|
{
|
|
var routeIdsStr = "";
|
|
if(routeIds != null)
|
|
{
|
|
routeIdsStr = string.Join(",", routeIds);
|
|
}
|
|
return GetAsync<JsonResult<List<MapRouteAndUserQueryVM>>>($"MapRecord/GetRandomRankingUserRecord?top={ top }&routeIds={ routeIdsStr }").ConfigureAwait(false).GetAwaiter().GetResult().data;
|
|
}
|
|
}
|
|
}
|