嵌套对象处理
All checks were successful
CodeChecker 变更检测 / code-check (push) Successful in 27s

This commit is contained in:
2026-06-09 17:42:57 +08:00
parent 8b60a84b56
commit a51ab9098a
8 changed files with 105 additions and 18 deletions

View File

@@ -37,10 +37,12 @@ Push 触发 CI 后,按变更类的后缀(`Dto` / `Vo` / `Entity` / `Model`
| 类类型 | request | response | 类转换 |
|--------|:-------:|:--------:|:------:|
| Dto | ✅ | | ✅ |
| Vo | | ✅ | ✅ |
| Dto | ✅ | | ✅ |
| Vo | | ✅ | ✅ |
| Entity / Model | ❌ | ❌ | ✅ |
Dto/Vo 均固定展示 request、response 两栏;无匹配接口时显示「无」。类转换栏仅在 `dto_entity_conversion.enabled: true` 时展示,关闭时不出现该小节。实际影响由接口索引 + 嵌套关系传播,不假定 Dto 仅 request、Vo 仅 response。
## 模版文件
| 文件 | 场景 |

View File

@@ -1,7 +1,8 @@
# Dto 类变更通知模版
**识别规则**:类名以 `Dto` 结尾。
**影响范围**request + 类转换。
**影响范围**request + response + 类转换(无匹配时对应栏显示「无」)。
**嵌套标识**:被其他 Dto/Vo 嵌套时在「变更对象」行追加 `(嵌套对象)`;若同时直接作接口入参/返回值根类型,再追加 `(顶层对象)`。纯顶层不标注。
---
@@ -39,6 +40,20 @@
---
## 示例(嵌套对象)
```
> **变更对象: <font color="info">UserSelfDto</font><font color="comment">嵌套对象</font>**
```
若该类同时直接出现在某接口 `@RequestBody` 或返回值类型中:
```
> **变更对象: <font color="info">SomeDto</font><font color="comment">说明</font><font color="comment">嵌套对象</font><font color="comment">顶层对象</font>**
```
---
## 示例(类删除)
```

View File

@@ -1,7 +1,8 @@
# Vo 类变更通知模版
**识别规则**:类名以 `Vo``VO` 结尾。
**影响范围**response + 类转换
**影响范围**request + response + 类转换(无匹配时对应栏显示「无」)。
**嵌套标识**:规则同 Dto——仅嵌套时标注 `(嵌套对象)`,嵌套且直接作接口根类型时追加 `(顶层对象)`
---