diff --git a/src/controllers/template.controller.ts b/src/controllers/template.controller.ts index bc0bda0..71c6287 100644 --- a/src/controllers/template.controller.ts +++ b/src/controllers/template.controller.ts @@ -432,7 +432,7 @@ export class TemplateController { * @returns 执行进度信息 */ @Get('execution/:taskId/progress') - async getExecutionProgress(@Param('taskId', ParseIntPipe) taskId: number) { + async getExecutionProgress(@Param('taskId', ParseIntPipe) taskId: number): Promise> { try { const execution = await this.executionRepository.findOne({ where: { id: taskId }, @@ -446,29 +446,26 @@ export class TemplateController { ); } - return { - success: true, - data: { - taskId: execution.id, - templateId: execution.templateId, - templateName: execution.template?.name, - userId: execution.userId, - platform: execution.platform, - type: execution.type, - status: execution.status, - progress: execution.progress, - inputImageUrl: execution.inputImageUrl, - outputUrl: execution.outputUrl, - thumbnailUrl: execution.thumbnailUrl, - errorMessage: execution.errorMessage, - creditCost: execution.creditCost, - startedAt: execution.startedAt, - completedAt: execution.completedAt, - executionDuration: execution.executionDuration, - createdAt: execution.createdAt, - updatedAt: execution.updatedAt, - }, - }; + return ResponseUtil.success({ + taskId: execution.id, + templateId: execution.templateId, + templateName: execution.template?.name, + userId: execution.userId, + platform: execution.platform, + type: execution.type, + status: execution.status, + progress: execution.progress, + inputImageUrl: execution.inputImageUrl, + outputUrl: execution.outputUrl, + thumbnailUrl: execution.thumbnailUrl, + errorMessage: execution.errorMessage, + creditCost: execution.creditCost, + startedAt: execution.startedAt, + completedAt: execution.completedAt, + executionDuration: execution.executionDuration, + createdAt: execution.createdAt, + updatedAt: execution.updatedAt, + }, '获取执行进度成功'); } catch (error) { if (error instanceof HttpException) { throw error;