feat: 实现阶段二实体体系——AI预处理真实化+实体CRUD+审核归一化
- 新增 entities 数据表(含迁移)、Entity 类型、DAO 层完整 CRUD
- AI 预处理管道接入真实模型(generateText),输出结构化 JSON(摘要+规范化内容+候选实体)
- 模板接口重构为 {systemPrompt, buildUserPrompt, parseOutput},general/meeting 模板真实化
- 新增 5 个实体路由端点 + 实体管理前端页面(列表/详情/编辑弹窗)
- 审核面板增强:展示 AI 预处理结构化结果+候选实体归一化面板(合并/新建/选择/放弃)
- 素材通过时根据用户确认的候选实体写入 entities 表
- 工作台菜单新增"实体"入口
- 新增 entities DAO 测试(16)、processor 测试(11)、路由测试(8),服务端 367 测试全部通过
- TypeScript 0 错误
This commit is contained in:
@@ -136,7 +136,7 @@ describe("素材数据访问层", () => {
|
||||
const materialId = setupMaterial(db, projectId);
|
||||
setMaterialStatus(db, materialId, "review");
|
||||
|
||||
const result = approveMaterial(db, projectId, materialId, LOG);
|
||||
const result = approveMaterial(db, projectId, materialId, [], LOG);
|
||||
expect("error" in result).toBe(false);
|
||||
const material = (result as { material: { status: string } }).material;
|
||||
expect(material.status).toBe("approved");
|
||||
@@ -148,7 +148,7 @@ describe("素材数据访问层", () => {
|
||||
const projectId = setupProject(db);
|
||||
const materialId = setupMaterial(db, projectId);
|
||||
|
||||
const result = approveMaterial(db, projectId, materialId, LOG);
|
||||
const result = approveMaterial(db, projectId, materialId, [], LOG);
|
||||
expect("error" in result).toBe(true);
|
||||
expect((result as { status: number }).status).toBe(409);
|
||||
});
|
||||
@@ -157,7 +157,7 @@ describe("素材数据访问层", () => {
|
||||
test("素材不存在返回 404", () => {
|
||||
withMaterialsDb((db) => {
|
||||
const projectId = setupProject(db);
|
||||
const result = approveMaterial(db, projectId, "nonexistent", LOG);
|
||||
const result = approveMaterial(db, projectId, "nonexistent", [], LOG);
|
||||
expect("error" in result).toBe(true);
|
||||
expect((result as { status: number }).status).toBe(404);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user