脚本修改
Some checks failed
类变更检测 / class-change-check (push) Failing after 1s

This commit is contained in:
2026-06-08 13:08:34 +08:00
parent 9e1d66c81f
commit 2f8798c38c
39 changed files with 3577 additions and 21 deletions

View File

@@ -0,0 +1,55 @@
# 类变更通知模版
Push 触发 CI 后,按变更类的后缀(`Dto` / `Vo` / `Entity` / `Model`)选用对应模版生成企业微信 Markdown 通知。
## 企微语法说明
使用 webhook **`markdown`**v1支持 font 三色;**不支持无序列表**,故各项以**引用块 + 换行**分行展示。
| 语法 | 说明 |
|------|------|
| `#` / `##` / `###` | 标题 |
| `` `行内代码` `` | 字段名、URI |
| `>` | 引用行(每项一行) |
| `<font color="info">` | 绿类名、新增、HTTP 方法、新类型 |
| `<font color="comment">` | 灰:说明、路径、无影响 |
| `<font color="warning">` | 橙:[修改]/[删除]、旧类型 |
## 布局约定
1. **# 类变更通知** — 头部 4 项,每项一行 `>标签:值`
2. **## 对象变更细节** — 每条变更独立引用块,字段间空行分隔
3. **## 影响范围** — 各 ### 小节内,每项一行引用
## 公共头部
```
# 类变更通知
> 变更对象:<font color="info">ApplyAttendanceChangeDto</font>Dto
> 修改人:<font color="comment">dongzi</font>
> 时间:<font color="comment">2026-06-07 20:14:35</font>
> 路径:<font color="comment">jnpf-ftb/.../ApplyAttendanceChangeDto.java</font>
```
## 影响范围
| 类类型 | request | response | 类转换 |
|--------|:-------:|:--------:|:------:|
| Dto | ✅ | ❌ | ✅ |
| Vo | ❌ | ✅ | ✅ |
| Entity / Model | ❌ | ❌ | ✅ |
## 模版文件
| 文件 | 场景 |
|------|------|
| [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 |
## 实现
`WeComNotifier.buildMarkdown()` · 消息类型 `markdown` · 路径取自 `ClassChangeReport.sourceFile`

View File

@@ -0,0 +1,90 @@
# Dto 类变更通知模版
**识别规则**:类名以 `Dto` 结尾。
**影响范围**request + 类转换。
---
## 完整示例(字段修改)
```
# 类变更通知
> 变更对象:<font color="info">ApplyAttendanceChangeDto</font>Dto
> 修改人:<font color="comment">dongzi</font>
> 时间:<font color="comment">2026-06-07 20:14:35</font>
> 路径:<font color="comment">jnpf-ftb/jnpf-ftb-entity/src/main/java/jnpf/model/workflow/dto/ApplyAttendanceChangeDto.java</font>
## 对象变更细节
> <font color="comment">共 4 项字段变更</font>
> <font color="warning">[修改]</font> `taskId`
> 说明:<font color="comment">流程主键</font>
> 类型:<font color="warning">Integer</font> → <font color="info">String</font>
> <font color="warning">[修改]</font> `changeUserId`
> 说明:<font color="comment">变更人员id</font>
> 类型:<font color="warning">String</font> → <font color="info">Integer</font>
> <font color="info">[新增]</font> `storeId`
> 说明:<font color="comment">门店ID</font>
> <font color="warning">[删除]</font> `oldField`
> 说明:<font color="comment">已废弃字段</font>
## 影响范围
### 影响 request 接口
> <font color="info">POST</font> `/apply/clockIn`
> <font color="info">PUT</font> `/apply/clockIn/{id}`
### 类转换影响
> <font color="comment">未开启检测</font>
```
---
## 示例(类删除)
```
## 对象变更细节
> <font color="warning">[已删除]</font> <font color="comment">该类文件已被移除</font>
```
---
## 示例(仅类名变更)
```
## 对象变更细节
> <font color="warning">[类名变更]</font> <font color="comment">ApplyAttendanceChangeDto</font> → <font color="info">ApplyAttendanceChangeNewDto</font>
> <font color="comment">字段无变化</font>
```
---
## 示例(类名 + 字段同时变更)
```
## 对象变更细节
> <font color="warning">[类名变更]</font> <font color="comment">ApplyAttendanceChangeDto</font> → <font color="info">ApplyAttendanceChangeNewDto</font>
> <font color="comment">共 1 项字段变更</font>
> <font color="warning">[修改]</font> `changeMinute`
> 说明:<font color="comment">变更分钟数</font>
> 类型:<font color="warning">Integer</font> → <font color="info">String</font>
```
---
## 占位符
| 占位符 | 来源 |
|--------|------|
| 路径 | Git 相对路径,`ClassChangeReport.sourceFile` |
| 说明 | `@Schema` / 注释 |

View File

@@ -0,0 +1,51 @@
# Entity 类变更通知模版
**识别规则**:类名以 `Entity` 结尾。
**影响范围**:仅类转换(不展示 request/response 接口)。
---
## 完整示例(字段修改)
```
# 类变更通知
> 变更对象:<font color="info">TrainingPositionEntity</font>Entity
> 修改人:<font color="comment">张三</font>
> 时间:<font color="comment">2026-06-07 14:30:00</font>
> 路径:<font color="comment">jnpf-ftb/jnpf-ftb-entity/src/main/java/jnpf/entity/training/TrainingPositionEntity.java</font>
## 对象变更细节
> <font color="comment">共 1 项字段变更</font>
> <font color="warning">[修改]</font> `createTime`
> 说明:<font color="comment">创建时间</font>
> 类型:<font color="warning">Date</font> → <font color="info">LocalDateTime</font>
## 影响范围
### 类转换影响
> Entity:<font color="info">TrainingPositionEntity</font>
```
---
## 示例(类删除)
```
## 对象变更细节
> <font color="warning">[已删除]</font> <font color="comment">该类文件已被移除</font>
```
---
## 示例(仅类名变更)
```
## 对象变更细节
> <font color="warning">[类名变更]</font> <font color="comment">TrainingPositionEntity</font> → <font color="info">TrainingPositionNewEntity</font>
> <font color="comment">字段无变化</font>
```

View File

@@ -0,0 +1,47 @@
# 字段说明规则
字段变更采用 **引用块 + 换行 + font 颜色**,遵循企微 `markdown` v1不支持列表
## 说明提取优先级
| 优先级 | 来源 |
|:------:|------|
| 1 | `@Schema(description = "...")` |
| 2 | `@ApiModelProperty` |
| 3 | `/** ... */` 字段注释 |
| 4 | 空串 |
## 字段变更行格式
```
> <font color="comment">共 4 项字段变更</font>
> <font color="warning">[修改]</font> `taskId`
> 说明:<font color="comment">流程主键</font>
> 类型:<font color="warning">Integer</font> → <font color="info">String</font>
> <font color="info">[新增]</font> `storeId`
> 说明:<font color="comment">门店ID</font>
```
| 操作 | 标签 | 类型行 |
|------|------|--------|
| 新增 | info `[新增]` | 无 |
| 删除 | warning `[删除]` | 无 |
| 修改 | warning `[修改]` | 仅类型变化时出现 |
- 字段间用**空行**分隔,便于对照
- 说明为空时显示 `<font color="comment">(无说明)</font>`
- 不要在 `<font>` 内嵌 `**bold**`
## 接口行格式
```
> <font color="info">POST</font> `/apply/clockIn`
```
## 实现
- `ClassFieldParser.extractFieldLabel()`
- `FieldDiffEngine` — 仅类型变化产生 `[修改]`
- `WeComNotifier.formatFieldChange()`

View File

@@ -0,0 +1,51 @@
# Model 类变更通知模版
**识别规则**:类名以 `Model` 结尾。
**影响范围**:仅类转换(不展示 request/response 接口)。
---
## 完整示例(字段修改)
```
# 类变更通知
> 变更对象:<font color="info">AttendanceRuleModel</font>Model
> 修改人:<font color="comment">张三</font>
> 时间:<font color="comment">2026-06-07 14:30:00</font>
> 路径:<font color="comment">jnpf-ftb/jnpf-ftb-entity/src/main/java/jnpf/model/attendance/AttendanceRuleModel.java</font>
## 对象变更细节
> <font color="comment">共 1 项字段变更</font>
> <font color="warning">[修改]</font> `ruleType`
> 说明:<font color="comment">规则类型</font>
> 类型:<font color="warning">Date</font> → <font color="info">String</font>
## 影响范围
### 类转换影响
> Entity:<font color="info">AttendanceRuleEntity</font>
```
---
## 示例(类删除)
```
## 对象变更细节
> <font color="warning">[已删除]</font> <font color="comment">该类文件已被移除</font>
```
---
## 示例(仅类名变更)
```
## 对象变更细节
> <font color="warning">[类名变更]</font> <font color="comment">AttendanceRuleModel</font> → <font color="info">AttendanceRuleNewModel</font>
> <font color="comment">字段无变化</font>
```

View File

@@ -0,0 +1,57 @@
# Vo 类变更通知模版
**识别规则**:类名以 `Vo``VO` 结尾。
**影响范围**response + 类转换。
---
## 完整示例(字段修改)
```
# 类变更通知
> 变更对象:<font color="info">AttendanceDetailVo</font>Vo
> 修改人:<font color="comment">张三</font>
> 时间:<font color="comment">2026-06-07 14:30:00</font>
> 路径:<font color="comment">jnpf-ftb/jnpf-ftb-entity/src/main/java/jnpf/model/attendance/vo/AttendanceDetailVo.java</font>
## 对象变更细节
> <font color="comment">共 2 项字段变更</font>
> <font color="info">[新增]</font> `overtimeHours`
> 说明:<font color="comment">加班时长</font>
> <font color="warning">[修改]</font> `status`
> 说明:<font color="comment">考勤状态</font>
> 类型:<font color="warning">Integer</font> → <font color="info">String</font>
## 影响范围
### 影响 response 接口
> <font color="info">GET</font> `/api/attendance/detail`
### 类转换影响
> Entity:<font color="info">AttendanceDetailEntity</font>
```
---
## 示例(类删除)
```
## 对象变更细节
> <font color="warning">[已删除]</font> <font color="comment">该类文件已被移除</font>
```
---
## 示例(仅类名变更)
```
## 对象变更细节
> <font color="warning">[类名变更]</font> <font color="comment">AttendanceDetailVo</font> → <font color="info">AttendanceDetailNewVo</font>
> <font color="comment">字段无变化</font>
```