index.bm.go 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
  2. // source: api/http/v2/index.proto
  3. /*
  4. Package v2 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/v2/index.proto
  8. */
  9. package v2
  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. // Index Interface
  19. // ===============
  20. // Index 相关服务
  21. type Index interface {
  22. // 首页大接口
  23. // `midware:"guest,verify"`
  24. GetAllList(ctx context.Context, req *GetAllListReq) (resp *GetAllListResp, err error)
  25. // 换一换接口
  26. // `midware:"guest,verify"`
  27. Change(ctx context.Context, req *ChangeReq) (resp *ChangeResp, err error)
  28. }
  29. var v2IndexSvc Index
  30. // @params GetAllListReq
  31. // @router GET /xlive/app-interface/v2/index/getAllList
  32. // @response GetAllListResp
  33. func indexGetAllList(c *bm.Context) {
  34. p := new(GetAllListReq)
  35. if err := c.Bind(p); err != nil {
  36. return
  37. }
  38. resp, err := v2IndexSvc.GetAllList(c, p)
  39. c.JSON(resp, err)
  40. }
  41. // @params ChangeReq
  42. // @router GET /xlive/app-interface/v2/index/change
  43. // @response ChangeResp
  44. func indexChange(c *bm.Context) {
  45. p := new(ChangeReq)
  46. if err := c.Bind(p); err != nil {
  47. return
  48. }
  49. resp, err := v2IndexSvc.Change(c, p)
  50. c.JSON(resp, err)
  51. }
  52. // RegisterV2IndexService Register the blademaster route with middleware map
  53. // midMap is the middleware map, the key is defined in proto
  54. func RegisterV2IndexService(e *bm.Engine, svc Index, midMap map[string]bm.HandlerFunc) {
  55. guest := midMap["guest"]
  56. verify := midMap["verify"]
  57. v2IndexSvc = svc
  58. e.GET("/xlive/app-interface/v2/index/getAllList", guest, verify, indexGetAllList)
  59. e.GET("/xlive/app-interface/v2/index/change", guest, verify, indexChange)
  60. }