73 lines
2.0 KiB
Go
73 lines
2.0 KiB
Go
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
|
|
// source: v1/Feed.proto
|
|
|
|
package v1
|
|
|
|
import context "context"
|
|
|
|
import proto "github.com/golang/protobuf/proto"
|
|
import "go-common/library/net/rpc/liverpc"
|
|
|
|
var _ proto.Message // generate to suppress unused imports
|
|
|
|
// ==============
|
|
// Feed Interface
|
|
// ==============
|
|
|
|
type Feed interface {
|
|
// * 获取粉丝数
|
|
// 根据uid获取用户的粉丝数
|
|
GetUserFc(context.Context, *FeedGetUserFcReq) (*FeedGetUserFcResp, error)
|
|
|
|
// * 获取粉丝数
|
|
// 根据uid批量获取用户的粉丝数
|
|
GetUserFcBatch(context.Context, *FeedGetUserFcBatchReq) (*FeedGetUserFcBatchResp, error)
|
|
|
|
// * 获取关注列表
|
|
// 根据uid获取用户的关注列表
|
|
GetAttentionList(context.Context, *FeedGetAttentionListReq) (*FeedGetAttentionListResp, error)
|
|
}
|
|
|
|
// ====================
|
|
// Feed Live Rpc Client
|
|
// ====================
|
|
|
|
type feedRpcClient struct {
|
|
client *liverpc.Client
|
|
}
|
|
|
|
// NewFeedRpcClient creates a Rpc client that implements the Feed interface.
|
|
// It communicates using Rpc and can be configured with a custom HTTPClient.
|
|
func NewFeedRpcClient(client *liverpc.Client) Feed {
|
|
return &feedRpcClient{
|
|
client: client,
|
|
}
|
|
}
|
|
|
|
func (c *feedRpcClient) GetUserFc(ctx context.Context, in *FeedGetUserFcReq) (*FeedGetUserFcResp, error) {
|
|
out := new(FeedGetUserFcResp)
|
|
err := doRpcRequest(ctx, c.client, 1, "Feed.GetUserFc", in, out)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *feedRpcClient) GetUserFcBatch(ctx context.Context, in *FeedGetUserFcBatchReq) (*FeedGetUserFcBatchResp, error) {
|
|
out := new(FeedGetUserFcBatchResp)
|
|
err := doRpcRequest(ctx, c.client, 1, "Feed.GetUserFcBatch", in, out)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *feedRpcClient) GetAttentionList(ctx context.Context, in *FeedGetAttentionListReq) (*FeedGetAttentionListResp, error) {
|
|
out := new(FeedGetAttentionListResp)
|
|
err := doRpcRequest(ctx, c.client, 1, "Feed.get_attention_list", in, out)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|