From d97c907a80e404b0f74d6930d96c59aa4d4f66c1 Mon Sep 17 00:00:00 2001 From: 18942506660 <18942506660@A18942506660> Date: Sat, 16 Mar 2024 10:34:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=89=8D=E7=AB=AF=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ClientLogController.cs | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/WMS.Web.Api/Controllers/ClientLogController.cs diff --git a/src/WMS.Web.Api/Controllers/ClientLogController.cs b/src/WMS.Web.Api/Controllers/ClientLogController.cs new file mode 100644 index 00000000..c3b7ea36 --- /dev/null +++ b/src/WMS.Web.Api/Controllers/ClientLogController.cs @@ -0,0 +1,34 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using WMS.Web.Core.Internal.Results; + +namespace WMS.Web.Api.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class ClientLogController : ControllerBase + { + private readonly ILogger _Logger; + public ClientLogController(ILogger Logger) + { + _Logger = Logger; + } + /// + /// 前端记录日志 + /// + /// + /// + [HttpGet] + [Route("Log")] + public Task Log([FromQuery] string log) + { + _Logger.LogInformation($"前端日志 时间:{DateTime.Now} 内容:{log}"); + return Task.FromResult(Result.ReSuccess()); + } + } +}