livecheck.bm.go 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
  2. // source: api/grpc/v1/livecheck.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/livecheck.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. // LiveCheck Interface
  19. // ===================
  20. type LiveCheck interface {
  21. // 客户端获取能否直播接口
  22. LiveCheck(ctx context.Context, req *LiveCheckReq) (resp *LiveCheckResp, err error)
  23. // 后台查询所有配置设备黑名单
  24. GetLiveCheckList(ctx context.Context, req *GetLiveCheckListReq) (resp *GetLiveCheckListResp, err error)
  25. // 后台添加能否直播设备黑名单
  26. AddLiveCheck(ctx context.Context, req *AddLiveCheckReq) (resp *AddLiveCheckResp, err error)
  27. }
  28. var v1LiveCheckSvc LiveCheck
  29. // @params LiveCheckReq
  30. // @router GET /xlive/resource/v1/liveCheck/LiveCheck
  31. // @response LiveCheckResp
  32. func liveCheckLiveCheck(c *bm.Context) {
  33. p := new(LiveCheckReq)
  34. if err := c.Bind(p); err != nil {
  35. return
  36. }
  37. resp, err := v1LiveCheckSvc.LiveCheck(c, p)
  38. c.JSON(resp, err)
  39. }
  40. // @params GetLiveCheckListReq
  41. // @router GET /xlive/resource/v1/liveCheck/GetLiveCheckList
  42. // @response GetLiveCheckListResp
  43. func liveCheckGetLiveCheckList(c *bm.Context) {
  44. p := new(GetLiveCheckListReq)
  45. if err := c.Bind(p); err != nil {
  46. return
  47. }
  48. resp, err := v1LiveCheckSvc.GetLiveCheckList(c, p)
  49. c.JSON(resp, err)
  50. }
  51. // @params AddLiveCheckReq
  52. // @router GET /xlive/resource/v1/liveCheck/AddLiveCheck
  53. // @response AddLiveCheckResp
  54. func liveCheckAddLiveCheck(c *bm.Context) {
  55. p := new(AddLiveCheckReq)
  56. if err := c.Bind(p); err != nil {
  57. return
  58. }
  59. resp, err := v1LiveCheckSvc.AddLiveCheck(c, p)
  60. c.JSON(resp, err)
  61. }
  62. // RegisterV1LiveCheckService Register the blademaster route with middleware map
  63. // midMap is the middleware map, the key is defined in proto
  64. func RegisterV1LiveCheckService(e *bm.Engine, svc LiveCheck, midMap map[string]bm.HandlerFunc) {
  65. v1LiveCheckSvc = svc
  66. e.GET("/xlive/resource/v1/liveCheck/LiveCheck", liveCheckLiveCheck)
  67. e.GET("/xlive/resource/v1/liveCheck/GetLiveCheckList", liveCheckGetLiveCheckList)
  68. e.GET("/xlive/resource/v1/liveCheck/AddLiveCheck", liveCheckAddLiveCheck)
  69. }