fix: complete exploration data flow

This commit is contained in:
2026-07-23 22:25:12 +08:00
parent 55ff320cec
commit 5a1b04c4ed
12 changed files with 952 additions and 189 deletions

View File

@@ -35,17 +35,17 @@ const visualExperts = [
let visualDatasetSources = [
{
id: '019b0000-0000-7000-8000-000000000030', name: '手动收集', kind: 'manual', url: '', iconUrl: '',
description: '手动收集的文章与线索', enabled: true, lastSyncedAt: null, itemCount: 1,
description: '手动收集的文章与线索', enabled: true, builtIn: false, lastSyncedAt: null, itemCount: 1,
createdAt: '2026-07-22T06:00:00Z', updatedAt: '2026-07-22T06:00:00Z',
},
{
id: '019b0000-0000-7000-8000-000000000031', name: '需求文档', kind: 'link', url: 'https://example.com/requirements', iconUrl: '',
description: '产品需求与业务文档', enabled: true, lastSyncedAt: null, itemCount: 1,
description: '产品需求与业务文档', enabled: true, builtIn: false, lastSyncedAt: null, itemCount: 1,
createdAt: '2026-07-22T06:00:00Z', updatedAt: '2026-07-22T06:00:00Z',
},
{
id: '019b0000-0000-7000-8000-000000000032', name: '架构讨论', kind: 'link', url: 'https://example.com/architecture', iconUrl: '',
description: '架构方案与系统设计讨论', enabled: true, lastSyncedAt: null, itemCount: 0,
description: '架构方案与系统设计讨论', enabled: true, builtIn: false, lastSyncedAt: null, itemCount: 0,
createdAt: '2026-07-22T06:00:00Z', updatedAt: '2026-07-22T06:00:00Z',
},
]
@@ -225,6 +225,7 @@ await page.route('http://localhost:9150/api/v1/**', async (route) => {
const created = {
id: `019b0000-0000-7000-8000-${String(50 + visualDatasetSources.length).padStart(12, '0')}`,
...input,
builtIn: false,
lastSyncedAt: null,
itemCount: 0,
createdAt: new Date().toISOString(),
@@ -251,7 +252,24 @@ await page.route('http://localhost:9150/api/v1/**', async (route) => {
return
}
if (url.pathname === '/api/v1/dataset-items' && route.request().method() === 'GET') {
await route.fulfill({ json: visualDatasetItems })
const sourceId = url.searchParams.get('sourceId')
const offset = Number(url.searchParams.get('offset') ?? 0)
const limit = Number(url.searchParams.get('limit') ?? 50)
const matchingItems = sourceId
? visualDatasetItems.filter((item) => item.sourceId === sourceId)
: visualDatasetItems
await route.fulfill({
json: {
items: matchingItems.slice(offset, offset + limit),
total: matchingItems.length,
offset,
limit,
},
})
return
}
if (url.pathname.endsWith('/deposit') && route.request().method() === 'POST') {
await route.fulfill({ status: 201, json: { noteId: '019b0000-0000-7000-8000-000000000099', projectId } })
return
}
if (url.pathname.startsWith('/api/v1/dataset-items/') && route.request().method() === 'PATCH') {
@@ -281,6 +299,10 @@ await page.route('http://localhost:9150/api/v1/**', async (route) => {
})
return
}
if (url.pathname === '/api/v1/dataset-crons' && route.request().method() === 'GET') {
await route.fulfill({ json: [] })
return
}
await route.fulfill({ status: 404, json: { error: { code: 'not_found', message: '视觉检查未配置该接口' } } })
})