gaea.bm.go 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. // Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
  2. // source: gaea.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. gaea.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. var PathGaeaGetConfigByKeyword = "/live.liveadmin.v1.gaea/get_config_by_keyword"
  20. var PathGaeaSetConfigByKeyword = "/live.liveadmin.v1.gaea/set_config_by_keyword"
  21. var PathGaeaGetConfigsByParams = "/live.liveadmin.v1.gaea/get_configs_by_params"
  22. var PathGaeaGetConfigsByTeam = "/live.liveadmin.v1.gaea/get_configs_by_team"
  23. var PathGaeaGetConfigsByKeyword = "/live.liveadmin.v1.gaea/get_configs_by_keyword"
  24. var PathGaeaGetConfigsByTeams = "/live.liveadmin.v1.gaea/get_configs_by_teams"
  25. // ==============
  26. // Gaea Interface
  27. // ==============
  28. type GaeaBMServer interface {
  29. // 获取team下某个keyword的配置 `internal:"true"`
  30. GetConfigByKeyword(ctx context.Context, req *GetConfigReq) (resp *GetConfigResp, err error)
  31. // `method:"POST" internal:"true"` 设置team下某个keyword配置
  32. SetConfigByKeyword(ctx context.Context, req *SetConfigReq) (resp *SetConfigResp, err error)
  33. // 管理后台根据条件获取配置 `internal:"true"`
  34. GetConfigsByParams(ctx context.Context, req *ParamsConfigReq) (resp *ParamsConfigResp, err error)
  35. // 获取单个team的全部配置 `internal:"true"`
  36. GetConfigsByTeam(ctx context.Context, req *TeamConfigReq) (resp *TeamConfigResp, err error)
  37. // 通过keyword获取配置 `internal:"true"`
  38. GetConfigsByKeyword(ctx context.Context, req *GetConfigsReq) (resp *GetConfigsResp, err error)
  39. // 获取多个team下的全部配置 `internal:"true"`
  40. GetConfigsByTeams(ctx context.Context, req *TeamsConfigReq) (resp *TeamsConfigResp, err error)
  41. }
  42. var v1GaeaSvc GaeaBMServer
  43. func gaeaGetConfigByKeyword(c *bm.Context) {
  44. p := new(GetConfigReq)
  45. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  46. return
  47. }
  48. resp, err := v1GaeaSvc.GetConfigByKeyword(c, p)
  49. c.JSON(resp, err)
  50. }
  51. func gaeaSetConfigByKeyword(c *bm.Context) {
  52. p := new(SetConfigReq)
  53. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  54. return
  55. }
  56. resp, err := v1GaeaSvc.SetConfigByKeyword(c, p)
  57. c.JSON(resp, err)
  58. }
  59. func gaeaGetConfigsByParams(c *bm.Context) {
  60. p := new(ParamsConfigReq)
  61. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  62. return
  63. }
  64. resp, err := v1GaeaSvc.GetConfigsByParams(c, p)
  65. c.JSON(resp, err)
  66. }
  67. func gaeaGetConfigsByTeam(c *bm.Context) {
  68. p := new(TeamConfigReq)
  69. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  70. return
  71. }
  72. resp, err := v1GaeaSvc.GetConfigsByTeam(c, p)
  73. c.JSON(resp, err)
  74. }
  75. func gaeaGetConfigsByKeyword(c *bm.Context) {
  76. p := new(GetConfigsReq)
  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 := v1GaeaSvc.GetConfigsByKeyword(c, p)
  81. c.JSON(resp, err)
  82. }
  83. func gaeaGetConfigsByTeams(c *bm.Context) {
  84. p := new(TeamsConfigReq)
  85. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  86. return
  87. }
  88. resp, err := v1GaeaSvc.GetConfigsByTeams(c, p)
  89. c.JSON(resp, err)
  90. }
  91. // RegisterV1GaeaService Register the blademaster route with middleware map
  92. // midMap is the middleware map, the key is defined in proto
  93. func RegisterV1GaeaService(e *bm.Engine, svc GaeaBMServer, midMap map[string]bm.HandlerFunc) {
  94. v1GaeaSvc = svc
  95. e.GET("/xlive/internal/live-admin/v1/gaea/get_config_by_keyword", gaeaGetConfigByKeyword)
  96. e.POST("/xlive/internal/live-admin/v1/gaea/set_config_by_keyword", gaeaSetConfigByKeyword)
  97. e.GET("/xlive/internal/live-admin/v1/gaea/get_configs_by_params", gaeaGetConfigsByParams)
  98. e.GET("/xlive/internal/live-admin/v1/gaea/get_configs_by_team", gaeaGetConfigsByTeam)
  99. e.GET("/xlive/internal/live-admin/v1/gaea/get_configs_by_keyword", gaeaGetConfigsByKeyword)
  100. e.GET("/xlive/internal/live-admin/v1/gaea/get_configs_by_teams", gaeaGetConfigsByTeams)
  101. }
  102. // RegisterGaeaBMServer Register the blademaster route
  103. func RegisterGaeaBMServer(e *bm.Engine, server GaeaBMServer) {
  104. v1GaeaSvc = server
  105. e.GET("/live.liveadmin.v1.gaea/get_config_by_keyword", gaeaGetConfigByKeyword)
  106. e.POST("/live.liveadmin.v1.gaea/set_config_by_keyword", gaeaSetConfigByKeyword)
  107. e.GET("/live.liveadmin.v1.gaea/get_configs_by_params", gaeaGetConfigsByParams)
  108. e.GET("/live.liveadmin.v1.gaea/get_configs_by_team", gaeaGetConfigsByTeam)
  109. e.GET("/live.liveadmin.v1.gaea/get_configs_by_keyword", gaeaGetConfigsByKeyword)
  110. e.GET("/live.liveadmin.v1.gaea/get_configs_by_teams", gaeaGetConfigsByTeams)
  111. }