Feed.liverpc.go 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
  2. // source: v1/Feed.proto
  3. package v1
  4. import context "context"
  5. import proto "github.com/golang/protobuf/proto"
  6. import "go-common/library/net/rpc/liverpc"
  7. var _ proto.Message // generate to suppress unused imports
  8. // ==============
  9. // Feed Interface
  10. // ==============
  11. type Feed interface {
  12. // * 获取粉丝数
  13. // 根据uid获取用户的粉丝数
  14. GetUserFc(context.Context, *FeedGetUserFcReq) (*FeedGetUserFcResp, error)
  15. // * 获取粉丝数
  16. // 根据uid批量获取用户的粉丝数
  17. GetUserFcBatch(context.Context, *FeedGetUserFcBatchReq) (*FeedGetUserFcBatchResp, error)
  18. // * 获取关注列表
  19. // 根据uid获取用户的关注列表
  20. GetAttentionList(context.Context, *FeedGetAttentionListReq) (*FeedGetAttentionListResp, error)
  21. }
  22. // ====================
  23. // Feed Live Rpc Client
  24. // ====================
  25. type feedRpcClient struct {
  26. client *liverpc.Client
  27. }
  28. // NewFeedRpcClient creates a Rpc client that implements the Feed interface.
  29. // It communicates using Rpc and can be configured with a custom HTTPClient.
  30. func NewFeedRpcClient(client *liverpc.Client) Feed {
  31. return &feedRpcClient{
  32. client: client,
  33. }
  34. }
  35. func (c *feedRpcClient) GetUserFc(ctx context.Context, in *FeedGetUserFcReq) (*FeedGetUserFcResp, error) {
  36. out := new(FeedGetUserFcResp)
  37. err := doRpcRequest(ctx, c.client, 1, "Feed.GetUserFc", in, out)
  38. if err != nil {
  39. return nil, err
  40. }
  41. return out, nil
  42. }
  43. func (c *feedRpcClient) GetUserFcBatch(ctx context.Context, in *FeedGetUserFcBatchReq) (*FeedGetUserFcBatchResp, error) {
  44. out := new(FeedGetUserFcBatchResp)
  45. err := doRpcRequest(ctx, c.client, 1, "Feed.GetUserFcBatch", in, out)
  46. if err != nil {
  47. return nil, err
  48. }
  49. return out, nil
  50. }
  51. func (c *feedRpcClient) GetAttentionList(ctx context.Context, in *FeedGetAttentionListReq) (*FeedGetAttentionListResp, error) {
  52. out := new(FeedGetAttentionListResp)
  53. err := doRpcRequest(ctx, c.client, 1, "Feed.get_attention_list", in, out)
  54. if err != nil {
  55. return nil, err
  56. }
  57. return out, nil
  58. }