From a0d6464d9d2a7b140b6d3994287bd70849592e14 Mon Sep 17 00:00:00 2001 From: Leon <147289645+LeoninCS@users.noreply.github.com> Date: Fri, 26 Dec 2025 22:49:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=89=8D=E7=AB=AF=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/feed.ts | 6 +++++- frontend/src/api/types.ts | 10 ++++++++++ frontend/src/components/AppShell.vue | 1 + frontend/src/router/index.ts | 2 ++ frontend/src/views/HomeView.vue | 2 +- 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/frontend/src/api/feed.ts b/frontend/src/api/feed.ts index f275f17..4c1b4bc 100644 --- a/frontend/src/api/feed.ts +++ b/frontend/src/api/feed.ts @@ -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('/feed/listLatest', input) @@ -14,6 +14,10 @@ export function listLikesCount(input: { limit: number; likes_count_before?: numb return postJson('/feed/listLikesCount', body) } +export function listByPopularity(input: { limit: number; as_of: number; offset: number }) { + return postJson('/feed/listByPopularity', input) +} + export function listByFollowing(input: { limit: number; latest_time: number }) { return postJson('/feed/listByFollowing', input, { authRequired: true }) } diff --git a/frontend/src/api/types.ts b/frontend/src/api/types.ts index a5af5f6..99a4766 100644 --- a/frontend/src/api/types.ts +++ b/frontend/src/api/types.ts @@ -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 diff --git a/frontend/src/components/AppShell.vue b/frontend/src/components/AppShell.vue index d3afc95..b7d1830 100644 --- a/frontend/src/components/AppShell.vue +++ b/frontend/src/components/AppShell.vue @@ -58,6 +58,7 @@ async function goSettings() {