From 54d918939c9f05e7588beb571cb49675433fc93d Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期三, 15 三月 2023 17:04:19 +0800
Subject: [PATCH] 1

---
 ExportMap/Controllers/ConvertController.cs |   38 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 37 insertions(+), 1 deletions(-)

diff --git a/ExportMap/Controllers/ConvertController.cs b/ExportMap/Controllers/ConvertController.cs
index fecb90e..bf239e8 100644
--- a/ExportMap/Controllers/ConvertController.cs
+++ b/ExportMap/Controllers/ConvertController.cs
@@ -11,6 +11,9 @@
 {
     public class ConvertController : ApiController
     {
+        /// <summary>
+        /// 杞崲涓篢ileset
+        /// </summary>
         [HttpPost]
         public ResponseMsg<int> ToTileset([FromBody]XYZArgs args)
         {
@@ -18,7 +21,7 @@
             {
                 if (null == args || null == args.ids || args.ids.Count == 0)
                 {
-                    return ResponseMsg<int>.fail("璇疯緭鍏ュ厓鏁版嵁id");
+                    return ResponseMsg<int>.fail("璇疯緭鍏ュ厓鏁版嵁ID");
                 }
 
                 int count = ConvertUtils.Convert(args.ids);
@@ -31,5 +34,38 @@
                 return ResponseMsg<int>.fail(ex.Message);
             }
         }
+
+        /// <summary>
+        /// 杞崲涓虹摝鐗�
+        /// </summary>
+        [HttpPost]
+        public ResponseMsg<int> ToTiles([FromBody]XYZArgs args)
+        {
+            try
+            {
+                if (null == args || null == args.ids || args.ids.Count == 0)
+                {
+                    return ResponseMsg<int>.fail("璇疯緭鍏ュ厓鏁版嵁ID");
+                }
+                if (args.min < 0 || args.max > 20 || string.IsNullOrWhiteSpace(args.dircode))
+                {
+                    return ResponseMsg<int>.fail("杈撳叆鐨勫弬鏁版湁璇�");
+                }
+
+                string err = null;
+                int count = XYZUtils.Generate(args, ref err);
+                if (0 == count)
+                {
+                    return ResponseMsg<int>.fail(null == err ? "鐢熸垚澶辫触" : err);
+                }
+
+                return ResponseMsg<int>.success("鎴愬姛", count);
+            }
+            catch (Exception ex)
+            {
+                LogOut.Error(ex.StackTrace);
+                return ResponseMsg<int>.fail(ex.Message);
+            }
+        }
     }
 }

--
Gitblit v1.9.3