ServiceStationController.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. using System.Collections.Generic;
  2. using Sers.Core.Module.Rpc;
  3. using Sers.Gover.Base;
  4. using Sers.Gover.Base.Model;
  5. using Sers.SersLoader;
  6. using Sers.SersLoader.ApiDesc.Attribute.Valid;
  7. using Vit.Core.Util.ComponentModel.Api;
  8. using Vit.Core.Util.ComponentModel.Data;
  9. using Vit.Core.Util.ComponentModel.Model;
  10. namespace Sers.Gover.Controllers.ApiControllers
  11. {
  12. [SsStationName("_gover_")]
  13. public class ServiceStationController : IApiController
  14. {
  15. /// <summary>
  16. /// 获取所有ServiceStation
  17. /// </summary>
  18. /// <returns></returns>
  19. [SsRoute("serviceStation/getAll")]
  20. [SsCallerSource(ECallerSource.Internal)]
  21. //[CallFromGover]
  22. [SsName("获取所有ServiceStation")]
  23. public ApiReturn<List<ServiceStationData>> GetAll()
  24. {
  25. return new ApiReturn<List<ServiceStationData>> { data = GoverApiCenterService.Instance.ServiceStation_GetAll() };
  26. }
  27. /// <summary>
  28. /// 暂停指定的服务站点
  29. /// </summary>
  30. /// <returns></returns>
  31. [SsRoute("serviceStation/pause")]
  32. [SsCallerSource(ECallerSource.Internal)]
  33. //[CallFromGover]
  34. [SsName("暂停指定的服务站点")]
  35. public ApiReturn Pause(string connKey)
  36. {
  37. return new ApiReturn { success = GoverApiCenterService.Instance.ServiceStation_Pause(connKey) };
  38. }
  39. /// <summary>
  40. /// 启用指定的服务站点
  41. /// </summary>
  42. /// <returns></returns>
  43. [SsRoute("serviceStation/start")]
  44. [SsCallerSource(ECallerSource.Internal)]
  45. //[CallFromGover]
  46. [SsName("启用指定的服务站点")]
  47. public ApiReturn Start(string connKey)
  48. {
  49. return new ApiReturn { success = GoverApiCenterService.Instance.ServiceStation_Start(connKey) };
  50. }
  51. /// <summary>
  52. /// 启用指定的服务站点
  53. /// </summary>
  54. /// <returns></returns>
  55. [SsRoute("serviceStation/stop")]
  56. [SsCallerSource(ECallerSource.Internal)]
  57. //[CallFromGover]
  58. [SsName("启用指定的服务站点")]
  59. public ApiReturn Stop(string connKey)
  60. {
  61. return new ApiReturn { success = GoverApiCenterService.Instance.ServiceStation_Stop(connKey) };
  62. }
  63. }
  64. }