Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
diy0663 opened this issue Nov 18, 2023 · 1 comment
Open

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

diy0663 opened this issue Nov 18, 2023 · 1 comment

Comments

@diy0663
Copy link

diy0663 commented Nov 18, 2023

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

@cpf2021-gif
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants