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.Repostory;
using DW5S.WebApi;
using Microsoft.AspNetCore.Mvc;
using Serilog;
namespace DW5S.Controllers
{
///
/// 服务状态上报接口
///
public class SvrReportController : BaseController
{
ILogger logger { get; set; }
IUnitOfWork unitOfWork { get; set; }
///
/// 服务状态上报
///
/// 服务状态信息
///
[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.Error(ex, msg);
return Error(msg);
}
}
}
}