Turf/App_Start/WebApiConfig.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Turf/Controllers/AiController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Turf/Turf.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Turf/cs/Args.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Turf/cs/R.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Turf/cs/Result.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Turf/cs/Tools.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Turf/App_Start/WebApiConfig.cs
@@ -21,6 +21,8 @@ defaults: new { id = RouteParameter.Optional } ); //GlobalConfiguration.Configuration.Formatters.Add(new FormMultipartEncodedMediaTypeFormatter()); // 灞忚斀杩斿洖XML鏍煎紡 GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.Clear(); Turf/Controllers/AiController.cs
对比新文件 @@ -0,0 +1,39 @@ 锘縰sing System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Threading; using System.Web.Http; using Turf.cs; namespace Turf.Controllers { public class AiController : ApiController { [HttpPost] [Route("footprint/predict/2")] [Route("riverface/predict/2")] [Route("roadface/predict/2")] [Route("woodland/predict/2")] public R<Result> footprint([FromBody]Args args) { try { if (null == args || string.IsNullOrEmpty(args.data_dir)) { return new R<Result>(2, "Sorry, the parameter is wrong"); } Thread.Sleep(7000); Result rs = new Result(); return new R<Result>(0, "ok", rs); } catch (Exception ex) { return new R<Result>(5, ex.Message); } } } } Turf/Turf.csproj
@@ -108,8 +108,12 @@ </ItemGroup> <ItemGroup> <Compile Include="App_Start\WebApiConfig.cs" /> <Compile Include="Controllers\AiController.cs" /> <Compile Include="cs\Args.cs" /> <Compile Include="cs\ModelHandler.cs" /> <Compile Include="cs\PostgreHelper.cs" /> <Compile Include="cs\R.cs" /> <Compile Include="cs\Result.cs" /> <Compile Include="cs\Tools.cs" /> <Compile Include="Controllers\CallController.cs" /> <Compile Include="Global.asax.cs"> Turf/cs/Args.cs
对比新文件 @@ -0,0 +1,12 @@ 锘縰sing System; using System.Collections.Generic; using System.Linq; using System.Web; namespace Turf.cs { public class Args { public string data_dir { set; get; } } } Turf/cs/R.cs
对比新文件 @@ -0,0 +1,28 @@ 锘縰sing System; using System.Collections.Generic; using System.Linq; using System.Web; namespace Turf.cs { public class R<T> { public int status { set; get; } public string message { set; get; } public T datas { set; get; } public R(int status, String message) { this.status = status; this.message = message; } public R(int status, String message, T t) : this(status, message) { this.datas = t; } } } Turf/cs/Result.cs
对比新文件 @@ -0,0 +1,17 @@ 锘縰sing System; using System.Collections.Generic; using System.Linq; using System.Web; namespace Turf.cs { public class Result { public string data_type { set; get; } public Result() { this.data_type = "geojson"; } } } Turf/cs/Tools.cs
@@ -10,7 +10,6 @@ using System.Text; using System.Web; using Turf.Models; using static Mono.Security.X509.X520; namespace Turf.cs {