feat:前端部分

This commit is contained in:
Leon
2025-12-26 22:49:46 +08:00
parent 328fae5f07
commit a0d6464d9d
5 changed files with 19 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
import { postJson } from './client'
import type { ListByFollowingResponse, ListLatestResponse, ListLikesCountResponse } from './types'
import type { ListByFollowingResponse, ListByPopularityResponse, ListLatestResponse, ListLikesCountResponse } from './types'
export function listLatest(input: { limit: number; latest_time: number }) {
return postJson<ListLatestResponse>('/feed/listLatest', input)
@@ -14,6 +14,10 @@ export function listLikesCount(input: { limit: number; likes_count_before?: numb
return postJson<ListLikesCountResponse>('/feed/listLikesCount', body)
}
export function listByPopularity(input: { limit: number; as_of: number; offset: number }) {
return postJson<ListByPopularityResponse>('/feed/listByPopularity', input)
}
export function listByFollowing(input: { limit: number; latest_time: number }) {
return postJson<ListByFollowingResponse>('/feed/listByFollowing', input, { authRequired: true })
}

View File

@@ -58,6 +58,16 @@ export type ListLikesCountResponse = {
has_more: boolean
}
export type ListByPopularityResponse = {
video_list: FeedVideoItem[]
as_of: number
next_offset: number
has_more: boolean
next_latest_popularity?: number
next_latest_before?: string
next_latest_id_before?: number
}
export type ListByFollowingResponse = {
video_list: FeedVideoItem[]
next_time: number