titans.bm.go 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. // Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
  2. // source: api/http/v1/titans.proto
  3. /*
  4. Package v1 is a generated blademaster stub package.
  5. This code was generated with go-common/app/tool/bmgen/protoc-gen-bm v0.1.
  6. It is generated from these files:
  7. api/http/v1/titans.proto
  8. */
  9. package v1
  10. import (
  11. "context"
  12. bm "go-common/library/net/http/blademaster"
  13. "go-common/library/net/http/blademaster/binding"
  14. )
  15. // to suppressed 'imported but not used warning'
  16. var _ *bm.Context
  17. var _ context.Context
  18. var _ binding.StructValidator
  19. // ================
  20. // Titans Interface
  21. // ================
  22. type Titans interface {
  23. // 获取配置 请求参数逗号隔开的字符串 返回`internal:"true"`
  24. GetMultiConfigs(ctx context.Context, req *MultiConfigReq) (resp *MultiConfigResp, err error)
  25. // 获取服务级配置 `internal:"true"`
  26. GetServiceConfig(ctx context.Context, req *ServiceConfigReq) (resp *ServiceConfigResp, err error)
  27. // 插入服务配置 `method:"POST" internal:"true"`
  28. SetServiceConfig(ctx context.Context, req *SetReq) (resp *SetResp, err error)
  29. // 获取服务级配置 `internal:"true"`
  30. GetServiceConfigList(ctx context.Context, req *ServiceListReq) (resp *ServiceListResp, err error)
  31. // 获取已配置的discoveryId `internal:"true"`
  32. GetTreeIds(ctx context.Context, req *TreeIdsReq) (resp *TreeIdsResp, err error)
  33. // 获取运营数据列表 `internal:"true"`
  34. GetEasyList(ctx context.Context, req *EasyGetReq) (resp *EasyGetResp, err error)
  35. // 设置运营列表 `method:"POST" internal:"true"`
  36. SetEasyList(ctx context.Context, req *EasySetReq) (resp *EasySetResp, err error)
  37. }
  38. var v1TitansSvc Titans
  39. // @params MultiConfigReq
  40. // @router GET /xlive/internal/resource/v1/titans/getMultiConfigs
  41. // @response MultiConfigResp
  42. func titansGetMultiConfigs(c *bm.Context) {
  43. p := new(MultiConfigReq)
  44. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  45. return
  46. }
  47. resp, err := v1TitansSvc.GetMultiConfigs(c, p)
  48. c.JSON(resp, err)
  49. }
  50. // @params ServiceConfigReq
  51. // @router GET /xlive/internal/resource/v1/titans/getServiceConfig
  52. // @response ServiceConfigResp
  53. func titansGetServiceConfig(c *bm.Context) {
  54. p := new(ServiceConfigReq)
  55. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  56. return
  57. }
  58. resp, err := v1TitansSvc.GetServiceConfig(c, p)
  59. c.JSON(resp, err)
  60. }
  61. // @params SetReq
  62. // @router POST /xlive/internal/resource/v1/titans/setServiceConfig
  63. // @response SetResp
  64. func titansSetServiceConfig(c *bm.Context) {
  65. p := new(SetReq)
  66. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  67. return
  68. }
  69. resp, err := v1TitansSvc.SetServiceConfig(c, p)
  70. c.JSON(resp, err)
  71. }
  72. // @params ServiceListReq
  73. // @router GET /xlive/internal/resource/v1/titans/getServiceConfigList
  74. // @response ServiceListResp
  75. func titansGetServiceConfigList(c *bm.Context) {
  76. p := new(ServiceListReq)
  77. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  78. return
  79. }
  80. resp, err := v1TitansSvc.GetServiceConfigList(c, p)
  81. c.JSON(resp, err)
  82. }
  83. // @params TreeIdsReq
  84. // @router GET /xlive/internal/resource/v1/titans/getTreeIds
  85. // @response TreeIdsResp
  86. func titansGetTreeIds(c *bm.Context) {
  87. p := new(TreeIdsReq)
  88. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  89. return
  90. }
  91. resp, err := v1TitansSvc.GetTreeIds(c, p)
  92. c.JSON(resp, err)
  93. }
  94. // @params EasyGetReq
  95. // @router GET /xlive/internal/resource/v1/titans/getEasyList
  96. // @response EasyGetResp
  97. func titansGetEasyList(c *bm.Context) {
  98. p := new(EasyGetReq)
  99. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  100. return
  101. }
  102. resp, err := v1TitansSvc.GetEasyList(c, p)
  103. c.JSON(resp, err)
  104. }
  105. // @params EasySetReq
  106. // @router POST /xlive/internal/resource/v1/titans/setEasyList
  107. // @response EasySetResp
  108. func titansSetEasyList(c *bm.Context) {
  109. p := new(EasySetReq)
  110. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  111. return
  112. }
  113. resp, err := v1TitansSvc.SetEasyList(c, p)
  114. c.JSON(resp, err)
  115. }
  116. // RegisterV1TitansService Register the blademaster route with middleware map
  117. // midMap is the middleware map, the key is defined in proto
  118. func RegisterV1TitansService(e *bm.Engine, svc Titans, midMap map[string]bm.HandlerFunc) {
  119. v1TitansSvc = svc
  120. e.GET("/xlive/internal/resource/v1/titans/getMultiConfigs", titansGetMultiConfigs)
  121. e.GET("/xlive/internal/resource/v1/titans/getServiceConfig", titansGetServiceConfig)
  122. e.POST("/xlive/internal/resource/v1/titans/setServiceConfig", titansSetServiceConfig)
  123. e.GET("/xlive/internal/resource/v1/titans/getServiceConfigList", titansGetServiceConfigList)
  124. e.GET("/xlive/internal/resource/v1/titans/getTreeIds", titansGetTreeIds)
  125. e.GET("/xlive/internal/resource/v1/titans/getEasyList", titansGetEasyList)
  126. e.POST("/xlive/internal/resource/v1/titans/setEasyList", titansSetEasyList)
  127. }