titans.bm.go 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. // Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
  2. // source: api/grpc/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/grpc/v1/titans.proto
  8. */
  9. package v1
  10. import (
  11. "context"
  12. bm "go-common/library/net/http/blademaster"
  13. )
  14. // to suppressed 'imported but not used warning'
  15. var _ *bm.Context
  16. var _ context.Context
  17. // ================
  18. // Titans Interface
  19. // ================
  20. type Titans interface {
  21. // 获取team下某个keyword的配置 `internal:"true"`
  22. GetConfigByKeyword(ctx context.Context, req *GetConfigReq) (resp *GetConfigResp, err error)
  23. // 设置team下某个keyword配置 `internal:"true"`
  24. SetConfigByKeyword(ctx context.Context, req *SetConfigReq) (resp *SetConfigResp, err error)
  25. // 管理后台根据条件获取配置 `internal:"true"`
  26. GetConfigsByParams(ctx context.Context, req *ParamsConfigReq) (resp *ParamsConfigResp, err error)
  27. // 获取discover_id对应的全部配置 `internal:"true"`
  28. GetByTreeId(ctx context.Context, req *TreeIdReq) (resp *TreeIdResp, err error)
  29. // 获取多个team或索引的的全部配置 `internal:"true"`
  30. GetConfigsByLikes(ctx context.Context, req *LikesConfigReq) (resp *LikesConfigResp, err error)
  31. }
  32. var v1TitansSvc Titans
  33. // @params GetConfigReq
  34. // @router GET /xlive/internal/resource/v1/titans/get_config_by_keyword
  35. // @response GetConfigResp
  36. func titansGetConfigByKeyword(c *bm.Context) {
  37. p := new(GetConfigReq)
  38. if err := c.Bind(p); err != nil {
  39. return
  40. }
  41. resp, err := v1TitansSvc.GetConfigByKeyword(c, p)
  42. c.JSON(resp, err)
  43. }
  44. // @params SetConfigReq
  45. // @router GET /xlive/internal/resource/v1/titans/set_config_by_keyword
  46. // @response SetConfigResp
  47. func titansSetConfigByKeyword(c *bm.Context) {
  48. p := new(SetConfigReq)
  49. if err := c.Bind(p); err != nil {
  50. return
  51. }
  52. resp, err := v1TitansSvc.SetConfigByKeyword(c, p)
  53. c.JSON(resp, err)
  54. }
  55. // @params ParamsConfigReq
  56. // @router GET /xlive/internal/resource/v1/titans/get_configs_by_params
  57. // @response ParamsConfigResp
  58. func titansGetConfigsByParams(c *bm.Context) {
  59. p := new(ParamsConfigReq)
  60. if err := c.Bind(p); err != nil {
  61. return
  62. }
  63. resp, err := v1TitansSvc.GetConfigsByParams(c, p)
  64. c.JSON(resp, err)
  65. }
  66. // @params TreeIdReq
  67. // @router GET /xlive/internal/resource/v1/titans/getByTreeId
  68. // @response TreeIdResp
  69. func titansGetByTreeId(c *bm.Context) {
  70. p := new(TreeIdReq)
  71. if err := c.Bind(p); err != nil {
  72. return
  73. }
  74. resp, err := v1TitansSvc.GetByTreeId(c, p)
  75. c.JSON(resp, err)
  76. }
  77. // @params LikesConfigReq
  78. // @router GET /xlive/internal/resource/v1/titans/get_configs_by_likes
  79. // @response LikesConfigResp
  80. func titansGetConfigsByLikes(c *bm.Context) {
  81. p := new(LikesConfigReq)
  82. if err := c.Bind(p); err != nil {
  83. return
  84. }
  85. resp, err := v1TitansSvc.GetConfigsByLikes(c, p)
  86. c.JSON(resp, err)
  87. }
  88. // RegisterV1TitansService Register the blademaster route with middleware map
  89. // midMap is the middleware map, the key is defined in proto
  90. func RegisterV1TitansService(e *bm.Engine, svc Titans, midMap map[string]bm.HandlerFunc) {
  91. v1TitansSvc = svc
  92. e.GET("/xlive/internal/resource/v1/titans/get_config_by_keyword", titansGetConfigByKeyword)
  93. e.GET("/xlive/internal/resource/v1/titans/set_config_by_keyword", titansSetConfigByKeyword)
  94. e.GET("/xlive/internal/resource/v1/titans/get_configs_by_params", titansGetConfigsByParams)
  95. e.GET("/xlive/internal/resource/v1/titans/getByTreeId", titansGetByTreeId)
  96. e.GET("/xlive/internal/resource/v1/titans/get_configs_by_likes", titansGetConfigsByLikes)
  97. }