zhoushuguang / beyond

Based on the go-zero framework of large-scale microservices practical project, see all say yes!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

article-rpc里面请求文章列表的articleId ,用途是啥?

diy0663 opened this issue · comments

message ArticlesRequest {
int64 userId = 1;
int64 cursor = 2;
int64 pageSize = 3;
int32 sortType = 4;
int64 articleId = 5;
}
articleId ,用途是啥?

下面只是我的理解:
应该是去重用的,这里基于游标的分页,但有时候仅仅靠cursor是不够的,因为可能有多条数据的点赞数和发布时间是相同的,
那这个时候仅仅靠cursor是无法确定这一页数据的起点的,所以articleId可能是上一页数据的最后一条数据,当你无法单靠cursor确定这一页的数据的起点时,就可以通过articleId来确定数据的起点