feat: 新增数据库
This commit is contained in:
@@ -24,3 +24,88 @@ export interface IImageGenerateData {
|
||||
/** 上游返回的修订提示词,可能为空 */
|
||||
revisedPrompt?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生图任务状态。
|
||||
*/
|
||||
export type ImageGenerationStatus =
|
||||
| "QUEUED"
|
||||
| "RUNNING"
|
||||
| "SUCCEEDED"
|
||||
| "FAILED";
|
||||
|
||||
/**
|
||||
* 生图历史列表项。
|
||||
*/
|
||||
export interface IImageHistoryItem {
|
||||
/** 生图记录 ID,BigInt 会以字符串返回 */
|
||||
id: string;
|
||||
/** NewAPI 用户 ID */
|
||||
userId: number;
|
||||
/** 用户输入的生图提示词 */
|
||||
prompt: string;
|
||||
/** 生图状态 */
|
||||
status: ImageGenerationStatus;
|
||||
/** 生图模型 */
|
||||
model: string;
|
||||
/** 图片尺寸 */
|
||||
size: string;
|
||||
/** 生图开始时间,ISO 字符串 */
|
||||
startedAt: string;
|
||||
/** 生图结束时间,ISO 字符串,未结束时为 null */
|
||||
endedAt: string | null;
|
||||
/** 生图耗时,单位毫秒 */
|
||||
durationMs: number | null;
|
||||
/** 生成图片的访问地址 */
|
||||
imageUrl: string | null;
|
||||
/** 上游返回的修订提示词,可能为空 */
|
||||
revisedPrompt: string | null;
|
||||
/** 失败原因或图片保存提示 */
|
||||
errorMessage: string | null;
|
||||
/** 记录创建时间,ISO 字符串 */
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生图历史详情。
|
||||
*/
|
||||
export interface IImageHistoryDetail extends IImageHistoryItem {
|
||||
/** 服务端保存的图片 base64 原文,可能为空 */
|
||||
imageBase64: string | null;
|
||||
/** 图片 MIME 类型,可能为空 */
|
||||
imageMimeType: string | null;
|
||||
/** 完整上游生图接口返回结果 */
|
||||
upstreamResponse: unknown;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生图历史分页响应。
|
||||
*/
|
||||
export interface IImageHistoryListData {
|
||||
/** 当前页码 */
|
||||
page: number;
|
||||
/** 每页数量 */
|
||||
pageSize: number;
|
||||
/** 当前用户未删除记录总数 */
|
||||
total: number;
|
||||
/** 当前页历史记录 */
|
||||
items: IImageHistoryItem[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 全局生图统计响应。
|
||||
*/
|
||||
export interface IImageGenerationStatsData {
|
||||
/** 总生图请求数,包含成功和失败 */
|
||||
totalRequests: number;
|
||||
/** 成功生图请求数 */
|
||||
successRequests: number;
|
||||
/** 失败生图请求数 */
|
||||
failedRequests: number;
|
||||
/** 排队中请求数,预留异步任务使用 */
|
||||
queuedRequests: number;
|
||||
/** 进行中请求数 */
|
||||
runningRequests: number;
|
||||
/** 成功生成图片总数 */
|
||||
totalImages: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user