From c257c3a8b77b0a4057cd80ffca6512a42efb3500 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期一, 05 八月 2024 15:53:34 +0800
Subject: [PATCH] 1

---
 Turf/Controllers/AiController.cs |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/Turf/Controllers/AiController.cs b/Turf/Controllers/AiController.cs
index c852293..242f4b7 100644
--- a/Turf/Controllers/AiController.cs
+++ b/Turf/Controllers/AiController.cs
@@ -1,5 +1,7 @@
 锘縰sing System;
 using System.Collections.Generic;
+using System.Configuration;
+using System.IO;
 using System.Linq;
 using System.Net;
 using System.Net.Http;
@@ -11,6 +13,11 @@
 {
     public class AiController : ApiController
     {
+        private string getSourcePath()
+        {
+            return ConfigurationManager.AppSettings["geoJsonPath"];
+        }
+
         [HttpPost]
         [Route("footprint/predict/2")]
         [Route("riverface/predict/2")]
@@ -25,7 +32,18 @@
                     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);

--
Gitblit v1.9.3