Files

67 lines
2.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 类变更通知模版
Push 触发 CI 后,按变更类的后缀(`Dto` / `Vo` / `Entity` / `Model`)选用对应模版生成企业微信 Markdown 通知。
## 企微语法说明
使用 webhook **`markdown`**v1支持 font 三色;**不支持无序列表**,故各项以**引用块 + 换行**分行展示。
| 语法 | 说明 |
|------|------|
| `#` / `##` / `###` | 标题(主区块用【】) |
| `` `行内代码` `` | 字段名、URI |
| `>` | 引用行(每项一行) |
| `**bold**` | 头部五行、统计行加粗 |
| `<font color="info">` | 绿类名、新增、HTTP 方法、新类型 |
| `<font color="comment">` | 灰:说明、路径、无影响 |
| `<font color="warning">` | 橙:[修改]/[删除]、旧类型、统计数字 |
## 布局约定
1. **# 【类变更通知】** — 头部 5 项(新增「分支」),每项一行 `>**标签: 值**`(加粗,冒号后两空格);变更对象括号内展示类中文说明(@Schema / @ApiModel / Javadoc无说明则仅类名
2. **## 【对象变更细节】** — 统计行 + 每条变更单行(标签/说明/类型合并)
3. **## 【影响范围】** — 各 ### 小节内,每项一行引用
## 公共头部
```
# 【类变更通知】
> **变更对象: <font color="info">ApplyAttendanceChangeDto</font><font color="comment">流程表单 [出勤变更]</font>**
> **修改人: <font color="comment">dongzi</font>**
> **时间: <font color="comment">2026-06-07 20:14:35</font>**
> **路径: <font color="comment">jnpf-ftb/.../ApplyAttendanceChangeDto.java</font>**
> **分支: <font color="comment">code/code_change_detection_v1.0</font>**
```
## 影响范围
| 类类型 | request | response | 类转换 |
|--------|:-------:|:--------:|:------:|
| Dto | ✅ | ✅ | ✅ |
| Vo | ✅ | ✅ | ✅ |
| Entity / Model | ❌ | ❌ | ✅ |
Dto/Vo 均固定展示 request、response 两栏;无匹配接口时显示「无」。类转换栏仅在 `dto_entity_conversion.enabled: true` 时展示,关闭时不出现该小节。实际影响由接口索引 + 嵌套关系传播,不假定 Dto 仅 request、Vo 仅 response。
## 模版文件
| 文件 | 场景 |
|------|------|
| [field-description.md](field-description.md) | 字段说明与行格式 |
| [dto.md](dto.md) | Dto |
| [vo.md](vo.md) | Vo |
| [entity.md](entity.md) | Entity |
| [model.md](model.md) | Model |
## 实现
| 组件 | 职责 |
|------|------|
| `ClassDeclParser.extractClassDescription()` | 类级中文说明Dto / Vo / Entity / Model 通用) |
| `ClassFieldParser.extractFieldLabel()` | 字段中文说明(四类通用) |
| `ClassChangeAnalyzer` | 编排 diff 并写入 `ClassChangeReport` |
| `WeComNotifier.buildMarkdown()` | 渲染企微 `markdown` 通知 |
路径取自 `ClassChangeReport.sourceFile`。