fix: 完善工具导出和类型转换 (-35 errors)
This commit is contained in:
50
wwjcloud-nest-v1/PROGRESS_REPORT.md
Normal file
50
wwjcloud-nest-v1/PROGRESS_REPORT.md
Normal file
@@ -0,0 +1,50 @@
|
||||
|
||||
## 🎯 当前进度总结
|
||||
|
||||
### ✅ 已完成的架构改进
|
||||
|
||||
1. **中央Service方法签名索引** (1038个方法)
|
||||
- Scanner提取所有Java方法参数
|
||||
- Coordinator构建全局索引
|
||||
- ControllerGenerator使用索引,不再读文件
|
||||
|
||||
2. **Java类型智能映射**
|
||||
- Integer/Long → number (自动Number()转换)
|
||||
- String → string (直接使用)
|
||||
- Boolean → boolean
|
||||
|
||||
3. **Controller参数匹配V6**
|
||||
- 路径参数:id: Integer → Number(id)
|
||||
- Query参数:name: String → query.name
|
||||
- Query参数:count: Integer → Number(query.count)
|
||||
- Body参数:dto: XxxDto → body
|
||||
|
||||
### 📊 错误改善
|
||||
|
||||
- 初始:14,382 个
|
||||
- 当前:14,121 个
|
||||
- **减少:261 个 (-1.8%)**
|
||||
|
||||
#### Controller层(重点)
|
||||
- 初始:162 个
|
||||
- 当前:49 个
|
||||
- **减少:113 个 (-69.8%)**
|
||||
|
||||
#### Service层
|
||||
- 当前:~14,072 个 (占99.65%)
|
||||
- 主要问题:Java语法转换、Repository注入、Entity导入
|
||||
|
||||
### 🔄 下一步计划
|
||||
|
||||
Service层转换器完善(14,000+错误):
|
||||
1. 完善变量声明转换(Java泛型、数组)
|
||||
2. 完善Collection转换(所有集合构造)
|
||||
3. Repository动态注入
|
||||
4. Entity动态导入
|
||||
5. Java工具类映射(ObjectUtil/CollUtil/StrUtil)
|
||||
6. 异常转换(CommonException → BadRequestException)
|
||||
7. 类型转换语法
|
||||
|
||||
---
|
||||
2025-10-29 21:02:55
|
||||
|
||||
@@ -84,6 +84,9 @@ class TypeConverter {
|
||||
// 【Map/Set】→ TypeScript类型
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
// Record<String, ...> → Record<string, ...> (泛型中的String要小写)
|
||||
tsCode = tsCode.replace(/Record<String,\s*/g, 'Record<string, ');
|
||||
|
||||
// Map<K,V> → Record<K, V>
|
||||
tsCode = tsCode.replace(/Map<(\w+),\s*(\w+)>/g, 'Record<$1, $2>');
|
||||
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
// 统一导出所有工具类
|
||||
export * from "./string.utils";
|
||||
export * from "./common.utils";
|
||||
export * from "./json.utils";
|
||||
export * from "./file.utils";
|
||||
export * from "./date.utils";
|
||||
export * from "./crypto.utils";
|
||||
|
||||
// 重新导出,保持与Java工具类命名一致
|
||||
export { StringUtils } from "./string.utils";
|
||||
export { CommonUtils } from "./common.utils";
|
||||
export { JsonUtils } from "./json.utils";
|
||||
export { FileUtils } from "./file.utils";
|
||||
export { DateUtils } from "./date.utils";
|
||||
export { CryptoUtils } from "./crypto.utils";
|
||||
|
||||
Reference in New Issue
Block a user