diff --git a/src/api/index.ts b/src/api/index.ts index a8e995b..e3286c2 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -21,9 +21,12 @@ export type { Body_update_model_api_models__model_id__put } from './models/Body_ export type { Body_upload_image_api_upload_post } from './models/Body_upload_image_api_upload_post'; export type { HTTPValidationError } from './models/HTTPValidationError'; export type { ImageEditItem } from './models/ImageEditItem'; +export type { PaginationResponse } from './models/PaginationResponse'; export type { TaskQueryRequest } from './models/TaskQueryRequest'; export type { UploadResponse } from './models/UploadResponse'; export type { ValidationError } from './models/ValidationError'; +export type { VideoDataPaginationRequest } from './models/VideoDataPaginationRequest'; +export type { VideoDataResponse } from './models/VideoDataResponse'; export type { VideoTaskRequest } from './models/VideoTaskRequest'; export type { VideoTaskStatus } from './models/VideoTaskStatus'; @@ -41,9 +44,12 @@ export { $Body_update_model_api_models__model_id__put } from './schemas/$Body_up export { $Body_upload_image_api_upload_post } from './schemas/$Body_upload_image_api_upload_post'; export { $HTTPValidationError } from './schemas/$HTTPValidationError'; export { $ImageEditItem } from './schemas/$ImageEditItem'; +export { $PaginationResponse } from './schemas/$PaginationResponse'; export { $TaskQueryRequest } from './schemas/$TaskQueryRequest'; export { $UploadResponse } from './schemas/$UploadResponse'; export { $ValidationError } from './schemas/$ValidationError'; +export { $VideoDataPaginationRequest } from './schemas/$VideoDataPaginationRequest'; +export { $VideoDataResponse } from './schemas/$VideoDataResponse'; export { $VideoTaskRequest } from './schemas/$VideoTaskRequest'; export { $VideoTaskStatus } from './schemas/$VideoTaskStatus'; diff --git a/src/api/models/PaginationResponse.ts b/src/api/models/PaginationResponse.ts new file mode 100644 index 0000000..7942e1b --- /dev/null +++ b/src/api/models/PaginationResponse.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { VideoDataResponse } from './VideoDataResponse'; +export type PaginationResponse = { + status: boolean; + data: Array; + pagination: Record; + msg: string; +}; + diff --git a/src/api/models/VideoDataPaginationRequest.ts b/src/api/models/VideoDataPaginationRequest.ts new file mode 100644 index 0000000..c2c63e4 --- /dev/null +++ b/src/api/models/VideoDataPaginationRequest.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type VideoDataPaginationRequest = { + /** + * 页码,从1开始 + */ + page?: number; + /** + * 每页数量,最大100 + */ + page_size?: number; + /** + * 任务ID筛选(可选) + */ + task_id?: string; + /** + * 图片状态筛选(可选) + */ + img_status?: string; + /** + * 视频状态筛选(可选) + */ + video_status?: string; +}; + diff --git a/src/api/models/VideoDataResponse.ts b/src/api/models/VideoDataResponse.ts new file mode 100644 index 0000000..9e61fca --- /dev/null +++ b/src/api/models/VideoDataResponse.ts @@ -0,0 +1,16 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type VideoDataResponse = { + id: number; + task_id?: string; + img_id?: string; + img_url?: string; + img_status?: string; + video_id?: string; + video_url?: string; + video_status?: string; + create_time?: string; +}; + diff --git a/src/api/models/index.ts b/src/api/models/index.ts index 454c020..3bd3e28 100644 --- a/src/api/models/index.ts +++ b/src/api/models/index.ts @@ -12,8 +12,11 @@ export * from './Body_update_model_api_models__model_id__put'; export * from './Body_upload_image_api_upload_post'; export * from './HTTPValidationError'; export * from './ImageEditItem'; +export * from './PaginationResponse'; export * from './TaskQueryRequest'; export * from './UploadResponse'; export * from './ValidationError'; +export * from './VideoDataPaginationRequest'; +export * from './VideoDataResponse'; export * from './VideoTaskRequest'; export * from './VideoTaskStatus'; \ No newline at end of file diff --git a/src/api/schemas/$PaginationResponse.ts b/src/api/schemas/$PaginationResponse.ts new file mode 100644 index 0000000..37aebba --- /dev/null +++ b/src/api/schemas/$PaginationResponse.ts @@ -0,0 +1,31 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $PaginationResponse = { + properties: { + status: { + type: 'boolean', + isRequired: true, + }, + data: { + type: 'array', + contains: { + type: 'VideoDataResponse', + }, + isRequired: true, + }, + pagination: { + type: 'dictionary', + contains: { + properties: { + }, + }, + isRequired: true, + }, + msg: { + type: 'string', + isRequired: true, + }, + }, +} as const; diff --git a/src/api/schemas/$VideoDataPaginationRequest.ts b/src/api/schemas/$VideoDataPaginationRequest.ts new file mode 100644 index 0000000..a426682 --- /dev/null +++ b/src/api/schemas/$VideoDataPaginationRequest.ts @@ -0,0 +1,31 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $VideoDataPaginationRequest = { + properties: { + page: { + type: 'number', + description: `页码,从1开始`, + minimum: 1, + }, + page_size: { + type: 'number', + description: `每页数量,最大100`, + maximum: 100, + minimum: 1, + }, + task_id: { + type: 'string', + description: `任务ID筛选(可选)`, + }, + img_status: { + type: 'string', + description: `图片状态筛选(可选)`, + }, + video_status: { + type: 'string', + description: `视频状态筛选(可选)`, + }, + }, +} as const; diff --git a/src/api/schemas/$VideoDataResponse.ts b/src/api/schemas/$VideoDataResponse.ts new file mode 100644 index 0000000..56afc04 --- /dev/null +++ b/src/api/schemas/$VideoDataResponse.ts @@ -0,0 +1,37 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $VideoDataResponse = { + properties: { + id: { + type: 'number', + isRequired: true, + }, + task_id: { + type: 'string', + }, + img_id: { + type: 'string', + }, + img_url: { + type: 'string', + }, + img_status: { + type: 'string', + }, + video_id: { + type: 'string', + }, + video_url: { + type: 'string', + }, + video_status: { + type: 'string', + }, + create_time: { + type: 'string', + format: 'date-time', + }, + }, +} as const; diff --git a/src/api/services/DefaultService.ts b/src/api/services/DefaultService.ts index 025a33e..7f23f1e 100644 --- a/src/api/services/DefaultService.ts +++ b/src/api/services/DefaultService.ts @@ -9,8 +9,10 @@ import type { Body_local_async_change_bg_api_v2_local_batch_change_bg_post } fro import type { Body_local_async_gen_images_api_v2_local_batch_edit_images_post } from '../models/Body_local_async_gen_images_api_v2_local_batch_edit_images_post'; import type { Body_local_async_gen_images_api_v2_local_batch_images_post } from '../models/Body_local_async_gen_images_api_v2_local_batch_images_post'; import type { Body_upload_image_api_upload_post } from '../models/Body_upload_image_api_upload_post'; +import type { PaginationResponse } from '../models/PaginationResponse'; import type { TaskQueryRequest } from '../models/TaskQueryRequest'; import type { UploadResponse } from '../models/UploadResponse'; +import type { VideoDataPaginationRequest } from '../models/VideoDataPaginationRequest'; import type { CancelablePromise } from '../core/CancelablePromise'; import { OpenAPI } from '../core/OpenAPI'; import { request as __request } from '../core/request'; @@ -186,6 +188,14 @@ export class DefaultService { } /** * 批量查询任务结果 + * 批量查询任务结果 + * + * Args: + * request: 包含任务ID列表的请求 + * db: 数据库会话 + * + * Returns: + * dict: 查询结果 * @returns any Successful Response * @throws ApiError */ @@ -204,4 +214,61 @@ export class DefaultService { }, }); } + /** + * 分页查询视频生成数据 + * 分页查询视频生成数据,按创建时间降序排列 + * + * Args: + * request: 分页查询请求参数 + * db: 数据库会话 + * + * Returns: + * PaginationResponse: 分页查询结果 + * @returns PaginationResponse Successful Response + * @throws ApiError + */ + public static getImageDataListApiImageDataListGet({ + requestBody, + }: { + requestBody: VideoDataPaginationRequest, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/image/data/list', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 根据ID查询单条视频生成数据 + * 根据ID查询单条视频生成数据 + * + * Args: + * data_id: 数据ID + * db: 数据库会话 + * + * Returns: + * dict: 查询结果 + * @returns any Successful Response + * @throws ApiError + */ + public static getVideoDataByIdApiVideoDataDataIdGet({ + dataId, + }: { + dataId: number, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/video/data/{data_id}', + path: { + 'data_id': dataId, + }, + errors: { + 422: `Validation Error`, + }, + }); + } } diff --git a/src/pages/ModelPage/index.tsx b/src/pages/ModelPage/index.tsx index 3b577ba..f1626cb 100644 --- a/src/pages/ModelPage/index.tsx +++ b/src/pages/ModelPage/index.tsx @@ -77,23 +77,76 @@ const ModelPage: React.FC = () => {
{models.map(item => ( -
- cover -
-
ID: {item.id}
-
标签: {Object.values(item.tag).join('_')}
-
- 状态: {item.status === 1 ? '启用' : '禁用'} -
-
创建时间: {item.create_time}
+
+
+ cover + + {item.status === 1 ? '启用' : '禁用'} +
-
- - +
+
+
ID: {item.id}
+
+ 标签: + {Object.values(item.tag).map((t, i) => ( + + {t} + + ))} +
+
创建时间: {item.create_time}
+
+
+ + +
))}