forked from wangziqi/gongxue-base
feat: add import job detail polling
This commit is contained in:
@@ -46,17 +46,49 @@ export interface TenantStudentItem {
|
||||
export interface ImportJobItem {
|
||||
id: string;
|
||||
importType?: string;
|
||||
sourceFormat?: string;
|
||||
status?: string;
|
||||
sourceName?: string | null;
|
||||
totalCount?: number;
|
||||
validCount?: number;
|
||||
successCount?: number;
|
||||
errorCount?: number;
|
||||
warningCount?: number;
|
||||
insertedCount?: number;
|
||||
updatedCount?: number;
|
||||
skippedCount?: number;
|
||||
executionMode?: string;
|
||||
queuedAt?: string | null;
|
||||
lockedAt?: string | null;
|
||||
lockedBy?: string | null;
|
||||
attemptCount?: number;
|
||||
maxAttempts?: number;
|
||||
nextAttemptAt?: string | null;
|
||||
errorMessage?: string | null;
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
finishedAt?: string | null;
|
||||
summary?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface ImportJobDetail {
|
||||
item?: ImportJobItem;
|
||||
issueSummary?: Record<string, number>;
|
||||
itemStatusSummary?: Record<string, number>;
|
||||
recentIssues?: ImportIssueItem[];
|
||||
importPostCheck?: Record<string, unknown> | null;
|
||||
worker?: {
|
||||
executionMode?: string;
|
||||
queuedAt?: string | null;
|
||||
lockedAt?: string | null;
|
||||
lockedBy?: string | null;
|
||||
attemptCount?: number;
|
||||
maxAttempts?: number;
|
||||
nextAttemptAt?: string | null;
|
||||
lastWorkerError?: Record<string, unknown>;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ContentEntryAdminItem {
|
||||
id: string;
|
||||
name: string;
|
||||
@@ -247,6 +279,10 @@ export async function loadImportJobs(limit = 20) {
|
||||
return apiRequest<{ items?: ImportJobItem[] }>('/api/tenant-content/imports', { query: { limit } });
|
||||
}
|
||||
|
||||
export async function loadImportJobDetail(jobId: string) {
|
||||
return apiRequest<ImportJobDetail>('/api/tenant-content/imports/detail', { query: { jobId } });
|
||||
}
|
||||
|
||||
export async function loadImportIssues(jobId: string) {
|
||||
return apiRequest<{ items?: ImportIssueItem[] }>('/api/tenant-content/imports/issues', { query: { jobId } });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user