1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- 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
- {
- /// <summary>
- /// 服务状态上报接口
- /// </summary>
- public class SvrReportController : BaseController
- {
- /// <summary>
- /// 服务状态上报
- /// </summary>
- /// <param name="dto">服务状态信息</param>
- /// <returns></returns>
- [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)
- {
- Serilog.Log.Error(ex, "服务状态上报处理出错!");
- return Error("服务状态上报处理出错");
- }
- }
- }
- //public class ItemSvrEventArgs
- //{
- // /// <summary>
- // /// 错误码
- // /// </summary>
- // public int code { get; set; }
- // /// <summary>
- // /// 消息
- // /// </summary>
- // public string msg { get; set; }
- // /// <summary>
- // /// 服务
- // /// </summary>
- // public ModelSvr modelSvrs { get; set; }
- //}
- }
|