Skip to content

Commit dbef463

Browse files
committed
feat(api): add personalUpdate/followingUpdates
1 parent 6f8a8ad commit dbef463

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
- 用户关系
3030
- [x] 获取关注列表
3131
- [x] 获取被关注列表
32-
- 动态
32+
- 动态帖子
3333
- [x] 发送动态
3434
- [x] 获取动态详情
3535
- [x] 分享动态
@@ -42,8 +42,9 @@
4242
- [x] 发送评论
4343
- [x] 点赞
4444
- [x] 取消点赞
45-
- 主页
45+
- 动态
4646
- [x] 获取用户动态
47+
- [x] 获取关注动态
4748
- 通知
4849
- [x] 获取通知列表
4950
- 上传

src/api/personal-update.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,25 @@ export const single = async <T = PersonalUpdate.SingleResponse>(
2020
},
2121
})
2222
)
23+
24+
/**
25+
* 获取关注动态
26+
* @param option 分页选项
27+
*/
28+
export const followingUpdates = async <
29+
T = PersonalUpdate.FollowingUpdatesResponse
30+
>(
31+
option: PaginationOption<{
32+
session: 'PopulatedUpdate'
33+
lastReadTime: number
34+
lastPageEarliestTime: number
35+
}> = {}
36+
) =>
37+
toResponse<T>(
38+
request.post('1.0/personalUpdate/followingUpdates', {
39+
json: {
40+
limit: option.limit ?? 10,
41+
loadMoreKey: option.loadMoreKey,
42+
},
43+
})
44+
)

src/types/api-responses.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,15 @@ export namespace PersonalUpdate {
116116
lastId: string
117117
}
118118
}
119+
120+
export interface FollowingUpdatesResponse {
121+
data: PostDetail[]
122+
loadMoreKey?: {
123+
session: 'PopulatedUpdate'
124+
lastPageEarliestTime: number
125+
lastReadTime: number
126+
}
127+
}
119128
}
120129

121130
export namespace Comments {

0 commit comments

Comments
 (0)