feat(transcode): add 3D asset support and turntable viewer

This commit is contained in:
yiling
2026-10-08 23:12:09 +08:00
parent 4b1b64fe2b
commit 06ea4eed78
50 changed files with 3645 additions and 25 deletions
+38
View File
@@ -151,3 +151,41 @@ export class PdfTranscoder {
return task.id
}
}
export class ModelTranscoder {
private spec: PrismaJson.TaskSpec = {}
constructor(
private readonly db: TransactionClient,
private readonly assetId: string,
private readonly teamId: string,
private readonly projectId: string,
) {}
withSprite(): this {
this.spec.sprite = true
return this
}
withPoster(): this {
this.spec.poster = true
return this
}
async submit(): Promise<string> {
const task = await this.db.workflowTask.create({
data: {
assetId: this.assetId,
teamId: this.teamId,
projectId: this.projectId,
type: WorkflowTaskType.transcode_3d,
status: WorkflowTaskStatus.pending,
payload: {
projectId: this.projectId,
transcode: this.spec,
},
},
})
return task.id
}
}