cyc
This commit is contained in:
parent
80d465e85f
commit
61e63c599f
4
Jenkinsfile
vendored
4
Jenkinsfile
vendored
@ -61,8 +61,10 @@ pipeline {
|
||||
# 构建后端
|
||||
echo "构建后端..."
|
||||
cd backend
|
||||
npm run build
|
||||
# 先生成 Prisma Client(构建时需要类型)
|
||||
npm run prisma:generate
|
||||
# 然后构建 TypeScript
|
||||
npm run build
|
||||
cd ..
|
||||
'''
|
||||
}
|
||||
|
||||
@ -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<ReturnType<typeof prisma.course.findMany<{
|
||||
include: { chapters: true };
|
||||
}>;
|
||||
}>>>[0];
|
||||
|
||||
// 课程依赖关系映射
|
||||
const courseDependencies: Record<string, string[]> = {
|
||||
@ -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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user