|
@@ -14,6 +14,7 @@ using WingServerCommon.Config;
|
|
|
using WingServerCommon.Config.Parameters;
|
|
|
using System.Net;
|
|
|
using Newtonsoft.Json;
|
|
|
+using WingServerCommon.Mapper;
|
|
|
|
|
|
namespace WingCloudServer.InteractionCenter
|
|
|
{
|
|
@@ -31,7 +32,7 @@ namespace WingCloudServer.InteractionCenter
|
|
|
private ITokenDBService _tokenDBService;
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 默认构é€
|
|
|
+ /// 默认构é€
|
|
|
/// </summary>
|
|
|
public VinnoServerService()
|
|
|
{
|
|
@@ -96,6 +97,7 @@ namespace WingCloudServer.InteractionCenter
|
|
|
Enable = d.Enable,
|
|
|
ServerType = (int)d.ServerType,
|
|
|
ServerUrl = d.ServerUrl,
|
|
|
+ AssignClientIPList = d.AssignClientIPList.MappingTo<List<CacheIPAddressInfoDTO>>()
|
|
|
}).ToList();
|
|
|
}
|
|
|
}
|
|
@@ -118,6 +120,7 @@ namespace WingCloudServer.InteractionCenter
|
|
|
Enable = d.Enable,
|
|
|
ServerType = (int)d.ServerType,
|
|
|
ServerUrl = d.ServerUrl,
|
|
|
+ AssignClientIPList = d.AssignClientIPList.MappingTo<List<CacheIPAddressInfoDTO>>()
|
|
|
}).ToList();
|
|
|
}
|
|
|
}
|
|
@@ -130,7 +133,7 @@ namespace WingCloudServer.InteractionCenter
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// �始化
|
|
|
+ /// åˆ�始åŒ
|
|
|
/// </summary>
|
|
|
public override void Load(JsonRpcClientPool jsonRpcClientPool)
|
|
|
{
|
|
@@ -142,7 +145,7 @@ namespace WingCloudServer.InteractionCenter
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// åŠ è½½ServerInfo到内å˜
|
|
|
+ /// åŠ è½½ServerInfo到内å
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
private void LoadDBServerInfo()
|
|
@@ -215,37 +218,21 @@ namespace WingCloudServer.InteractionCenter
|
|
|
{
|
|
|
//这里应该是批�查询,请求�数�改
|
|
|
var list = new List<ServerInfoDTO>();
|
|
|
- // var serverInformationList = new List<CacheDistributedServerInfosDTO>();
|
|
|
- // if (request.Codes != null && request.Codes.Any())
|
|
|
- // {
|
|
|
- // foreach (var item in request.Codes)
|
|
|
- // {
|
|
|
- // var entity = CacheMaintenance.Instance.Get<IDistributedServerInfosManager>().Get(item);
|
|
|
- // if (entity != null && !string.IsNullOrEmpty(entity.Code))
|
|
|
- // {
|
|
|
- // serverInformationList.Add(entity);
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // serverInformationList = CacheMaintenance.Instance.Get<IDistributedServerInfosManager>()
|
|
|
- // .Where(x => !string.IsNullOrEmpty(x.Name) && !string.IsNullOrEmpty(x.ServerUrl))?.ToList();
|
|
|
- // }
|
|
|
- // if (serverInformationList != null && serverInformationList.Any())
|
|
|
- // {
|
|
|
- // list = serverInformationList.Select(c => new ServerInfoDTO()
|
|
|
- // {
|
|
|
- // Name = c.Name,
|
|
|
- // Host = c.ServerUrl
|
|
|
- // }).ToList();
|
|
|
- // }
|
|
|
+ var serverInformationList = CacheMaintenance.Instance.Get<IDistributedServerInfosManager>()
|
|
|
+ .Where(x => !string.IsNullOrEmpty(x.Name) && !string.IsNullOrEmpty(x.ServerUrl))?.ToList();
|
|
|
+ if (serverInformationList != null && serverInformationList.Any())
|
|
|
+ {
|
|
|
+ list = serverInformationList.Select(c => new ServerInfoDTO()
|
|
|
+ {
|
|
|
+ Name = c.Name,
|
|
|
+ Host = c.ServerUrl
|
|
|
+ }).ToList();
|
|
|
+ }
|
|
|
return await Task.FromResult(list);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 测速接�
|
|
|
+ /// 测速接å�
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public async Task<EchoResult> EchoAsync()
|