| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Configuration; |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | |
| | | { |
| | | public class AiController : ApiController |
| | | { |
| | | private string getSourcePath() |
| | | { |
| | | return ConfigurationManager.AppSettings["geoJsonPath"]; |
| | | } |
| | | |
| | | [HttpPost] |
| | | [Route("footprint/predict/2")] |
| | | [Route("riverface/predict/2")] |
| | |
| | | return new R<Result>(2, "Sorry, the parameter is wrong"); |
| | | } |
| | | |
| | | Thread.Sleep(7000); |
| | | //Thread.Sleep(10000); |
| | | String target = Path.Combine(args.data_dir, "results"); |
| | | if (!Directory.Exists(target)) Directory.CreateDirectory(target); |
| | | |
| | | String source = getSourcePath(); |
| | | string[] files = Directory.GetFiles(source, "*.geojson"); |
| | | foreach (string file in files) |
| | | { |
| | | string newFile = Path.Combine(target, Path.GetFileName(file)); |
| | | File.Copy(file, newFile, true); |
| | | } |
| | | |
| | | Result rs = new Result(); |
| | | |
| | | return new R<Result>(0, "ok", rs); |