From 0ea598a134321b62b3245e4a2b22d7fb9f17feee Mon Sep 17 00:00:00 2001 From: SpringHgui <740360381@qq.com> Date: Wed, 18 Aug 2021 23:56:58 +0800 Subject: [PATCH] 2.0.1 --- FastTunnel.Core/FastTunnel.Core.csproj | 2 +- .../Controllers/BaseController.cs | 17 ---- .../Controllers/SystemController.cs | 78 ------------------- FastTunnel.Server/FastTunnel.Server.csproj | 8 ++ FastTunnel.Server/Models/ApiResponse.cs | 25 ------ .../Properties/launchSettings.json | 4 +- FastTunnel.sln | 7 ++ 7 files changed, 18 insertions(+), 123 deletions(-) delete mode 100644 FastTunnel.Server/Controllers/BaseController.cs delete mode 100644 FastTunnel.Server/Controllers/SystemController.cs delete mode 100644 FastTunnel.Server/Models/ApiResponse.cs diff --git a/FastTunnel.Core/FastTunnel.Core.csproj b/FastTunnel.Core/FastTunnel.Core.csproj index 0bb1495..2007eb2 100644 --- a/FastTunnel.Core/FastTunnel.Core.csproj +++ b/FastTunnel.Core/FastTunnel.Core.csproj @@ -18,7 +18,7 @@ git FastTunnel.Core FastTunnel.Core - 2.0.0 + 2.0.1 diff --git a/FastTunnel.Server/Controllers/BaseController.cs b/FastTunnel.Server/Controllers/BaseController.cs deleted file mode 100644 index fcc5de0..0000000 --- a/FastTunnel.Server/Controllers/BaseController.cs +++ /dev/null @@ -1,17 +0,0 @@ -using FastTunnel.Server.Models; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace FastTunnel.Server.Controllers -{ - [Route("api/[controller]/[action]")] - [ApiController] - public class BaseController : ControllerBase - { - protected ApiResponse ApiResponse = new ApiResponse(); - } -} diff --git a/FastTunnel.Server/Controllers/SystemController.cs b/FastTunnel.Server/Controllers/SystemController.cs deleted file mode 100644 index fdf59b9..0000000 --- a/FastTunnel.Server/Controllers/SystemController.cs +++ /dev/null @@ -1,78 +0,0 @@ -using FastTunnel.Core.Client; -using FastTunnel.Server.Controllers; -using FastTunnel.Server.Models; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace FastTunnel.Server -{ - public class SystemController : BaseController - { - FastTunnelServer fastTunnelServer; - - public SystemController(FastTunnelServer fastTunnelServer) - { - this.fastTunnelServer = fastTunnelServer; - } - - /// - /// 获取当前等待响应的请求数 - /// - /// - [HttpGet] - public ApiResponse GetResponseTempCount() - { - ApiResponse.data = fastTunnelServer.ResponseTasks.Count; - return ApiResponse; - } - - /// - /// 获取当前映射的所有站点信息 - /// - /// - [HttpGet] - public ApiResponse GetAllWebList() - { - ApiResponse.data = fastTunnelServer.WebList.Select(x => new { x.Key, x.Value.WebConfig.LocalIp, x.Value.WebConfig.LocalPort }); - return ApiResponse; - } - - /// - /// 获取服务端配置信息 - /// - /// - [HttpGet] - public ApiResponse GetServerOption() - { - ApiResponse.data = fastTunnelServer.ServerOption; - return ApiResponse; - } - - /// - /// 获取所有端口转发映射列表 - /// - /// - [HttpGet] - public ApiResponse GetAllForwardList() - { - ApiResponse.data = fastTunnelServer.ForwardList.Select(x => new { x.Key, x.Value.SSHConfig.LocalIp, x.Value.SSHConfig.LocalPort, x.Value.SSHConfig.RemotePort }); - - return ApiResponse; - } - - /// - /// 获取当前客户端在线数量 - /// - /// - [HttpGet] - public ApiResponse GetOnlineClientCount() - { - ApiResponse.data = fastTunnelServer.ConnectedClientCount; - return ApiResponse; - } - } -} diff --git a/FastTunnel.Server/FastTunnel.Server.csproj b/FastTunnel.Server/FastTunnel.Server.csproj index 657afe0..761339f 100644 --- a/FastTunnel.Server/FastTunnel.Server.csproj +++ b/FastTunnel.Server/FastTunnel.Server.csproj @@ -7,6 +7,13 @@ Linux + + + + + + + @@ -17,6 +24,7 @@ + diff --git a/FastTunnel.Server/Models/ApiResponse.cs b/FastTunnel.Server/Models/ApiResponse.cs deleted file mode 100644 index bd86d72..0000000 --- a/FastTunnel.Server/Models/ApiResponse.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace FastTunnel.Server.Models -{ - public class ApiResponse - { - /// - /// 错误码 - /// 0 成功,其他为失败 - /// - public ErrorCodeEnum errorCode { get; set; } - - public string errorMessage { get; set; } - - public object data { get; set; } - } - - public enum ErrorCodeEnum - { - NONE = 0, - } -} diff --git a/FastTunnel.Server/Properties/launchSettings.json b/FastTunnel.Server/Properties/launchSettings.json index cb0f412..ea64ade 100644 --- a/FastTunnel.Server/Properties/launchSettings.json +++ b/FastTunnel.Server/Properties/launchSettings.json @@ -11,8 +11,8 @@ "profiles": { "FastTunnel.Server": { "commandName": "Project", - //"launchBrowser": true, - "launchUrl": "", + "launchBrowser": true, + "launchUrl": "http://localhost:1270/swagger", "applicationUrl": "https://localhost:5001;http://localhost:5000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" diff --git a/FastTunnel.sln b/FastTunnel.sln index 11aee2e..61b97bb 100644 --- a/FastTunnel.sln +++ b/FastTunnel.sln @@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastTunnel.Server", "FastTu EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{0E2A9DA2-26AE-4657-B4C5-3A913E2F5A3C}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FastTunnel.Api", "FastTunnel.Api\FastTunnel.Api.csproj", "{7D560A9A-E480-40F4-AAF7-398447438255}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -29,12 +31,17 @@ Global {DEF2E322-9075-4C3F-9967-7EAF0EE28CEB}.Debug|Any CPU.Build.0 = Debug|Any CPU {DEF2E322-9075-4C3F-9967-7EAF0EE28CEB}.Release|Any CPU.ActiveCfg = Release|Any CPU {DEF2E322-9075-4C3F-9967-7EAF0EE28CEB}.Release|Any CPU.Build.0 = Release|Any CPU + {7D560A9A-E480-40F4-AAF7-398447438255}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7D560A9A-E480-40F4-AAF7-398447438255}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7D560A9A-E480-40F4-AAF7-398447438255}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7D560A9A-E480-40F4-AAF7-398447438255}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {C8ADFEB1-59DB-4CE3-8D04-5B547107BCCB} = {0E2A9DA2-26AE-4657-B4C5-3A913E2F5A3C} + {7D560A9A-E480-40F4-AAF7-398447438255} = {0E2A9DA2-26AE-4657-B4C5-3A913E2F5A3C} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {3D9C6B44-6706-4EE8-9043-802BBE474A2E}