From 90858c80d9921b555119f41060c1f883f6e6ffc5 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期四, 26 十二月 2024 12:49:35 +0800 Subject: [PATCH] 提交 --- DocumentFile.Service/Controllers/DocumentController.cs | 37 +++++++++++++++++++++++++++++++++++++ 1 files changed, 37 insertions(+), 0 deletions(-) diff --git a/DocumentFile.Service/Controllers/DocumentController.cs b/DocumentFile.Service/Controllers/DocumentController.cs index ad042ab..3521756 100644 --- a/DocumentFile.Service/Controllers/DocumentController.cs +++ b/DocumentFile.Service/Controllers/DocumentController.cs @@ -135,6 +135,43 @@ return new JsonResult(msg); } + + + /// <summary> + /// 鍒犻櫎鏂囦欢 + /// </summary> + /// <param name="delurl"></param> + /// <returns></returns> + [HttpPost] + public IActionResult FileLastWriteTime([FromForm] string delurl) + { + ReturnMsg msg = new ReturnMsg(); + try + { + if (delurl != null && delurl.Length > 0) + { + var dir = AppDomain.CurrentDomain.BaseDirectory; + + if (!string.IsNullOrEmpty(delurl)) + { + var path = dir + delurl; + if (System.IO.File.Exists(path)) + { + var lastWriteTime = System.IO.File.GetLastWriteTime(path); + msg.lastWriteTime = lastWriteTime.ToString(); + } + } + msg.code = 1; + } + } + catch (Exception ex) + { + NLogProvider.GetInstance().Error(ex); + } + return new JsonResult(msg); + } + + /// <summary> /// 涓嬭浇鏂囦欢 /// </summary> -- Gitblit v1.9.1