api.bm.go 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. // Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
  2. // source: api/grpc/v1/api.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/api.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. // ===================
  20. // RoomAdmin Interface
  21. // ===================
  22. // History 相关服务
  23. type RoomAdmin interface {
  24. // 根据登录态获取功能入口是否显示, 需要登录态
  25. IsAny(ctx context.Context, req *RoomAdminShowEntryReq) (resp *RoomAdminShowEntryResp, err error)
  26. // 获取用户拥有的的所有房管身份
  27. GetByUid(ctx context.Context, req *RoomAdminGetByUidReq) (resp *RoomAdminGetByUidResp, err error)
  28. // 辞职房管
  29. Resign(ctx context.Context, req *RoomAdminResignRoomAdminReq) (resp *RoomAdminResignRoomAdminResp, err error)
  30. // 查询需要添加的房管
  31. SearchForAdmin(ctx context.Context, req *RoomAdminSearchForAdminReq) (resp *RoomAdminSearchForAdminResp, err error)
  32. // 获取主播拥有的的所有房管
  33. GetByAnchor(ctx context.Context, req *RoomAdminGetByAnchorReq) (resp *RoomAdminGetByAnchorResp, err error)
  34. // 获取主播拥有的的所有房管,房间号维度
  35. GetByRoom(ctx context.Context, req *RoomAdminGetByRoomReq) (resp *RoomAdminGetByRoomResp, err error)
  36. // 撤销房管
  37. Dismiss(ctx context.Context, req *RoomAdminDismissAdminReq) (resp *RoomAdminDismissAdminResp, err error)
  38. // 任命房管
  39. Appoint(ctx context.Context, req *RoomAdminAddReq) (resp *RoomAdminAddResp, err error)
  40. // 是否房管
  41. IsAdmin(ctx context.Context, req *RoomAdminIsAdminReq) (resp *RoomAdminIsAdminResp, err error)
  42. // 是否房管, 不额外返回用户信息, 不判断是否主播自己
  43. IsAdminShort(ctx context.Context, req *RoomAdminIsAdminShortReq) (resp *RoomAdminIsAdminShortResp, err error)
  44. }
  45. var v1RoomAdminSvc RoomAdmin
  46. // @params RoomAdminShowEntryReq
  47. // @router GET /xlive/xuser/v1/roomAdmin/is_any
  48. // @response RoomAdminShowEntryResp
  49. func roomAdminIsAny(c *bm.Context) {
  50. p := new(RoomAdminShowEntryReq)
  51. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  52. return
  53. }
  54. resp, err := v1RoomAdminSvc.IsAny(c, p)
  55. c.JSON(resp, err)
  56. }
  57. // @params RoomAdminGetByUidReq
  58. // @router GET /xlive/xuser/v1/roomAdmin/get_by_uid
  59. // @response RoomAdminGetByUidResp
  60. func roomAdminGetByUid(c *bm.Context) {
  61. p := new(RoomAdminGetByUidReq)
  62. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  63. return
  64. }
  65. resp, err := v1RoomAdminSvc.GetByUid(c, p)
  66. c.JSON(resp, err)
  67. }
  68. // @params RoomAdminResignRoomAdminReq
  69. // @router GET /xlive/xuser/v1/roomAdmin/resign
  70. // @response RoomAdminResignRoomAdminResp
  71. func roomAdminResign(c *bm.Context) {
  72. p := new(RoomAdminResignRoomAdminReq)
  73. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  74. return
  75. }
  76. resp, err := v1RoomAdminSvc.Resign(c, p)
  77. c.JSON(resp, err)
  78. }
  79. // @params RoomAdminSearchForAdminReq
  80. // @router GET /xlive/xuser/v1/roomAdmin/search_for_admin
  81. // @response RoomAdminSearchForAdminResp
  82. func roomAdminSearchForAdmin(c *bm.Context) {
  83. p := new(RoomAdminSearchForAdminReq)
  84. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  85. return
  86. }
  87. resp, err := v1RoomAdminSvc.SearchForAdmin(c, p)
  88. c.JSON(resp, err)
  89. }
  90. // @params RoomAdminGetByAnchorReq
  91. // @router GET /xlive/xuser/v1/roomAdmin/get_by_anchor
  92. // @response RoomAdminGetByAnchorResp
  93. func roomAdminGetByAnchor(c *bm.Context) {
  94. p := new(RoomAdminGetByAnchorReq)
  95. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  96. return
  97. }
  98. resp, err := v1RoomAdminSvc.GetByAnchor(c, p)
  99. c.JSON(resp, err)
  100. }
  101. // @params RoomAdminGetByRoomReq
  102. // @router GET /xlive/xuser/v1/roomAdmin/get_by_room
  103. // @response RoomAdminGetByRoomResp
  104. func roomAdminGetByRoom(c *bm.Context) {
  105. p := new(RoomAdminGetByRoomReq)
  106. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  107. return
  108. }
  109. resp, err := v1RoomAdminSvc.GetByRoom(c, p)
  110. c.JSON(resp, err)
  111. }
  112. // @params RoomAdminDismissAdminReq
  113. // @router GET /xlive/xuser/v1/roomAdmin/dismiss
  114. // @response RoomAdminDismissAdminResp
  115. func roomAdminDismiss(c *bm.Context) {
  116. p := new(RoomAdminDismissAdminReq)
  117. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  118. return
  119. }
  120. resp, err := v1RoomAdminSvc.Dismiss(c, p)
  121. c.JSON(resp, err)
  122. }
  123. // @params RoomAdminAddReq
  124. // @router GET /xlive/xuser/v1/roomAdmin/appoint
  125. // @response RoomAdminAddResp
  126. func roomAdminAppoint(c *bm.Context) {
  127. p := new(RoomAdminAddReq)
  128. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  129. return
  130. }
  131. resp, err := v1RoomAdminSvc.Appoint(c, p)
  132. c.JSON(resp, err)
  133. }
  134. // @params RoomAdminIsAdminReq
  135. // @router GET /xlive/xuser/v1/roomAdmin/is_admin
  136. // @response RoomAdminIsAdminResp
  137. func roomAdminIsAdmin(c *bm.Context) {
  138. p := new(RoomAdminIsAdminReq)
  139. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  140. return
  141. }
  142. resp, err := v1RoomAdminSvc.IsAdmin(c, p)
  143. c.JSON(resp, err)
  144. }
  145. // @params RoomAdminIsAdminShortReq
  146. // @router GET /xlive/xuser/v1/roomAdmin/is_admin_short
  147. // @response RoomAdminIsAdminShortResp
  148. func roomAdminIsAdminShort(c *bm.Context) {
  149. p := new(RoomAdminIsAdminShortReq)
  150. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  151. return
  152. }
  153. resp, err := v1RoomAdminSvc.IsAdminShort(c, p)
  154. c.JSON(resp, err)
  155. }
  156. // RegisterV1RoomAdminService Register the blademaster route with middleware map
  157. // midMap is the middleware map, the key is defined in proto
  158. func RegisterV1RoomAdminService(e *bm.Engine, svc RoomAdmin, midMap map[string]bm.HandlerFunc) {
  159. v1RoomAdminSvc = svc
  160. e.GET("/xlive/xuser/v1/roomAdmin/is_any", roomAdminIsAny)
  161. e.GET("/xlive/xuser/v1/roomAdmin/get_by_uid", roomAdminGetByUid)
  162. e.GET("/xlive/xuser/v1/roomAdmin/resign", roomAdminResign)
  163. e.GET("/xlive/xuser/v1/roomAdmin/search_for_admin", roomAdminSearchForAdmin)
  164. e.GET("/xlive/xuser/v1/roomAdmin/get_by_anchor", roomAdminGetByAnchor)
  165. e.GET("/xlive/xuser/v1/roomAdmin/get_by_room", roomAdminGetByRoom)
  166. e.GET("/xlive/xuser/v1/roomAdmin/dismiss", roomAdminDismiss)
  167. e.GET("/xlive/xuser/v1/roomAdmin/appoint", roomAdminAppoint)
  168. e.GET("/xlive/xuser/v1/roomAdmin/is_admin", roomAdminIsAdmin)
  169. e.GET("/xlive/xuser/v1/roomAdmin/is_admin_short", roomAdminIsAdminShort)
  170. }