service.bm.go 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. // Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
  2. // source: service.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. service.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 PathRoomAdminIsAny = "/live.appucenter.v1.RoomAdmin/is_any"
  20. var PathRoomAdminGetByUid = "/live.appucenter.v1.RoomAdmin/get_by_uid"
  21. var PathRoomAdminResign = "/live.appucenter.v1.RoomAdmin/resign"
  22. var PathRoomAdminSearchForAdmin = "/live.appucenter.v1.RoomAdmin/search_for_admin"
  23. var PathRoomAdminGetByAnchor = "/live.appucenter.v1.RoomAdmin/get_by_anchor"
  24. var PathRoomAdminDismiss = "/live.appucenter.v1.RoomAdmin/dismiss"
  25. var PathRoomAdminAppoint = "/live.appucenter.v1.RoomAdmin/appoint"
  26. // ===================
  27. // RoomAdmin Interface
  28. // ===================
  29. // History 相关服务
  30. type RoomAdminBMServer interface {
  31. // 根据登录态获取功能入口是否显示, 需要登录态
  32. // `method:"GET" midware:"auth"`
  33. IsAny(ctx context.Context, req *ShowEntryReq) (resp *ShowEntryResp, err error)
  34. // 获取用户拥有的的所有房管身份
  35. // `method:"GET" midware:"auth"`
  36. GetByUid(ctx context.Context, req *RoomAdminGetByUidReq) (resp *RoomAdminGetByUidResp, err error)
  37. // 辞职房管
  38. // `method:"POST" midware:"auth"`
  39. Resign(ctx context.Context, req *RoomAdminResignRoomAdminReq) (resp *RoomAdminResignRoomAdminResp, err error)
  40. // 查询需要添加的房管
  41. // `method:"POST" midware:"auth"`
  42. SearchForAdmin(ctx context.Context, req *RoomAdminSearchForAdminReq) (resp *RoomAdminSearchForAdminResp, err error)
  43. // 获取主播拥有的的所有房管
  44. // `method:"GET" midware:"auth"`
  45. GetByAnchor(ctx context.Context, req *RoomAdminGetByAnchorReq) (resp *RoomAdminGetByAnchorResp, err error)
  46. // 撤销房管
  47. // `method:"POST" midware:"auth"`
  48. Dismiss(ctx context.Context, req *RoomAdminDismissAdminReq) (resp *RoomAdminDismissAdminResp, err error)
  49. // 任命房管
  50. // `method:"POST" midware:"auth"`
  51. Appoint(ctx context.Context, req *RoomAdminAddReq) (resp *RoomAdminAddResp, err error)
  52. }
  53. var v1RoomAdminSvc RoomAdminBMServer
  54. func roomAdminIsAny(c *bm.Context) {
  55. p := new(ShowEntryReq)
  56. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  57. return
  58. }
  59. resp, err := v1RoomAdminSvc.IsAny(c, p)
  60. c.JSON(resp, err)
  61. }
  62. func roomAdminGetByUid(c *bm.Context) {
  63. p := new(RoomAdminGetByUidReq)
  64. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  65. return
  66. }
  67. resp, err := v1RoomAdminSvc.GetByUid(c, p)
  68. c.JSON(resp, err)
  69. }
  70. func roomAdminResign(c *bm.Context) {
  71. p := new(RoomAdminResignRoomAdminReq)
  72. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  73. return
  74. }
  75. resp, err := v1RoomAdminSvc.Resign(c, p)
  76. c.JSON(resp, err)
  77. }
  78. func roomAdminSearchForAdmin(c *bm.Context) {
  79. p := new(RoomAdminSearchForAdminReq)
  80. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  81. return
  82. }
  83. resp, err := v1RoomAdminSvc.SearchForAdmin(c, p)
  84. c.JSON(resp, err)
  85. }
  86. func roomAdminGetByAnchor(c *bm.Context) {
  87. p := new(RoomAdminGetByAnchorReq)
  88. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  89. return
  90. }
  91. resp, err := v1RoomAdminSvc.GetByAnchor(c, p)
  92. c.JSON(resp, err)
  93. }
  94. func roomAdminDismiss(c *bm.Context) {
  95. p := new(RoomAdminDismissAdminReq)
  96. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  97. return
  98. }
  99. resp, err := v1RoomAdminSvc.Dismiss(c, p)
  100. c.JSON(resp, err)
  101. }
  102. func roomAdminAppoint(c *bm.Context) {
  103. p := new(RoomAdminAddReq)
  104. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  105. return
  106. }
  107. resp, err := v1RoomAdminSvc.Appoint(c, p)
  108. c.JSON(resp, err)
  109. }
  110. // RegisterV1RoomAdminService Register the blademaster route with middleware map
  111. // midMap is the middleware map, the key is defined in proto
  112. func RegisterV1RoomAdminService(e *bm.Engine, svc RoomAdminBMServer, midMap map[string]bm.HandlerFunc) {
  113. auth := midMap["auth"]
  114. v1RoomAdminSvc = svc
  115. e.GET("/xlive/app-ucenter/v1/roomAdmin/is_any", auth, roomAdminIsAny)
  116. e.GET("/xlive/app-ucenter/v1/roomAdmin/get_by_uid", auth, roomAdminGetByUid)
  117. e.POST("/xlive/app-ucenter/v1/roomAdmin/resign", auth, roomAdminResign)
  118. e.POST("/xlive/app-ucenter/v1/roomAdmin/search_for_admin", auth, roomAdminSearchForAdmin)
  119. e.GET("/xlive/app-ucenter/v1/roomAdmin/get_by_anchor", auth, roomAdminGetByAnchor)
  120. e.POST("/xlive/app-ucenter/v1/roomAdmin/dismiss", auth, roomAdminDismiss)
  121. e.POST("/xlive/app-ucenter/v1/roomAdmin/appoint", auth, roomAdminAppoint)
  122. }
  123. // RegisterRoomAdminBMServer Register the blademaster route
  124. func RegisterRoomAdminBMServer(e *bm.Engine, server RoomAdminBMServer) {
  125. v1RoomAdminSvc = server
  126. e.GET("/live.appucenter.v1.RoomAdmin/is_any", roomAdminIsAny)
  127. e.GET("/live.appucenter.v1.RoomAdmin/get_by_uid", roomAdminGetByUid)
  128. e.POST("/live.appucenter.v1.RoomAdmin/resign", roomAdminResign)
  129. e.POST("/live.appucenter.v1.RoomAdmin/search_for_admin", roomAdminSearchForAdmin)
  130. e.GET("/live.appucenter.v1.RoomAdmin/get_by_anchor", roomAdminGetByAnchor)
  131. e.POST("/live.appucenter.v1.RoomAdmin/dismiss", roomAdminDismiss)
  132. e.POST("/live.appucenter.v1.RoomAdmin/appoint", roomAdminAppoint)
  133. }