add EndPointInfo class

This commit is contained in:
Luke Pulverenti
2016-01-09 16:27:30 -05:00
parent d47e19d0e6
commit 18a6cd629c
5 changed files with 18 additions and 8 deletions

View File

@@ -13,6 +13,7 @@ using System.IO;
using System.Linq;
using System.Threading.Tasks;
using CommonIO;
using MediaBrowser.Model.Net;
namespace MediaBrowser.Api.System
{
@@ -65,7 +66,7 @@ namespace MediaBrowser.Api.System
[Route("/System/Endpoint", "GET", Summary = "Gets information about the request endpoint")]
[Authenticated]
public class GetEndpointInfo : IReturn<EndpointInfo>
public class GetEndpointInfo : IReturn<EndPointInfo>
{
public string Endpoint { get; set; }
}
@@ -210,17 +211,11 @@ namespace MediaBrowser.Api.System
public object Get(GetEndpointInfo request)
{
return ToOptimizedResult(new EndpointInfo
return ToOptimizedResult(new EndPointInfo
{
IsLocal = Request.IsLocal,
IsInNetwork = _network.IsInLocalNetwork(request.Endpoint ?? Request.RemoteIp)
});
}
}
public class EndpointInfo
{
public bool IsLocal { get; set; }
public bool IsInNetwork { get; set; }
}
}