From 2bdf37bae40dd37a90363679be3245cad797769a Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期二, 24 十月 2023 17:35:19 +0800 Subject: [PATCH] 测试TB生成MPT功能 --- ExportMap/Controllers/TBController.cs | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 43 insertions(+), 0 deletions(-) diff --git a/ExportMap/Controllers/TBController.cs b/ExportMap/Controllers/TBController.cs index a181217..6c9d451 100644 --- a/ExportMap/Controllers/TBController.cs +++ b/ExportMap/Controllers/TBController.cs @@ -7,6 +7,8 @@ using System.Net.Http; using System.Web.Http; using System.IO; +using System.Diagnostics; +using System.Threading; namespace ExportMap.Controllers { @@ -36,5 +38,46 @@ return ResponseMsg<string>.fail(ex.Message); } } + + [HttpGet] // http://localhost/ExportMap/TB/Test + public ResponseMsg<string> Test() + { + try + { + Stopwatch sw = new Stopwatch(); + sw.Start(); + string err = null; + bool rs = TBUtils.Test(ref err); + sw.Stop(); + + return ResponseMsg<string>.success((rs ? "鎴愬姛" : "澶辫触") + "锛岃�楁椂锛�" + sw.ElapsedMilliseconds / 1000.0 + " s", rs.ToString()); + } + catch (Exception ex) + { + LogOut.Error(ex.Message + "\r\n" + ex.StackTrace); + return ResponseMsg<string>.fail(ex.Message); + } + } + + [HttpGet] + public ResponseMsg<string> Wait(long seconds) + { + try + { + Stopwatch sw = new Stopwatch(); + sw.Start(); + + Thread.Sleep(new TimeSpan(seconds * 10 * 1000 * 1000)); + + sw.Stop(); + + return ResponseMsg<string>.success("鎴愬姛", "鑰楁椂锛�" + sw.ElapsedMilliseconds / 1000.0 + " s"); + } + catch (Exception ex) + { + LogOut.Error(ex.Message + "\r\n" + ex.StackTrace); + return ResponseMsg<string>.fail(ex.Message); + } + } } } -- Gitblit v1.9.3