index.bm.go 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
  2. // source: api/http/v1/index.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/index.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. // Index Interface
  19. // ===============
  20. // Index 相关服务
  21. type Index interface {
  22. // 首页大接口
  23. // 首页换一换接口
  24. // `dynamic_resp:"true" midware:"guest"`
  25. GetAllList(ctx context.Context, req *GetAllListReq) (resp interface{}, err error)
  26. // `midware:"guest"`
  27. Change(ctx context.Context, req *ChangeReq) (resp *ChangeResp, err error)
  28. }
  29. var v1IndexSvc Index
  30. // @params GetAllListReq
  31. // @router GET /xlive/app-interface/v1/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 := v1IndexSvc.GetAllList(c, p)
  39. c.JSON(resp, err)
  40. }
  41. // @params ChangeReq
  42. // @router GET /xlive/app-interface/v1/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 := v1IndexSvc.Change(c, p)
  50. c.JSON(resp, err)
  51. }
  52. // RegisterV1IndexService Register the blademaster route with middleware map
  53. // midMap is the middleware map, the key is defined in proto
  54. func RegisterV1IndexService(e *bm.Engine, svc Index, midMap map[string]bm.HandlerFunc) {
  55. guest := midMap["guest"]
  56. v1IndexSvc = svc
  57. e.GET("/xlive/app-interface/v1/index/getAllList", guest, indexGetAllList)
  58. e.GET("/xlive/app-interface/v1/index/change", guest, indexChange)
  59. }