feat: 支持手动编辑某个视频、分页状态,优化部分代码 (#355)

This commit is contained in:
ᴀᴍᴛᴏᴀᴇʀ
2025-06-06 07:39:17 +08:00
committed by GitHub
parent c0ed37750f
commit 65a047b0fa
20 changed files with 670 additions and 31 deletions

View File

@@ -6,6 +6,8 @@ import type {
VideoResponse,
ResetVideoResponse,
ResetAllVideosResponse,
ResetVideoStatusRequest,
ResetVideoStatusResponse,
ApiError
} from './types';
@@ -154,6 +156,18 @@ class ApiClient {
async resetAllVideos(): Promise<ApiResponse<ResetAllVideosResponse>> {
return this.post<ResetAllVideosResponse>('/videos/reset-all');
}
/**
* 重置视频状态位
* @param id 视频 ID
* @param request 重置请求参数
*/
async resetVideoStatus(
id: number,
request: ResetVideoStatusRequest
): Promise<ApiResponse<ResetVideoStatusResponse>> {
return this.post<ResetVideoStatusResponse>(`/videos/${id}/reset-status`, request);
}
}
// 创建默认的 API 客户端实例
@@ -186,6 +200,12 @@ export const api = {
*/
resetAllVideos: () => apiClient.resetAllVideos(),
/**
* 重置视频状态位
*/
resetVideoStatus: (id: number, request: ResetVideoStatusRequest) =>
apiClient.resetVideoStatus(id, request),
/**
* 设置认证 token
*/