管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2024-08-05 c257c3a8b77b0a4057cd80ffca6512a42efb3500
1
已修改2个文件
22 ■■■■■ 文件已修改
Turf/Controllers/AiController.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Turf/Web.config 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Turf/Controllers/AiController.cs
@@ -1,5 +1,7 @@
using 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);
Turf/Web.config
@@ -9,6 +9,8 @@
        <add key="webpages:Enabled" value="false" />
        <add key="ClientValidationEnabled" value="true" />
        <add key="UnobtrusiveJavaScriptEnabled" value="true" />
        <!-- geojson目录 -->
      <add key="geoJsonPath" value="D:\AI\datacache\1722828277901\results"/>
    </appSettings>
    <system.web>
        <compilation debug="true" targetFramework="4.5.2" />