Add discovery search history with auto-save, fix timeout causing search failure

- Save every search result to DB for later review
- Add '搜索历史' tab with timeline view, load/delete records
- Raise discovery search timeout from 30s to 120s (Bing Puppeteer needs ~40s)
- Reduce search queries from 4 to 3 for faster response
- New model: DiscoveryRecord (user_id, product, market, companies JSON)
- API: POST/GET/DELETE /api/v1/discovery/records
- Migration: discovery_records table
This commit is contained in:
TradeMate Dev
2026-05-27 15:54:50 +08:00
parent 6f0d8b0fb4
commit c1638db6b2
8 changed files with 308 additions and 10 deletions
+7 -3
View File
@@ -71,9 +71,13 @@ export function generateMarketing(data) { return http.post('/marketing/generate'
export function getKeywords(data) { return http.post('/marketing/keywords', data) }
export function competitorAnalysis(data) { return http.post('/marketing/competitor-analysis', data) }
export function discoverySearch(data) { return http.post('/discovery/search', data) }
export function discoveryAnalyze(data) { return http.post('/discovery/analyze', data) }
export function discoveryOutreach(data) { return http.post('/discovery/outreach', data) }
export function discoverySearch(data) { return http.post('/discovery/search', data, { timeout: 120000 }) }
export function discoveryAnalyze(data) { return http.post('/discovery/analyze', data, { timeout: 60000 }) }
export function discoveryOutreach(data) { return http.post('/discovery/outreach', data, { timeout: 60000 }) }
export function saveDiscoveryRecord(data) { return http.post('/discovery/records', data) }
export function listDiscoveryRecords(params) { return http.get('/discovery/records', { params }) }
export function getDiscoveryRecord(id) { return http.get(`/discovery/records/${id}`) }
export function deleteDiscoveryRecord(id) { return http.delete(`/discovery/records/${id}`) }
export function getFollowupStats() { return http.get('/followup/stats') }
export function getFollowupPending() { return http.get('/followup/pending') }