using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Data.SqlClient; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using DW5S.DTO; using DW5S.WebApi; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; namespace DW5S.App.Controllers { /// /// 服务状态上报接口 /// public class SvrReportController : BaseController { [Autowired] private readonly ILogger logger; /// /// 服务状态上报 /// /// 服务状态信息 /// [HttpPost] public AjaxResult Report(SvrStateReportDto dto) { try { if (!string.IsNullOrWhiteSpace(dto.BaseHttpAddr)) { if (dto.BaseHttpAddr.EndsWith("/")) dto.BaseHttpAddr = dto.BaseHttpAddr + "api/"; else dto.BaseHttpAddr = dto.BaseHttpAddr + "/api/"; } Messenger.Defalut.Pub("服务状态改变", dto); return Success(); } catch (Exception ex) { string msg = "服务状态处理出错"; logger.LogError(ex, msg); return Error(msg); } } } }