SvrReportController.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.Data.Entity;
  5. using System.Data.Entity.Migrations;
  6. using System.Data.SqlClient;
  7. using System.IO;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.Web.Http;
  12. using DevExpress.XtraBars;
  13. using Serilog;
  14. using XdCxRhDW.App.Model;
  15. using XdCxRhDW.Dto;
  16. using XdCxRhDW.WebApi;
  17. namespace XdCxRhDW.App.Controllers
  18. {
  19. /// <summary>
  20. /// 服务状态上报接口
  21. /// </summary>
  22. public class SvrReportController : BaseController
  23. {
  24. /// <summary>
  25. /// 服务状态上报
  26. /// </summary>
  27. /// <param name="dto">服务状态信息</param>
  28. /// <returns></returns>
  29. [HttpPost]
  30. public AjaxResult Report(SvrStateReportDto dto)
  31. {
  32. try
  33. {
  34. Messenger.Defalut.Pub("服务状态改变", dto);
  35. return Success();
  36. }
  37. catch (Exception ex)
  38. {
  39. Serilog.Log.Error(ex, "服务状态上报处理出错!");
  40. return Error("服务状态上报处理出错");
  41. }
  42. }
  43. }
  44. //public class ItemSvrEventArgs
  45. //{
  46. // /// <summary>
  47. // /// 错误码
  48. // /// </summary>
  49. // public int code { get; set; }
  50. // /// <summary>
  51. // /// 消息
  52. // /// </summary>
  53. // public string msg { get; set; }
  54. // /// <summary>
  55. // /// 服务
  56. // /// </summary>
  57. // public ModelSvr modelSvrs { get; set; }
  58. //}
  59. }