SersEventService.cs 981 B

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using Sers.Core.Module.PubSub;
  3. using Vit.Core.Module.Log;
  4. namespace Sers.Gover.Service.SersEvent
  5. {
  6. /// <summary>
  7. /// 目前有 SersEvent.ServiceStation.Start 、 SersEvent.ServiceStation.Pause、 SersEvent.ServiceStation.Add、 SersEvent.ServiceStation.Remove
  8. /// </summary>
  9. public class SersEventService
  10. {
  11. public const string Event_ServiceStation_Start = "Start";
  12. public const string Event_ServiceStation_Pause = "Pause";
  13. public const string Event_ServiceStation_Add = "Add";
  14. public const string Event_ServiceStation_Remove = "Remove";
  15. public static void Publish(string eventName,object msgBody)
  16. {
  17. try
  18. {
  19. MessageClient.Publish("SersEvent.ServiceStation."+ eventName, msgBody);
  20. }
  21. catch (Exception ex)
  22. {
  23. Logger.Error(ex);
  24. }
  25. }
  26. }
  27. }