guard.bm.go 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. // Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
  2. // source: guard.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. guard.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 PathGuardBuy = "/live.xuser.v1.Guard/Buy"
  20. var PathGuardGetByUIDTargetID = "/live.xuser.v1.Guard/GetByUIDTargetID"
  21. var PathGuardGetByTargetIdsBatch = "/live.xuser.v1.Guard/GetByTargetIdsBatch"
  22. var PathGuardGetByUIDTargetIds = "/live.xuser.v1.Guard/GetByUIDTargetIds"
  23. var PathGuardGetByUIDForGift = "/live.xuser.v1.Guard/GetByUIDForGift"
  24. var PathGuardGetByUIDBatch = "/live.xuser.v1.Guard/GetByUIDBatch"
  25. var PathGuardGetAnchorRecentTopGuard = "/live.xuser.v1.Guard/GetAnchorRecentTopGuard"
  26. var PathGuardGetTopListGuard = "/live.xuser.v1.Guard/GetTopListGuard"
  27. var PathGuardGetTopListGuardNum = "/live.xuser.v1.Guard/GetTopListGuardNum"
  28. var PathGuardClearUIDCache = "/live.xuser.v1.Guard/ClearUIDCache"
  29. // ===============
  30. // Guard Interface
  31. // ===============
  32. type GuardBMServer interface {
  33. // Buy 购买大航海
  34. Buy(ctx context.Context, req *GuardBuyReq) (resp *GuardBuyReply, err error)
  35. // GetByUIDTargetID 获取我与目标用户守护关系,不支持批量(P0级)
  36. GetByUIDTargetID(ctx context.Context, req *GetByUidTargetIdReq) (resp *GetByUidTargetIdResp, err error)
  37. // GetByTargetIdsBatch 获取我与目标用户守护关系,支持批量(P2级,必要时刻降级)
  38. GetByTargetIdsBatch(ctx context.Context, req *GetByTargetIdsReq) (resp *GetByTargetIdsResp, err error)
  39. // GetByUIDTargetIds 根据uids批量获取所有守护关系,粉丝勋章使用
  40. GetByUIDTargetIds(ctx context.Context, req *GetByUidTargetIdsReq) (resp *GetByUidTargetIdsResp, err error)
  41. // GetByUID 获取我所有的守护,不支持批量(P0级)
  42. GetByUIDForGift(ctx context.Context, req *GetByUidReq) (resp *GetByUidResp, err error)
  43. // GetByUIDBatch 根据uids获取所有的守护,支持批量(P2级)
  44. GetByUIDBatch(ctx context.Context, req *GetByUidBatchReq) (resp *GetByUidBatchResp, err error)
  45. // GetAnchorRecentTopGuard 获取最近的提督弹窗提醒
  46. GetAnchorRecentTopGuard(ctx context.Context, req *GetAnchorRecentTopGuardReq) (resp *GetAnchorRecentTopGuardResp, err error)
  47. // GetTopListGuard 获取某个up主的守护排行榜
  48. GetTopListGuard(ctx context.Context, req *GetTopListGuardReq) (resp *GetTopListGuardResp, err error)
  49. // GetTopListGuardNum 获取某个up主所有的守护数量,和GetTopListGuard接口的区别是此接口用于房间页首屏,逻辑比较简单,因此拆分开来
  50. GetTopListGuardNum(ctx context.Context, req *GetTopListGuardNumReq) (resp *GetTopListGuardNumResp, err error)
  51. // ClearUIDCache 清除cache
  52. ClearUIDCache(ctx context.Context, req *ClearUIDCacheReq) (resp *ClearUIDCacheResp, err error)
  53. }
  54. var v1GuardSvc GuardBMServer
  55. func guardBuy(c *bm.Context) {
  56. p := new(GuardBuyReq)
  57. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  58. return
  59. }
  60. resp, err := v1GuardSvc.Buy(c, p)
  61. c.JSON(resp, err)
  62. }
  63. func guardGetByUIDTargetID(c *bm.Context) {
  64. p := new(GetByUidTargetIdReq)
  65. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  66. return
  67. }
  68. resp, err := v1GuardSvc.GetByUIDTargetID(c, p)
  69. c.JSON(resp, err)
  70. }
  71. func guardGetByTargetIdsBatch(c *bm.Context) {
  72. p := new(GetByTargetIdsReq)
  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 := v1GuardSvc.GetByTargetIdsBatch(c, p)
  77. c.JSON(resp, err)
  78. }
  79. func guardGetByUIDTargetIds(c *bm.Context) {
  80. p := new(GetByUidTargetIdsReq)
  81. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  82. return
  83. }
  84. resp, err := v1GuardSvc.GetByUIDTargetIds(c, p)
  85. c.JSON(resp, err)
  86. }
  87. func guardGetByUIDForGift(c *bm.Context) {
  88. p := new(GetByUidReq)
  89. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  90. return
  91. }
  92. resp, err := v1GuardSvc.GetByUIDForGift(c, p)
  93. c.JSON(resp, err)
  94. }
  95. func guardGetByUIDBatch(c *bm.Context) {
  96. p := new(GetByUidBatchReq)
  97. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  98. return
  99. }
  100. resp, err := v1GuardSvc.GetByUIDBatch(c, p)
  101. c.JSON(resp, err)
  102. }
  103. func guardGetAnchorRecentTopGuard(c *bm.Context) {
  104. p := new(GetAnchorRecentTopGuardReq)
  105. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  106. return
  107. }
  108. resp, err := v1GuardSvc.GetAnchorRecentTopGuard(c, p)
  109. c.JSON(resp, err)
  110. }
  111. func guardGetTopListGuard(c *bm.Context) {
  112. p := new(GetTopListGuardReq)
  113. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  114. return
  115. }
  116. resp, err := v1GuardSvc.GetTopListGuard(c, p)
  117. c.JSON(resp, err)
  118. }
  119. func guardGetTopListGuardNum(c *bm.Context) {
  120. p := new(GetTopListGuardNumReq)
  121. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  122. return
  123. }
  124. resp, err := v1GuardSvc.GetTopListGuardNum(c, p)
  125. c.JSON(resp, err)
  126. }
  127. func guardClearUIDCache(c *bm.Context) {
  128. p := new(ClearUIDCacheReq)
  129. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  130. return
  131. }
  132. resp, err := v1GuardSvc.ClearUIDCache(c, p)
  133. c.JSON(resp, err)
  134. }
  135. // RegisterGuardBMServer Register the blademaster route
  136. func RegisterGuardBMServer(e *bm.Engine, server GuardBMServer) {
  137. v1GuardSvc = server
  138. e.GET("/live.xuser.v1.Guard/Buy", guardBuy)
  139. e.GET("/live.xuser.v1.Guard/GetByUIDTargetID", guardGetByUIDTargetID)
  140. e.GET("/live.xuser.v1.Guard/GetByTargetIdsBatch", guardGetByTargetIdsBatch)
  141. e.GET("/live.xuser.v1.Guard/GetByUIDTargetIds", guardGetByUIDTargetIds)
  142. e.GET("/live.xuser.v1.Guard/GetByUIDForGift", guardGetByUIDForGift)
  143. e.GET("/live.xuser.v1.Guard/GetByUIDBatch", guardGetByUIDBatch)
  144. e.GET("/live.xuser.v1.Guard/GetAnchorRecentTopGuard", guardGetAnchorRecentTopGuard)
  145. e.GET("/live.xuser.v1.Guard/GetTopListGuard", guardGetTopListGuard)
  146. e.GET("/live.xuser.v1.Guard/GetTopListGuardNum", guardGetTopListGuardNum)
  147. e.GET("/live.xuser.v1.Guard/ClearUIDCache", guardClearUIDCache)
  148. }