cyc
This commit is contained in:
parent
80d465e85f
commit
61e63c599f
4
Jenkinsfile
vendored
4
Jenkinsfile
vendored
@ -61,8 +61,10 @@ pipeline {
|
|||||||
# 构建后端
|
# 构建后端
|
||||||
echo "构建后端..."
|
echo "构建后端..."
|
||||||
cd backend
|
cd backend
|
||||||
npm run build
|
# 先生成 Prisma Client(构建时需要类型)
|
||||||
npm run prisma:generate
|
npm run prisma:generate
|
||||||
|
# 然后构建 TypeScript
|
||||||
|
npm run build
|
||||||
cd ..
|
cd ..
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
import { PrismaClient, Prisma } from '@prisma/client';
|
import { PrismaClient } from '@prisma/client';
|
||||||
import { CourseCategory, Difficulty } from '@ai-learning/shared';
|
import { CourseCategory, Difficulty } from '@ai-learning/shared';
|
||||||
|
|
||||||
const prisma = new PrismaClient();
|
const prisma = new PrismaClient();
|
||||||
|
|
||||||
// 定义包含 chapters 的 Course 类型
|
// 定义包含 chapters 的 Course 类型
|
||||||
type CourseWithChapters = Prisma.CourseGetPayload<{
|
type CourseWithChapters = Awaited<ReturnType<typeof prisma.course.findMany<{
|
||||||
include: { chapters: true };
|
include: { chapters: true };
|
||||||
}>;
|
}>>>[0];
|
||||||
|
|
||||||
// 课程依赖关系映射
|
// 课程依赖关系映射
|
||||||
const courseDependencies: Record<string, string[]> = {
|
const courseDependencies: Record<string, string[]> = {
|
||||||
@ -122,7 +122,7 @@ export async function generateLearningPath(
|
|||||||
type: 'course',
|
type: 'course',
|
||||||
});
|
});
|
||||||
// 添加章节节点
|
// 添加章节节点
|
||||||
course.chapters.forEach((chapter, chapterIndex: number) => {
|
course.chapters.forEach((chapter: { id: string }, chapterIndex: number) => {
|
||||||
items.push({
|
items.push({
|
||||||
courseId: course.id,
|
courseId: course.id,
|
||||||
chapterId: chapter.id,
|
chapterId: chapter.id,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user