代码整理

This commit is contained in:
jianzhichu
2026-01-23 22:24:00 +08:00
parent 60f6e3847d
commit 3f6b1874eb
60 changed files with 348 additions and 991 deletions
+2 -5
View File
@@ -1,9 +1,6 @@
using dy.net.model.dto;
using dy.net.service;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Net.Http;
namespace dy.net.Controllers
{
@@ -14,14 +11,14 @@ namespace dy.net.Controllers
private readonly IWebHostEnvironment webHostEnvironment;
private readonly LogInfoService logInfoService;
public LogsController(IWebHostEnvironment webHostEnvironment,LogInfoService logInfoService)
public LogsController(IWebHostEnvironment webHostEnvironment, LogInfoService logInfoService)
{
this.webHostEnvironment = webHostEnvironment;
this.logInfoService = logInfoService;
}
[HttpGet("/api/logs/GetLog/{type}/{date}")]
public async Task<IActionResult> GetLog([FromRoute]string type, [FromRoute] string date)
public async Task<IActionResult> GetLog([FromRoute] string type, [FromRoute] string date)
{
var filePath = Path.Combine(webHostEnvironment.IsDevelopment() ? Directory.GetCurrentDirectory() : AppDomain.CurrentDomain.BaseDirectory, "logs", $"log-{type}-{date}.txt");
if (!System.IO.File.Exists(filePath))