refactor: 重构项目结构并优化类型定义

- 移除extension模块,将功能迁移至node-agent
- 修复类型导出问题,使用export type明确类型导出
- 统一数据库连接方式,从直接导入改为使用config/database
- 更新文档中的项目结构描述
- 添加多个服务的实用方法,如getForecast、getBalances等
- 修复类型错误和TS1205警告
- 优化RedisService调用方式
- 添加新的实体类型定义
- 更新审计日志格式,统一字段命名
This commit is contained in:
2026-03-21 15:04:06 +08:00
parent 888d3844f3
commit 15ee1758f5
286 changed files with 9110 additions and 21453 deletions

View File

@@ -260,7 +260,7 @@ import { User } from '@/types/domain/User'
// server/src/models/User.ts
import { User } from '@/types/domain/User'
// extension/src/types/User.ts
// node-agent/src/index.ts
import { User } from '@/types/domain/User'
```

View File

@@ -40,7 +40,7 @@ Count: 613
**步骤**
1. 检查 server/tsconfig.json 配置
2. 检查 dashboard/tsconfig.json 配置
3. 检查 extension/tsconfig.json 配置
3. 检查 node-agent/tsconfig.json 配置
4. 统一配置标准
**预期效果**:减少 5% 错误(约 30 个)

View File

@@ -283,11 +283,11 @@ echo "Checking dashboard types..."
cd ../dashboard && npx tsc --noEmit --skipLibCheck
DASHBOARD_EXIT=$?
echo "Checking extension types..."
cd ../extension && npx tsc --noEmit --skipLibCheck
EXTENSION_EXIT=$?
echo "Checking node-agent types..."
cd ../node-agent && npx tsc --noEmit --skipLibCheck
NODE_AGENT_EXIT=$?
if [ $SERVER_EXIT -ne 0 ] || [ $DASHBOARD_EXIT -ne 0 ] || [ $EXTENSION_EXIT -ne 0 ]; then
if [ $SERVER_EXIT -ne 0 ] || [ $DASHBOARD_EXIT -ne 0 ] || [ $NODE_AGENT_EXIT -ne 0 ]; then
echo "❌ Type check failed"
exit 1
else