From 61e63c599f18f4475e1c3150de5e2c85bcbbf67b Mon Sep 17 00:00:00 2001 From: caoyuchun <335003032@qq.com> Date: Fri, 16 Jan 2026 13:56:25 +0800 Subject: [PATCH] cyc --- Jenkinsfile | 4 +++- backend/src/services/pathService.ts | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0ac58ab..a2eccf9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -61,8 +61,10 @@ pipeline { # 构建后端 echo "构建后端..." cd backend - npm run build + # 先生成 Prisma Client(构建时需要类型) npm run prisma:generate + # 然后构建 TypeScript + npm run build cd .. ''' } diff --git a/backend/src/services/pathService.ts b/backend/src/services/pathService.ts index f885acc..1d8609e 100644 --- a/backend/src/services/pathService.ts +++ b/backend/src/services/pathService.ts @@ -1,12 +1,12 @@ -import { PrismaClient, Prisma } from '@prisma/client'; +import { PrismaClient } from '@prisma/client'; import { CourseCategory, Difficulty } from '@ai-learning/shared'; const prisma = new PrismaClient(); // 定义包含 chapters 的 Course 类型 -type CourseWithChapters = Prisma.CourseGetPayload<{ +type CourseWithChapters = Awaited; +}>>>[0]; // 课程依赖关系映射 const courseDependencies: Record = { @@ -122,7 +122,7 @@ export async function generateLearningPath( type: 'course', }); // 添加章节节点 - course.chapters.forEach((chapter, chapterIndex: number) => { + course.chapters.forEach((chapter: { id: string }, chapterIndex: number) => { items.push({ courseId: course.id, chapterId: chapter.id,