feat: 技能库改为数据库存储 (Prisma Skill 模型 + seed)

- Prisma 新增 Skill 模型 (id/name/description/icon/category/difficulty/systemPrompt/starters/tasks/tags/prerequisiteIds)
- SkillsService 从 DB 读取替代硬编码常量
- seed.ts 新增 seedSkills() 写入 8 个技能
- SkillsController 保持不变,API 返回 JSON 解析后的 starters/tasks
This commit is contained in:
yuzhiran-dev
2026-05-18 16:23:52 +08:00
parent 79d7535c1c
commit 150ae3dcfd
8 changed files with 337 additions and 294 deletions
+10 -1
View File
@@ -292,7 +292,16 @@ function SandboxPage() {
}).then(() => alert('分享成功!')).catch(() => alert('分享失败'));
}
const currentScene = SCENES.find(s => s.id === scene) || SCENES[0];
const currentScene = SCENES.find(s => s.id === scene) || SCENES[0] || null;
if (skillsLoading) return (
<div className="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<div className="animate-pulse space-y-4">
<div className="h-8 w-48 bg-muted rounded-lg" />
<div className="h-[65vh] bg-muted rounded-2xl" />
</div>
</div>
);
const isNewChat = messages.length <= 1 && messages[0]?.role === 'assistant';
return (