forked from powerfun/udpservice
细节调整
This commit is contained in:
1 parent
a9e8137aaa
commit
fec18db7a8
10 files changed
+135
-72
No files matched your search
@@ -7,7 +7,7 @@ namespace OnlineUserPool.Unility
|
||||
class ConfigHelp
|
||||
{
|
||||
public static string Host { get; set; }
|
||||
public static string Top { get; set; }
|
||||
public static int Top { get; private set; }
|
||||
public static bool ShowVirtualUser { get; set; }
|
||||
|
||||
public static string Ip { get; set; }
|
||||
@@ -18,7 +18,7 @@ namespace OnlineUserPool.Unility
|
||||
static ConfigHelp()
|
||||
{
|
||||
Host = System.Configuration.ConfigurationManager.AppSettings["Host"];
|
||||
Top = System.Configuration.ConfigurationManager.AppSettings["Top"];
|
||||
Top = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["Top"]);
|
||||
ShowVirtualUser = bool.Parse(System.Configuration.ConfigurationManager.AppSettings["ShowVirtualUser"]);
|
||||
Ip = System.Configuration.ConfigurationManager.AppSettings["Ip"];
|
||||
Port = int.Parse(System.Configuration.ConfigurationManager.AppSettings["Port"]);
|
||||
|
||||
+13
-5
@@ -3,6 +3,7 @@
|
||||
using OnlineUserPool.Model;
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -48,14 +49,21 @@ namespace OnlineUserPool.Unility
|
||||
/// <returns></returns>
|
||||
public static List<MapRecordRanking> GetRecordFileFromServer(List<string> id)
|
||||
{
|
||||
return PostAsync<JsonResult<List<MapRecordRanking>>>("Map/GetCyclingRecordsById", id).ConfigureAwait(false).GetAwaiter().GetResult().data;
|
||||
if (!id.Any())
|
||||
{
|
||||
return new List<MapRecordRanking>();
|
||||
}
|
||||
return PostAsync<JsonResult<List<MapRecordRanking>>>("MapRecord/GetRandomList", id).ConfigureAwait(false).GetAwaiter().GetResult().data;
|
||||
}
|
||||
|
||||
public static List<MapRouteAndUserQueryVM> GetMapRouteRandomUser(RandomRankingUserRequestVM requestVM)
|
||||
public static List<MapRouteAndUserQueryVM> GetMapRouteRandomUser(int top, IEnumerable<int> routeIds)
|
||||
{
|
||||
return PostAsync<JsonResult<List<MapRouteAndUserQueryVM>>>($"Map/GetRandomRankingUserRecord", requestVM).ConfigureAwait(false).GetAwaiter().GetResult().data;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user