using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity;
using System.Data.Entity.Migrations;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using DevExpress.XtraBars;
using Serilog;
using XdCxRhDW.App.Model;
using XdCxRhDW.Dto;
using XdCxRhDW.WebApi;
namespace XdCxRhDW.App.Controllers
{
///
/// 服务状态上报接口
///
public class SvrReportController : BaseController
{
///
/// 服务状态上报
///
/// 服务状态信息
///
[HttpPost]
public AjaxResult Report(SvrStateReportDto dto)
{
try
{
Messenger.Defalut.Pub("服务状态改变", dto);
return Success();
}
catch (Exception ex)
{
Serilog.Log.Error(ex, "服务状态上报处理出错!");
return Error("服务状态上报处理出错");
}
}
}
public class ItemSvrEventArgs
{
///
/// 错误码
///
public int code { get; set; }
///
/// 消息
///
public string msg { get; set; }
///
/// 服务
///
public ModelSvrs modelSvrs { get; set; }
}
public static class TaskSvr
{
public static event Func EventTaskSvr;
public static ItemSvrEventArgs GetTaskSvt()
{
return EventTaskSvr?.Invoke();
}
}
}