api.pb.go 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: app/service/live/recommend/api/grpc/v1/api.proto
  3. package v1
  4. import proto "github.com/gogo/protobuf/proto"
  5. import fmt "fmt"
  6. import math "math"
  7. import _ "github.com/gogo/protobuf/gogoproto"
  8. import context "golang.org/x/net/context"
  9. import grpc "google.golang.org/grpc"
  10. import io "io"
  11. // Reference imports to suppress errors if they are not otherwise used.
  12. var _ = proto.Marshal
  13. var _ = fmt.Errorf
  14. var _ = math.Inf
  15. // This is a compile-time assertion to ensure that this generated file
  16. // is compatible with the proto package it is being compiled against.
  17. // A compilation error at this line likely means your copy of the
  18. // proto package needs to be updated.
  19. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
  20. type ClearRecommendRequest struct {
  21. // 用户uid
  22. Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty" validate:"gt=0"`
  23. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  24. XXX_unrecognized []byte `json:"-"`
  25. XXX_sizecache int32 `json:"-"`
  26. }
  27. func (m *ClearRecommendRequest) Reset() { *m = ClearRecommendRequest{} }
  28. func (m *ClearRecommendRequest) String() string { return proto.CompactTextString(m) }
  29. func (*ClearRecommendRequest) ProtoMessage() {}
  30. func (*ClearRecommendRequest) Descriptor() ([]byte, []int) {
  31. return fileDescriptor_api_84fa36ba9c5b1c9c, []int{0}
  32. }
  33. func (m *ClearRecommendRequest) XXX_Unmarshal(b []byte) error {
  34. return m.Unmarshal(b)
  35. }
  36. func (m *ClearRecommendRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  37. if deterministic {
  38. return xxx_messageInfo_ClearRecommendRequest.Marshal(b, m, deterministic)
  39. } else {
  40. b = b[:cap(b)]
  41. n, err := m.MarshalTo(b)
  42. if err != nil {
  43. return nil, err
  44. }
  45. return b[:n], nil
  46. }
  47. }
  48. func (dst *ClearRecommendRequest) XXX_Merge(src proto.Message) {
  49. xxx_messageInfo_ClearRecommendRequest.Merge(dst, src)
  50. }
  51. func (m *ClearRecommendRequest) XXX_Size() int {
  52. return m.Size()
  53. }
  54. func (m *ClearRecommendRequest) XXX_DiscardUnknown() {
  55. xxx_messageInfo_ClearRecommendRequest.DiscardUnknown(m)
  56. }
  57. var xxx_messageInfo_ClearRecommendRequest proto.InternalMessageInfo
  58. func (m *ClearRecommendRequest) GetUid() int64 {
  59. if m != nil {
  60. return m.Uid
  61. }
  62. return 0
  63. }
  64. type ClearRecommendResponse struct {
  65. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  66. XXX_unrecognized []byte `json:"-"`
  67. XXX_sizecache int32 `json:"-"`
  68. }
  69. func (m *ClearRecommendResponse) Reset() { *m = ClearRecommendResponse{} }
  70. func (m *ClearRecommendResponse) String() string { return proto.CompactTextString(m) }
  71. func (*ClearRecommendResponse) ProtoMessage() {}
  72. func (*ClearRecommendResponse) Descriptor() ([]byte, []int) {
  73. return fileDescriptor_api_84fa36ba9c5b1c9c, []int{1}
  74. }
  75. func (m *ClearRecommendResponse) XXX_Unmarshal(b []byte) error {
  76. return m.Unmarshal(b)
  77. }
  78. func (m *ClearRecommendResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  79. if deterministic {
  80. return xxx_messageInfo_ClearRecommendResponse.Marshal(b, m, deterministic)
  81. } else {
  82. b = b[:cap(b)]
  83. n, err := m.MarshalTo(b)
  84. if err != nil {
  85. return nil, err
  86. }
  87. return b[:n], nil
  88. }
  89. }
  90. func (dst *ClearRecommendResponse) XXX_Merge(src proto.Message) {
  91. xxx_messageInfo_ClearRecommendResponse.Merge(dst, src)
  92. }
  93. func (m *ClearRecommendResponse) XXX_Size() int {
  94. return m.Size()
  95. }
  96. func (m *ClearRecommendResponse) XXX_DiscardUnknown() {
  97. xxx_messageInfo_ClearRecommendResponse.DiscardUnknown(m)
  98. }
  99. var xxx_messageInfo_ClearRecommendResponse proto.InternalMessageInfo
  100. type GetRandomRecReq struct {
  101. // 用户uid
  102. Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty" validate:"gt=0"`
  103. // 获取数量
  104. Count uint32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty" validate:"gt=0"`
  105. // room_id去重
  106. ExistIds []int64 `protobuf:"varint,3,rep,packed,name=exist_ids,json=existIds" json:"exist_ids,omitempty"`
  107. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  108. XXX_unrecognized []byte `json:"-"`
  109. XXX_sizecache int32 `json:"-"`
  110. }
  111. func (m *GetRandomRecReq) Reset() { *m = GetRandomRecReq{} }
  112. func (m *GetRandomRecReq) String() string { return proto.CompactTextString(m) }
  113. func (*GetRandomRecReq) ProtoMessage() {}
  114. func (*GetRandomRecReq) Descriptor() ([]byte, []int) {
  115. return fileDescriptor_api_84fa36ba9c5b1c9c, []int{2}
  116. }
  117. func (m *GetRandomRecReq) XXX_Unmarshal(b []byte) error {
  118. return m.Unmarshal(b)
  119. }
  120. func (m *GetRandomRecReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  121. if deterministic {
  122. return xxx_messageInfo_GetRandomRecReq.Marshal(b, m, deterministic)
  123. } else {
  124. b = b[:cap(b)]
  125. n, err := m.MarshalTo(b)
  126. if err != nil {
  127. return nil, err
  128. }
  129. return b[:n], nil
  130. }
  131. }
  132. func (dst *GetRandomRecReq) XXX_Merge(src proto.Message) {
  133. xxx_messageInfo_GetRandomRecReq.Merge(dst, src)
  134. }
  135. func (m *GetRandomRecReq) XXX_Size() int {
  136. return m.Size()
  137. }
  138. func (m *GetRandomRecReq) XXX_DiscardUnknown() {
  139. xxx_messageInfo_GetRandomRecReq.DiscardUnknown(m)
  140. }
  141. var xxx_messageInfo_GetRandomRecReq proto.InternalMessageInfo
  142. func (m *GetRandomRecReq) GetUid() int64 {
  143. if m != nil {
  144. return m.Uid
  145. }
  146. return 0
  147. }
  148. func (m *GetRandomRecReq) GetCount() uint32 {
  149. if m != nil {
  150. return m.Count
  151. }
  152. return 0
  153. }
  154. func (m *GetRandomRecReq) GetExistIds() []int64 {
  155. if m != nil {
  156. return m.ExistIds
  157. }
  158. return nil
  159. }
  160. type GetRandomRecResp struct {
  161. // 返回数量
  162. Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
  163. // 房间id
  164. RoomIds []int64 `protobuf:"varint,2,rep,packed,name=room_ids,json=roomIds" json:"room_ids,omitempty"`
  165. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  166. XXX_unrecognized []byte `json:"-"`
  167. XXX_sizecache int32 `json:"-"`
  168. }
  169. func (m *GetRandomRecResp) Reset() { *m = GetRandomRecResp{} }
  170. func (m *GetRandomRecResp) String() string { return proto.CompactTextString(m) }
  171. func (*GetRandomRecResp) ProtoMessage() {}
  172. func (*GetRandomRecResp) Descriptor() ([]byte, []int) {
  173. return fileDescriptor_api_84fa36ba9c5b1c9c, []int{3}
  174. }
  175. func (m *GetRandomRecResp) XXX_Unmarshal(b []byte) error {
  176. return m.Unmarshal(b)
  177. }
  178. func (m *GetRandomRecResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  179. if deterministic {
  180. return xxx_messageInfo_GetRandomRecResp.Marshal(b, m, deterministic)
  181. } else {
  182. b = b[:cap(b)]
  183. n, err := m.MarshalTo(b)
  184. if err != nil {
  185. return nil, err
  186. }
  187. return b[:n], nil
  188. }
  189. }
  190. func (dst *GetRandomRecResp) XXX_Merge(src proto.Message) {
  191. xxx_messageInfo_GetRandomRecResp.Merge(dst, src)
  192. }
  193. func (m *GetRandomRecResp) XXX_Size() int {
  194. return m.Size()
  195. }
  196. func (m *GetRandomRecResp) XXX_DiscardUnknown() {
  197. xxx_messageInfo_GetRandomRecResp.DiscardUnknown(m)
  198. }
  199. var xxx_messageInfo_GetRandomRecResp proto.InternalMessageInfo
  200. func (m *GetRandomRecResp) GetCount() uint32 {
  201. if m != nil {
  202. return m.Count
  203. }
  204. return 0
  205. }
  206. func (m *GetRandomRecResp) GetRoomIds() []int64 {
  207. if m != nil {
  208. return m.RoomIds
  209. }
  210. return nil
  211. }
  212. func init() {
  213. proto.RegisterType((*ClearRecommendRequest)(nil), "live.recommend.v1.ClearRecommendRequest")
  214. proto.RegisterType((*ClearRecommendResponse)(nil), "live.recommend.v1.ClearRecommendResponse")
  215. proto.RegisterType((*GetRandomRecReq)(nil), "live.recommend.v1.GetRandomRecReq")
  216. proto.RegisterType((*GetRandomRecResp)(nil), "live.recommend.v1.GetRandomRecResp")
  217. }
  218. // Reference imports to suppress errors if they are not otherwise used.
  219. var _ context.Context
  220. var _ grpc.ClientConn
  221. // This is a compile-time assertion to ensure that this generated file
  222. // is compatible with the grpc package it is being compiled against.
  223. const _ = grpc.SupportPackageIsVersion4
  224. // Client API for Recommend service
  225. type RecommendClient interface {
  226. // 获取n个推荐, 得到的结果是在线的房间
  227. // 去重,不会重复推荐
  228. // 如果没有足够推荐的结果则返回空的结果,调用方需要补位
  229. RandomRecsByUser(ctx context.Context, in *GetRandomRecReq, opts ...grpc.CallOption) (*GetRandomRecResp, error)
  230. // 清空推荐缓存,清空推荐过的集合
  231. ClearRecommendCache(ctx context.Context, in *ClearRecommendRequest, opts ...grpc.CallOption) (*ClearRecommendResponse, error)
  232. }
  233. type recommendClient struct {
  234. cc *grpc.ClientConn
  235. }
  236. func NewRecommendClient(cc *grpc.ClientConn) RecommendClient {
  237. return &recommendClient{cc}
  238. }
  239. func (c *recommendClient) RandomRecsByUser(ctx context.Context, in *GetRandomRecReq, opts ...grpc.CallOption) (*GetRandomRecResp, error) {
  240. out := new(GetRandomRecResp)
  241. err := c.cc.Invoke(ctx, "/live.recommend.v1.Recommend/random_recs_by_user", in, out, opts...)
  242. if err != nil {
  243. return nil, err
  244. }
  245. return out, nil
  246. }
  247. func (c *recommendClient) ClearRecommendCache(ctx context.Context, in *ClearRecommendRequest, opts ...grpc.CallOption) (*ClearRecommendResponse, error) {
  248. out := new(ClearRecommendResponse)
  249. err := c.cc.Invoke(ctx, "/live.recommend.v1.Recommend/clear_recommend_cache", in, out, opts...)
  250. if err != nil {
  251. return nil, err
  252. }
  253. return out, nil
  254. }
  255. // Server API for Recommend service
  256. type RecommendServer interface {
  257. // 获取n个推荐, 得到的结果是在线的房间
  258. // 去重,不会重复推荐
  259. // 如果没有足够推荐的结果则返回空的结果,调用方需要补位
  260. RandomRecsByUser(context.Context, *GetRandomRecReq) (*GetRandomRecResp, error)
  261. // 清空推荐缓存,清空推荐过的集合
  262. ClearRecommendCache(context.Context, *ClearRecommendRequest) (*ClearRecommendResponse, error)
  263. }
  264. func RegisterRecommendServer(s *grpc.Server, srv RecommendServer) {
  265. s.RegisterService(&_Recommend_serviceDesc, srv)
  266. }
  267. func _Recommend_RandomRecsByUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  268. in := new(GetRandomRecReq)
  269. if err := dec(in); err != nil {
  270. return nil, err
  271. }
  272. if interceptor == nil {
  273. return srv.(RecommendServer).RandomRecsByUser(ctx, in)
  274. }
  275. info := &grpc.UnaryServerInfo{
  276. Server: srv,
  277. FullMethod: "/live.recommend.v1.Recommend/RandomRecsByUser",
  278. }
  279. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  280. return srv.(RecommendServer).RandomRecsByUser(ctx, req.(*GetRandomRecReq))
  281. }
  282. return interceptor(ctx, in, info, handler)
  283. }
  284. func _Recommend_ClearRecommendCache_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  285. in := new(ClearRecommendRequest)
  286. if err := dec(in); err != nil {
  287. return nil, err
  288. }
  289. if interceptor == nil {
  290. return srv.(RecommendServer).ClearRecommendCache(ctx, in)
  291. }
  292. info := &grpc.UnaryServerInfo{
  293. Server: srv,
  294. FullMethod: "/live.recommend.v1.Recommend/ClearRecommendCache",
  295. }
  296. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  297. return srv.(RecommendServer).ClearRecommendCache(ctx, req.(*ClearRecommendRequest))
  298. }
  299. return interceptor(ctx, in, info, handler)
  300. }
  301. var _Recommend_serviceDesc = grpc.ServiceDesc{
  302. ServiceName: "live.recommend.v1.Recommend",
  303. HandlerType: (*RecommendServer)(nil),
  304. Methods: []grpc.MethodDesc{
  305. {
  306. MethodName: "random_recs_by_user",
  307. Handler: _Recommend_RandomRecsByUser_Handler,
  308. },
  309. {
  310. MethodName: "clear_recommend_cache",
  311. Handler: _Recommend_ClearRecommendCache_Handler,
  312. },
  313. },
  314. Streams: []grpc.StreamDesc{},
  315. Metadata: "app/service/live/recommend/api/grpc/v1/api.proto",
  316. }
  317. func (m *ClearRecommendRequest) Marshal() (dAtA []byte, err error) {
  318. size := m.Size()
  319. dAtA = make([]byte, size)
  320. n, err := m.MarshalTo(dAtA)
  321. if err != nil {
  322. return nil, err
  323. }
  324. return dAtA[:n], nil
  325. }
  326. func (m *ClearRecommendRequest) MarshalTo(dAtA []byte) (int, error) {
  327. var i int
  328. _ = i
  329. var l int
  330. _ = l
  331. if m.Uid != 0 {
  332. dAtA[i] = 0x8
  333. i++
  334. i = encodeVarintApi(dAtA, i, uint64(m.Uid))
  335. }
  336. if m.XXX_unrecognized != nil {
  337. i += copy(dAtA[i:], m.XXX_unrecognized)
  338. }
  339. return i, nil
  340. }
  341. func (m *ClearRecommendResponse) Marshal() (dAtA []byte, err error) {
  342. size := m.Size()
  343. dAtA = make([]byte, size)
  344. n, err := m.MarshalTo(dAtA)
  345. if err != nil {
  346. return nil, err
  347. }
  348. return dAtA[:n], nil
  349. }
  350. func (m *ClearRecommendResponse) MarshalTo(dAtA []byte) (int, error) {
  351. var i int
  352. _ = i
  353. var l int
  354. _ = l
  355. if m.XXX_unrecognized != nil {
  356. i += copy(dAtA[i:], m.XXX_unrecognized)
  357. }
  358. return i, nil
  359. }
  360. func (m *GetRandomRecReq) Marshal() (dAtA []byte, err error) {
  361. size := m.Size()
  362. dAtA = make([]byte, size)
  363. n, err := m.MarshalTo(dAtA)
  364. if err != nil {
  365. return nil, err
  366. }
  367. return dAtA[:n], nil
  368. }
  369. func (m *GetRandomRecReq) MarshalTo(dAtA []byte) (int, error) {
  370. var i int
  371. _ = i
  372. var l int
  373. _ = l
  374. if m.Uid != 0 {
  375. dAtA[i] = 0x8
  376. i++
  377. i = encodeVarintApi(dAtA, i, uint64(m.Uid))
  378. }
  379. if m.Count != 0 {
  380. dAtA[i] = 0x10
  381. i++
  382. i = encodeVarintApi(dAtA, i, uint64(m.Count))
  383. }
  384. if len(m.ExistIds) > 0 {
  385. dAtA2 := make([]byte, len(m.ExistIds)*10)
  386. var j1 int
  387. for _, num1 := range m.ExistIds {
  388. num := uint64(num1)
  389. for num >= 1<<7 {
  390. dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80)
  391. num >>= 7
  392. j1++
  393. }
  394. dAtA2[j1] = uint8(num)
  395. j1++
  396. }
  397. dAtA[i] = 0x1a
  398. i++
  399. i = encodeVarintApi(dAtA, i, uint64(j1))
  400. i += copy(dAtA[i:], dAtA2[:j1])
  401. }
  402. if m.XXX_unrecognized != nil {
  403. i += copy(dAtA[i:], m.XXX_unrecognized)
  404. }
  405. return i, nil
  406. }
  407. func (m *GetRandomRecResp) Marshal() (dAtA []byte, err error) {
  408. size := m.Size()
  409. dAtA = make([]byte, size)
  410. n, err := m.MarshalTo(dAtA)
  411. if err != nil {
  412. return nil, err
  413. }
  414. return dAtA[:n], nil
  415. }
  416. func (m *GetRandomRecResp) MarshalTo(dAtA []byte) (int, error) {
  417. var i int
  418. _ = i
  419. var l int
  420. _ = l
  421. if m.Count != 0 {
  422. dAtA[i] = 0x8
  423. i++
  424. i = encodeVarintApi(dAtA, i, uint64(m.Count))
  425. }
  426. if len(m.RoomIds) > 0 {
  427. dAtA4 := make([]byte, len(m.RoomIds)*10)
  428. var j3 int
  429. for _, num1 := range m.RoomIds {
  430. num := uint64(num1)
  431. for num >= 1<<7 {
  432. dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80)
  433. num >>= 7
  434. j3++
  435. }
  436. dAtA4[j3] = uint8(num)
  437. j3++
  438. }
  439. dAtA[i] = 0x12
  440. i++
  441. i = encodeVarintApi(dAtA, i, uint64(j3))
  442. i += copy(dAtA[i:], dAtA4[:j3])
  443. }
  444. if m.XXX_unrecognized != nil {
  445. i += copy(dAtA[i:], m.XXX_unrecognized)
  446. }
  447. return i, nil
  448. }
  449. func encodeVarintApi(dAtA []byte, offset int, v uint64) int {
  450. for v >= 1<<7 {
  451. dAtA[offset] = uint8(v&0x7f | 0x80)
  452. v >>= 7
  453. offset++
  454. }
  455. dAtA[offset] = uint8(v)
  456. return offset + 1
  457. }
  458. func (m *ClearRecommendRequest) Size() (n int) {
  459. var l int
  460. _ = l
  461. if m.Uid != 0 {
  462. n += 1 + sovApi(uint64(m.Uid))
  463. }
  464. if m.XXX_unrecognized != nil {
  465. n += len(m.XXX_unrecognized)
  466. }
  467. return n
  468. }
  469. func (m *ClearRecommendResponse) Size() (n int) {
  470. var l int
  471. _ = l
  472. if m.XXX_unrecognized != nil {
  473. n += len(m.XXX_unrecognized)
  474. }
  475. return n
  476. }
  477. func (m *GetRandomRecReq) Size() (n int) {
  478. var l int
  479. _ = l
  480. if m.Uid != 0 {
  481. n += 1 + sovApi(uint64(m.Uid))
  482. }
  483. if m.Count != 0 {
  484. n += 1 + sovApi(uint64(m.Count))
  485. }
  486. if len(m.ExistIds) > 0 {
  487. l = 0
  488. for _, e := range m.ExistIds {
  489. l += sovApi(uint64(e))
  490. }
  491. n += 1 + sovApi(uint64(l)) + l
  492. }
  493. if m.XXX_unrecognized != nil {
  494. n += len(m.XXX_unrecognized)
  495. }
  496. return n
  497. }
  498. func (m *GetRandomRecResp) Size() (n int) {
  499. var l int
  500. _ = l
  501. if m.Count != 0 {
  502. n += 1 + sovApi(uint64(m.Count))
  503. }
  504. if len(m.RoomIds) > 0 {
  505. l = 0
  506. for _, e := range m.RoomIds {
  507. l += sovApi(uint64(e))
  508. }
  509. n += 1 + sovApi(uint64(l)) + l
  510. }
  511. if m.XXX_unrecognized != nil {
  512. n += len(m.XXX_unrecognized)
  513. }
  514. return n
  515. }
  516. func sovApi(x uint64) (n int) {
  517. for {
  518. n++
  519. x >>= 7
  520. if x == 0 {
  521. break
  522. }
  523. }
  524. return n
  525. }
  526. func sozApi(x uint64) (n int) {
  527. return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  528. }
  529. func (m *ClearRecommendRequest) Unmarshal(dAtA []byte) error {
  530. l := len(dAtA)
  531. iNdEx := 0
  532. for iNdEx < l {
  533. preIndex := iNdEx
  534. var wire uint64
  535. for shift := uint(0); ; shift += 7 {
  536. if shift >= 64 {
  537. return ErrIntOverflowApi
  538. }
  539. if iNdEx >= l {
  540. return io.ErrUnexpectedEOF
  541. }
  542. b := dAtA[iNdEx]
  543. iNdEx++
  544. wire |= (uint64(b) & 0x7F) << shift
  545. if b < 0x80 {
  546. break
  547. }
  548. }
  549. fieldNum := int32(wire >> 3)
  550. wireType := int(wire & 0x7)
  551. if wireType == 4 {
  552. return fmt.Errorf("proto: ClearRecommendRequest: wiretype end group for non-group")
  553. }
  554. if fieldNum <= 0 {
  555. return fmt.Errorf("proto: ClearRecommendRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  556. }
  557. switch fieldNum {
  558. case 1:
  559. if wireType != 0 {
  560. return fmt.Errorf("proto: wrong wireType = %d for field Uid", wireType)
  561. }
  562. m.Uid = 0
  563. for shift := uint(0); ; shift += 7 {
  564. if shift >= 64 {
  565. return ErrIntOverflowApi
  566. }
  567. if iNdEx >= l {
  568. return io.ErrUnexpectedEOF
  569. }
  570. b := dAtA[iNdEx]
  571. iNdEx++
  572. m.Uid |= (int64(b) & 0x7F) << shift
  573. if b < 0x80 {
  574. break
  575. }
  576. }
  577. default:
  578. iNdEx = preIndex
  579. skippy, err := skipApi(dAtA[iNdEx:])
  580. if err != nil {
  581. return err
  582. }
  583. if skippy < 0 {
  584. return ErrInvalidLengthApi
  585. }
  586. if (iNdEx + skippy) > l {
  587. return io.ErrUnexpectedEOF
  588. }
  589. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  590. iNdEx += skippy
  591. }
  592. }
  593. if iNdEx > l {
  594. return io.ErrUnexpectedEOF
  595. }
  596. return nil
  597. }
  598. func (m *ClearRecommendResponse) Unmarshal(dAtA []byte) error {
  599. l := len(dAtA)
  600. iNdEx := 0
  601. for iNdEx < l {
  602. preIndex := iNdEx
  603. var wire uint64
  604. for shift := uint(0); ; shift += 7 {
  605. if shift >= 64 {
  606. return ErrIntOverflowApi
  607. }
  608. if iNdEx >= l {
  609. return io.ErrUnexpectedEOF
  610. }
  611. b := dAtA[iNdEx]
  612. iNdEx++
  613. wire |= (uint64(b) & 0x7F) << shift
  614. if b < 0x80 {
  615. break
  616. }
  617. }
  618. fieldNum := int32(wire >> 3)
  619. wireType := int(wire & 0x7)
  620. if wireType == 4 {
  621. return fmt.Errorf("proto: ClearRecommendResponse: wiretype end group for non-group")
  622. }
  623. if fieldNum <= 0 {
  624. return fmt.Errorf("proto: ClearRecommendResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  625. }
  626. switch fieldNum {
  627. default:
  628. iNdEx = preIndex
  629. skippy, err := skipApi(dAtA[iNdEx:])
  630. if err != nil {
  631. return err
  632. }
  633. if skippy < 0 {
  634. return ErrInvalidLengthApi
  635. }
  636. if (iNdEx + skippy) > l {
  637. return io.ErrUnexpectedEOF
  638. }
  639. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  640. iNdEx += skippy
  641. }
  642. }
  643. if iNdEx > l {
  644. return io.ErrUnexpectedEOF
  645. }
  646. return nil
  647. }
  648. func (m *GetRandomRecReq) Unmarshal(dAtA []byte) error {
  649. l := len(dAtA)
  650. iNdEx := 0
  651. for iNdEx < l {
  652. preIndex := iNdEx
  653. var wire uint64
  654. for shift := uint(0); ; shift += 7 {
  655. if shift >= 64 {
  656. return ErrIntOverflowApi
  657. }
  658. if iNdEx >= l {
  659. return io.ErrUnexpectedEOF
  660. }
  661. b := dAtA[iNdEx]
  662. iNdEx++
  663. wire |= (uint64(b) & 0x7F) << shift
  664. if b < 0x80 {
  665. break
  666. }
  667. }
  668. fieldNum := int32(wire >> 3)
  669. wireType := int(wire & 0x7)
  670. if wireType == 4 {
  671. return fmt.Errorf("proto: GetRandomRecReq: wiretype end group for non-group")
  672. }
  673. if fieldNum <= 0 {
  674. return fmt.Errorf("proto: GetRandomRecReq: illegal tag %d (wire type %d)", fieldNum, wire)
  675. }
  676. switch fieldNum {
  677. case 1:
  678. if wireType != 0 {
  679. return fmt.Errorf("proto: wrong wireType = %d for field Uid", wireType)
  680. }
  681. m.Uid = 0
  682. for shift := uint(0); ; shift += 7 {
  683. if shift >= 64 {
  684. return ErrIntOverflowApi
  685. }
  686. if iNdEx >= l {
  687. return io.ErrUnexpectedEOF
  688. }
  689. b := dAtA[iNdEx]
  690. iNdEx++
  691. m.Uid |= (int64(b) & 0x7F) << shift
  692. if b < 0x80 {
  693. break
  694. }
  695. }
  696. case 2:
  697. if wireType != 0 {
  698. return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType)
  699. }
  700. m.Count = 0
  701. for shift := uint(0); ; shift += 7 {
  702. if shift >= 64 {
  703. return ErrIntOverflowApi
  704. }
  705. if iNdEx >= l {
  706. return io.ErrUnexpectedEOF
  707. }
  708. b := dAtA[iNdEx]
  709. iNdEx++
  710. m.Count |= (uint32(b) & 0x7F) << shift
  711. if b < 0x80 {
  712. break
  713. }
  714. }
  715. case 3:
  716. if wireType == 0 {
  717. var v int64
  718. for shift := uint(0); ; shift += 7 {
  719. if shift >= 64 {
  720. return ErrIntOverflowApi
  721. }
  722. if iNdEx >= l {
  723. return io.ErrUnexpectedEOF
  724. }
  725. b := dAtA[iNdEx]
  726. iNdEx++
  727. v |= (int64(b) & 0x7F) << shift
  728. if b < 0x80 {
  729. break
  730. }
  731. }
  732. m.ExistIds = append(m.ExistIds, v)
  733. } else if wireType == 2 {
  734. var packedLen int
  735. for shift := uint(0); ; shift += 7 {
  736. if shift >= 64 {
  737. return ErrIntOverflowApi
  738. }
  739. if iNdEx >= l {
  740. return io.ErrUnexpectedEOF
  741. }
  742. b := dAtA[iNdEx]
  743. iNdEx++
  744. packedLen |= (int(b) & 0x7F) << shift
  745. if b < 0x80 {
  746. break
  747. }
  748. }
  749. if packedLen < 0 {
  750. return ErrInvalidLengthApi
  751. }
  752. postIndex := iNdEx + packedLen
  753. if postIndex > l {
  754. return io.ErrUnexpectedEOF
  755. }
  756. for iNdEx < postIndex {
  757. var v int64
  758. for shift := uint(0); ; shift += 7 {
  759. if shift >= 64 {
  760. return ErrIntOverflowApi
  761. }
  762. if iNdEx >= l {
  763. return io.ErrUnexpectedEOF
  764. }
  765. b := dAtA[iNdEx]
  766. iNdEx++
  767. v |= (int64(b) & 0x7F) << shift
  768. if b < 0x80 {
  769. break
  770. }
  771. }
  772. m.ExistIds = append(m.ExistIds, v)
  773. }
  774. } else {
  775. return fmt.Errorf("proto: wrong wireType = %d for field ExistIds", wireType)
  776. }
  777. default:
  778. iNdEx = preIndex
  779. skippy, err := skipApi(dAtA[iNdEx:])
  780. if err != nil {
  781. return err
  782. }
  783. if skippy < 0 {
  784. return ErrInvalidLengthApi
  785. }
  786. if (iNdEx + skippy) > l {
  787. return io.ErrUnexpectedEOF
  788. }
  789. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  790. iNdEx += skippy
  791. }
  792. }
  793. if iNdEx > l {
  794. return io.ErrUnexpectedEOF
  795. }
  796. return nil
  797. }
  798. func (m *GetRandomRecResp) Unmarshal(dAtA []byte) error {
  799. l := len(dAtA)
  800. iNdEx := 0
  801. for iNdEx < l {
  802. preIndex := iNdEx
  803. var wire uint64
  804. for shift := uint(0); ; shift += 7 {
  805. if shift >= 64 {
  806. return ErrIntOverflowApi
  807. }
  808. if iNdEx >= l {
  809. return io.ErrUnexpectedEOF
  810. }
  811. b := dAtA[iNdEx]
  812. iNdEx++
  813. wire |= (uint64(b) & 0x7F) << shift
  814. if b < 0x80 {
  815. break
  816. }
  817. }
  818. fieldNum := int32(wire >> 3)
  819. wireType := int(wire & 0x7)
  820. if wireType == 4 {
  821. return fmt.Errorf("proto: GetRandomRecResp: wiretype end group for non-group")
  822. }
  823. if fieldNum <= 0 {
  824. return fmt.Errorf("proto: GetRandomRecResp: illegal tag %d (wire type %d)", fieldNum, wire)
  825. }
  826. switch fieldNum {
  827. case 1:
  828. if wireType != 0 {
  829. return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType)
  830. }
  831. m.Count = 0
  832. for shift := uint(0); ; shift += 7 {
  833. if shift >= 64 {
  834. return ErrIntOverflowApi
  835. }
  836. if iNdEx >= l {
  837. return io.ErrUnexpectedEOF
  838. }
  839. b := dAtA[iNdEx]
  840. iNdEx++
  841. m.Count |= (uint32(b) & 0x7F) << shift
  842. if b < 0x80 {
  843. break
  844. }
  845. }
  846. case 2:
  847. if wireType == 0 {
  848. var v int64
  849. for shift := uint(0); ; shift += 7 {
  850. if shift >= 64 {
  851. return ErrIntOverflowApi
  852. }
  853. if iNdEx >= l {
  854. return io.ErrUnexpectedEOF
  855. }
  856. b := dAtA[iNdEx]
  857. iNdEx++
  858. v |= (int64(b) & 0x7F) << shift
  859. if b < 0x80 {
  860. break
  861. }
  862. }
  863. m.RoomIds = append(m.RoomIds, v)
  864. } else if wireType == 2 {
  865. var packedLen int
  866. for shift := uint(0); ; shift += 7 {
  867. if shift >= 64 {
  868. return ErrIntOverflowApi
  869. }
  870. if iNdEx >= l {
  871. return io.ErrUnexpectedEOF
  872. }
  873. b := dAtA[iNdEx]
  874. iNdEx++
  875. packedLen |= (int(b) & 0x7F) << shift
  876. if b < 0x80 {
  877. break
  878. }
  879. }
  880. if packedLen < 0 {
  881. return ErrInvalidLengthApi
  882. }
  883. postIndex := iNdEx + packedLen
  884. if postIndex > l {
  885. return io.ErrUnexpectedEOF
  886. }
  887. for iNdEx < postIndex {
  888. var v int64
  889. for shift := uint(0); ; shift += 7 {
  890. if shift >= 64 {
  891. return ErrIntOverflowApi
  892. }
  893. if iNdEx >= l {
  894. return io.ErrUnexpectedEOF
  895. }
  896. b := dAtA[iNdEx]
  897. iNdEx++
  898. v |= (int64(b) & 0x7F) << shift
  899. if b < 0x80 {
  900. break
  901. }
  902. }
  903. m.RoomIds = append(m.RoomIds, v)
  904. }
  905. } else {
  906. return fmt.Errorf("proto: wrong wireType = %d for field RoomIds", wireType)
  907. }
  908. default:
  909. iNdEx = preIndex
  910. skippy, err := skipApi(dAtA[iNdEx:])
  911. if err != nil {
  912. return err
  913. }
  914. if skippy < 0 {
  915. return ErrInvalidLengthApi
  916. }
  917. if (iNdEx + skippy) > l {
  918. return io.ErrUnexpectedEOF
  919. }
  920. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  921. iNdEx += skippy
  922. }
  923. }
  924. if iNdEx > l {
  925. return io.ErrUnexpectedEOF
  926. }
  927. return nil
  928. }
  929. func skipApi(dAtA []byte) (n int, err error) {
  930. l := len(dAtA)
  931. iNdEx := 0
  932. for iNdEx < l {
  933. var wire uint64
  934. for shift := uint(0); ; shift += 7 {
  935. if shift >= 64 {
  936. return 0, ErrIntOverflowApi
  937. }
  938. if iNdEx >= l {
  939. return 0, io.ErrUnexpectedEOF
  940. }
  941. b := dAtA[iNdEx]
  942. iNdEx++
  943. wire |= (uint64(b) & 0x7F) << shift
  944. if b < 0x80 {
  945. break
  946. }
  947. }
  948. wireType := int(wire & 0x7)
  949. switch wireType {
  950. case 0:
  951. for shift := uint(0); ; shift += 7 {
  952. if shift >= 64 {
  953. return 0, ErrIntOverflowApi
  954. }
  955. if iNdEx >= l {
  956. return 0, io.ErrUnexpectedEOF
  957. }
  958. iNdEx++
  959. if dAtA[iNdEx-1] < 0x80 {
  960. break
  961. }
  962. }
  963. return iNdEx, nil
  964. case 1:
  965. iNdEx += 8
  966. return iNdEx, nil
  967. case 2:
  968. var length int
  969. for shift := uint(0); ; shift += 7 {
  970. if shift >= 64 {
  971. return 0, ErrIntOverflowApi
  972. }
  973. if iNdEx >= l {
  974. return 0, io.ErrUnexpectedEOF
  975. }
  976. b := dAtA[iNdEx]
  977. iNdEx++
  978. length |= (int(b) & 0x7F) << shift
  979. if b < 0x80 {
  980. break
  981. }
  982. }
  983. iNdEx += length
  984. if length < 0 {
  985. return 0, ErrInvalidLengthApi
  986. }
  987. return iNdEx, nil
  988. case 3:
  989. for {
  990. var innerWire uint64
  991. var start int = iNdEx
  992. for shift := uint(0); ; shift += 7 {
  993. if shift >= 64 {
  994. return 0, ErrIntOverflowApi
  995. }
  996. if iNdEx >= l {
  997. return 0, io.ErrUnexpectedEOF
  998. }
  999. b := dAtA[iNdEx]
  1000. iNdEx++
  1001. innerWire |= (uint64(b) & 0x7F) << shift
  1002. if b < 0x80 {
  1003. break
  1004. }
  1005. }
  1006. innerWireType := int(innerWire & 0x7)
  1007. if innerWireType == 4 {
  1008. break
  1009. }
  1010. next, err := skipApi(dAtA[start:])
  1011. if err != nil {
  1012. return 0, err
  1013. }
  1014. iNdEx = start + next
  1015. }
  1016. return iNdEx, nil
  1017. case 4:
  1018. return iNdEx, nil
  1019. case 5:
  1020. iNdEx += 4
  1021. return iNdEx, nil
  1022. default:
  1023. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  1024. }
  1025. }
  1026. panic("unreachable")
  1027. }
  1028. var (
  1029. ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling")
  1030. ErrIntOverflowApi = fmt.Errorf("proto: integer overflow")
  1031. )
  1032. func init() {
  1033. proto.RegisterFile("app/service/live/recommend/api/grpc/v1/api.proto", fileDescriptor_api_84fa36ba9c5b1c9c)
  1034. }
  1035. var fileDescriptor_api_84fa36ba9c5b1c9c = []byte{
  1036. // 368 bytes of a gzipped FileDescriptorProto
  1037. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x41, 0x6b, 0xdb, 0x30,
  1038. 0x14, 0x80, 0x51, 0xcc, 0xb6, 0x44, 0x10, 0x92, 0x29, 0xcb, 0xf0, 0x32, 0xc8, 0x82, 0xc7, 0xc0,
  1039. 0x39, 0xcc, 0x4a, 0xb6, 0xdb, 0x60, 0x3b, 0x24, 0x87, 0x91, 0xab, 0x8f, 0x3b, 0xcc, 0xd8, 0xf2,
  1040. 0xab, 0x23, 0xb0, 0x2d, 0x45, 0x92, 0x4d, 0x7b, 0xeb, 0xcf, 0xeb, 0xb1, 0xd7, 0x5e, 0x4a, 0xc9,
  1041. 0x4f, 0xe8, 0x2f, 0x28, 0x56, 0x48, 0xa0, 0x69, 0xa0, 0xb9, 0xbd, 0x27, 0x7d, 0xef, 0xe3, 0x3d,
  1042. 0x3d, 0xe1, 0x59, 0x2c, 0x25, 0xd5, 0xa0, 0x6a, 0xce, 0x80, 0xe6, 0xbc, 0x06, 0xaa, 0x80, 0x89,
  1043. 0xa2, 0x80, 0x32, 0xa5, 0xb1, 0xe4, 0x34, 0x53, 0x92, 0xd1, 0x7a, 0xde, 0xc4, 0x81, 0x54, 0xc2,
  1044. 0x08, 0xf2, 0xbe, 0xa1, 0x82, 0x03, 0x15, 0xd4, 0xf3, 0xd1, 0xf7, 0x8c, 0x9b, 0x75, 0x95, 0x04,
  1045. 0x4c, 0x14, 0x34, 0x13, 0x99, 0xa0, 0x96, 0x4c, 0xaa, 0x0b, 0x9b, 0xd9, 0xc4, 0x46, 0x3b, 0x83,
  1046. 0xf7, 0x07, 0x0f, 0x97, 0x39, 0xc4, 0x2a, 0xdc, 0x3b, 0x42, 0xd8, 0x54, 0xa0, 0x0d, 0xf9, 0x86,
  1047. 0x9d, 0x8a, 0xa7, 0x2e, 0x9a, 0x20, 0xdf, 0x59, 0x0c, 0x1e, 0xef, 0xbf, 0xf4, 0xea, 0x38, 0xe7,
  1048. 0x69, 0x6c, 0xe0, 0x97, 0x97, 0x99, 0xdf, 0x33, 0x2f, 0x6c, 0xee, 0x3d, 0x17, 0x7f, 0x3c, 0xae,
  1049. 0xd7, 0x52, 0x94, 0x1a, 0xbc, 0x6b, 0x84, 0x7b, 0x7f, 0xc1, 0x84, 0x71, 0x99, 0x8a, 0x22, 0x04,
  1050. 0x16, 0xc2, 0xe6, 0x4c, 0x29, 0x99, 0xe2, 0x37, 0x4c, 0x54, 0xa5, 0x71, 0x5b, 0x13, 0xe4, 0x77,
  1051. 0x4f, 0x83, 0x3b, 0x82, 0x7c, 0xc6, 0x1d, 0xb8, 0xe4, 0xda, 0x44, 0x3c, 0xd5, 0xae, 0x33, 0x71,
  1052. 0x7c, 0x27, 0x6c, 0xdb, 0x83, 0x55, 0xaa, 0xbd, 0x25, 0xee, 0x3f, 0xef, 0x40, 0x4b, 0xf2, 0x61,
  1053. 0xef, 0x6e, 0x9a, 0xe8, 0xee, 0x35, 0x9f, 0x70, 0x5b, 0x09, 0x51, 0x58, 0x4b, 0xcb, 0x5a, 0xde,
  1054. 0x35, 0xf9, 0x2a, 0xd5, 0x3f, 0xee, 0x10, 0xee, 0x1c, 0xa6, 0x23, 0xff, 0xf1, 0x40, 0x59, 0x5f,
  1055. 0xa4, 0x80, 0xe9, 0x28, 0xb9, 0x8a, 0x2a, 0x0d, 0x8a, 0x78, 0xc1, 0x8b, 0x4d, 0x04, 0x47, 0xc3,
  1056. 0x8f, 0xbe, 0xbe, 0xca, 0x68, 0x49, 0x72, 0x3c, 0x64, 0xcd, 0x7b, 0x46, 0x07, 0x2c, 0x62, 0x31,
  1057. 0x5b, 0x03, 0xf1, 0x4f, 0x54, 0x9f, 0xdc, 0xdc, 0x68, 0x7a, 0x06, 0xb9, 0xdb, 0xd1, 0xa2, 0x7f,
  1058. 0xb3, 0x1d, 0xa3, 0xdb, 0xed, 0x18, 0x3d, 0x6c, 0xc7, 0xe8, 0x5f, 0xab, 0x9e, 0x27, 0x6f, 0xed,
  1059. 0xb7, 0xf8, 0xf9, 0x14, 0x00, 0x00, 0xff, 0xff, 0x80, 0x53, 0x86, 0xed, 0x8c, 0x02, 0x00, 0x00,
  1060. }