Commit Graph

5 Commits

Author SHA1 Message Date
chiguyong 79139bc504 chore: geo production readiness improvements 2026-06-04 22:08:06 +08:00
chiguyong b41da42d74 feat(geo): U1-U9 monetization closed loop implementation
U1: GEO diagnosis auto data collection (DataCollectorService + 11 tests)
U2: Free GEO health score public page (HealthScoreAPI + 7 tests)
U3: Onboarding redesign with conversion layer (Step0 + UpgradePrompt + 14 tests)
U4: Real payment integration (WeChat/Alipay gateway + PaymentOrder + 12 tests)
U5: AI content generation & distribution (Publishers + PublishEngine + 11 tests)
U6: Attribution system & ROI reports (AttributionEngine + ROICalculator + 12 tests)
U7: Email integration & Dashboard monetization UI (EmailScheduler + templates + 22 tests)
U8: Integration tests & shared fixtures (monetization flow + fixture consolidation + 12 tests)
U9: E2E smoke tests (HealthScorePage + acquisition/core flow + 4 E2E cases)

Total: 101 new backend tests passing, 4 E2E test cases
All third-party integrations use mock mode by default with config center management
2026-06-01 07:39:05 +08:00
chiguyong 0a39ce6ef1 fix: 审计问题修复第二轮
安全:
- H2: CORS生产环境localhost警告验证器
- M12: JWT_SECRET已有≥32字符验证(确认)

代码质量:
- H4: 11处Any类型替换为具体联合类型
- H5: 4个模型测试文件(47个测试),模型覆盖率32%→64%
- M11: Alembic迁移脚本(6个缺失表),修复迁移链分支

测试: 717 passed
2026-05-26 07:34:07 +08:00
chiguyong 4cc8f73bb4 feat: API Key管理+用量追踪完整功能链路v2(真实可用)
持久化存储:
- APIKey模型 + APIKeyRepository(SQLAlchemy)
- UsageRecord模型 + UsageRepository(SQLAlchemy)

API Key验证:
- KeyVerifier服务(真正调用引擎API验证)
- 支持9个引擎的真实性验证

加密存储:
- KeyEncryption服务(Fernet AES加密)
- 环境变量API_KEY_ENCRYPTION_KEY

用量追踪:
- UsageRecorder自动记录查询用量
- 按引擎/按日聚合(修复by_day空dict)
- UserQuotaService支持套餐配额(free:10/basic:50/pro:200/enterprise:1000)

集成修复:
- AI引擎适配器使用APIKeyManager获取Key(用户Key>系统Key>环境变量)
- SmartRouter与APIKeyManager集成(过滤无Key引擎)
- BatchQueryService自动记录用量并传递用户上下文
- 所有适配器支持引擎特定代理环境变量

前端:
- usage页面替换MOCK为真实API调用
- 显示加载/错误/空状态

测试: 630 passed
2026-05-25 20:43:08 +08:00
chiguyong 84ed5bf31a feat: GEO平台P0-P1核心功能重构 2026-05-23 09:34:58 +08:00