This commit is contained in:
@@ -8,28 +8,29 @@ Push 触发 CI 后,按变更类的后缀(`Dto` / `Vo` / `Entity` / `Model`
|
||||
|
||||
| 语法 | 说明 |
|
||||
|------|------|
|
||||
| `#` / `##` / `###` | 标题 |
|
||||
| `#` / `##` / `###` | 标题(主区块用【】) |
|
||||
| `` `行内代码` `` | 字段名、URI |
|
||||
| `>` | 引用行(每项一行) |
|
||||
| `**bold**` | 头部四行、统计行加粗 |
|
||||
| `<font color="info">` | 绿:类名、新增、HTTP 方法、新类型 |
|
||||
| `<font color="comment">` | 灰:说明、路径、无影响 |
|
||||
| `<font color="warning">` | 橙:[修改]/[删除]、旧类型 |
|
||||
| `<font color="warning">` | 橙:[修改]/[删除]、旧类型、统计数字 |
|
||||
|
||||
## 布局约定
|
||||
|
||||
1. **# 类变更通知** — 头部 4 项,每项一行 `>标签:值`
|
||||
2. **## 对象变更细节** — 每条变更独立引用块,字段间空行分隔
|
||||
3. **## 影响范围** — 各 ### 小节内,每项一行引用
|
||||
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>
|
||||
> **变更对象: <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>**
|
||||
```
|
||||
|
||||
## 影响范围
|
||||
|
||||
@@ -8,32 +8,26 @@
|
||||
## 完整示例(字段修改)
|
||||
|
||||
```
|
||||
# 类变更通知
|
||||
# 【类变更通知】
|
||||
|
||||
> 变更对象:<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="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">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> `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="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="info">[新增]</font> `storeId` 说明: <font color="comment">门店ID</font>
|
||||
|
||||
> <font color="warning">[删除]</font> `oldField`
|
||||
> 说明:<font color="comment">已废弃字段</font>
|
||||
> <font color="warning">[删除]</font> `oldField` 说明: <font color="comment">已废弃字段</font>
|
||||
|
||||
## 影响范围
|
||||
## 【影响范围】
|
||||
|
||||
### 影响 request 接口
|
||||
> <font color="info">POST</font> `/apply/clockIn`
|
||||
@@ -48,7 +42,7 @@
|
||||
## 示例(类删除)
|
||||
|
||||
```
|
||||
## 对象变更细节
|
||||
## 【对象变更细节】
|
||||
|
||||
> <font color="warning">[已删除]</font> <font color="comment">该类文件已被移除</font>
|
||||
```
|
||||
@@ -58,7 +52,7 @@
|
||||
## 示例(仅类名变更)
|
||||
|
||||
```
|
||||
## 对象变更细节
|
||||
## 【对象变更细节】
|
||||
|
||||
> <font color="warning">[类名变更]</font> <font color="comment">ApplyAttendanceChangeDto</font> → <font color="info">ApplyAttendanceChangeNewDto</font>
|
||||
> <font color="comment">字段无变化</font>
|
||||
@@ -69,15 +63,13 @@
|
||||
## 示例(类名 + 字段同时变更)
|
||||
|
||||
```
|
||||
## 对象变更细节
|
||||
## 【对象变更细节】
|
||||
|
||||
> <font color="warning">[类名变更]</font> <font color="comment">ApplyAttendanceChangeDto</font> → <font color="info">ApplyAttendanceChangeNewDto</font>
|
||||
|
||||
> <font color="comment">共 1 项字段变更</font>
|
||||
> **共 <font color="warning">1</font> 项变更**
|
||||
|
||||
> <font color="warning">[修改]</font> `changeMinute`
|
||||
> 说明:<font color="comment">变更分钟数</font>
|
||||
> 类型:<font color="warning">Integer</font> → <font color="info">String</font>
|
||||
> <font color="warning">[修改]</font> `changeMinute` 说明: <font color="comment">变更分钟数</font> 类型: <font color="warning">Integer</font> → <font color="info">String</font>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -8,25 +8,23 @@
|
||||
## 完整示例(字段修改)
|
||||
|
||||
```
|
||||
# 类变更通知
|
||||
# 【类变更通知】
|
||||
|
||||
> 变更对象:<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="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">1</font> 项变更**
|
||||
|
||||
> <font color="warning">[修改]</font> `createTime`
|
||||
> 说明:<font color="comment">创建时间</font>
|
||||
> 类型:<font color="warning">Date</font> → <font color="info">LocalDateTime</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>
|
||||
> Entity: <font color="info">TrainingPositionEntity</font>
|
||||
```
|
||||
|
||||
---
|
||||
@@ -34,7 +32,7 @@
|
||||
## 示例(类删除)
|
||||
|
||||
```
|
||||
## 对象变更细节
|
||||
## 【对象变更细节】
|
||||
|
||||
> <font color="warning">[已删除]</font> <font color="comment">该类文件已被移除</font>
|
||||
```
|
||||
@@ -44,7 +42,7 @@
|
||||
## 示例(仅类名变更)
|
||||
|
||||
```
|
||||
## 对象变更细节
|
||||
## 【对象变更细节】
|
||||
|
||||
> <font color="warning">[类名变更]</font> <font color="comment">TrainingPositionEntity</font> → <font color="info">TrainingPositionNewEntity</font>
|
||||
> <font color="comment">字段无变化</font>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 字段说明规则
|
||||
|
||||
字段变更采用 **引用块 + 换行 + font 颜色**,遵循企微 `markdown` v1(不支持列表)。
|
||||
字段变更采用 **引用块 + 单行合并 + font 颜色**,遵循企微 `markdown` v1(不支持列表)。
|
||||
|
||||
## 说明提取优先级
|
||||
|
||||
@@ -13,26 +13,26 @@
|
||||
|
||||
## 字段变更行格式
|
||||
|
||||
每条变更占**一行**,标签、说明、类型横向排列,冒号后两空格:
|
||||
|
||||
```
|
||||
> <font color="comment">共 4 项字段变更</font>
|
||||
> **共 <font color="warning">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> `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>
|
||||
> <font color="info">[新增]</font> `storeId` 说明: <font color="comment">门店ID</font>
|
||||
```
|
||||
|
||||
| 操作 | 标签 | 类型行 |
|
||||
| 操作 | 标签 | 类型段 |
|
||||
|------|------|--------|
|
||||
| 新增 | info `[新增]` | 无 |
|
||||
| 删除 | warning `[删除]` | 无 |
|
||||
| 修改 | warning `[修改]` | 仅类型变化时出现 |
|
||||
|
||||
- 字段间用**空行**分隔,便于对照
|
||||
- 统计行加粗,数字用 warning(橙色),文案为「共 N 项变更」(不含「字段」)
|
||||
- 多条变更之间用**空行**分隔
|
||||
- 说明为空时显示 `<font color="comment">(无说明)</font>`
|
||||
- 不要在 `<font>` 内嵌 `**bold**`
|
||||
- 头部四行加粗,用 `quoteKvBold`;不要在 `<font>` 内嵌 `**bold**`
|
||||
|
||||
## 接口行格式
|
||||
|
||||
|
||||
@@ -8,25 +8,23 @@
|
||||
## 完整示例(字段修改)
|
||||
|
||||
```
|
||||
# 类变更通知
|
||||
# 【类变更通知】
|
||||
|
||||
> 变更对象:<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="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">1</font> 项变更**
|
||||
|
||||
> <font color="warning">[修改]</font> `ruleType`
|
||||
> 说明:<font color="comment">规则类型</font>
|
||||
> 类型:<font color="warning">Date</font> → <font color="info">String</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>
|
||||
> Entity: <font color="info">AttendanceRuleEntity</font>
|
||||
```
|
||||
|
||||
---
|
||||
@@ -34,7 +32,7 @@
|
||||
## 示例(类删除)
|
||||
|
||||
```
|
||||
## 对象变更细节
|
||||
## 【对象变更细节】
|
||||
|
||||
> <font color="warning">[已删除]</font> <font color="comment">该类文件已被移除</font>
|
||||
```
|
||||
@@ -44,7 +42,7 @@
|
||||
## 示例(仅类名变更)
|
||||
|
||||
```
|
||||
## 对象变更细节
|
||||
## 【对象变更细节】
|
||||
|
||||
> <font color="warning">[类名变更]</font> <font color="comment">AttendanceRuleModel</font> → <font color="info">AttendanceRuleNewModel</font>
|
||||
> <font color="comment">字段无变化</font>
|
||||
|
||||
@@ -8,31 +8,28 @@
|
||||
## 完整示例(字段修改)
|
||||
|
||||
```
|
||||
# 类变更通知
|
||||
# 【类变更通知】
|
||||
|
||||
> 变更对象:<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="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="warning">2</font> 项变更**
|
||||
|
||||
> <font color="info">[新增]</font> `overtimeHours`
|
||||
> 说明:<font color="comment">加班时长</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>
|
||||
> <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>
|
||||
> Entity: <font color="info">AttendanceDetailEntity</font>
|
||||
```
|
||||
|
||||
---
|
||||
@@ -40,7 +37,7 @@
|
||||
## 示例(类删除)
|
||||
|
||||
```
|
||||
## 对象变更细节
|
||||
## 【对象变更细节】
|
||||
|
||||
> <font color="warning">[已删除]</font> <font color="comment">该类文件已被移除</font>
|
||||
```
|
||||
@@ -50,7 +47,7 @@
|
||||
## 示例(仅类名变更)
|
||||
|
||||
```
|
||||
## 对象变更细节
|
||||
## 【对象变更细节】
|
||||
|
||||
> <font color="warning">[类名变更]</font> <font color="comment">AttendanceDetailVo</font> → <font color="info">AttendanceDetailNewVo</font>
|
||||
> <font color="comment">字段无变化</font>
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.concurrent.TimeUnit;
|
||||
* 将 ClassChangeReport 渲染为企业微信 Markdown 并发送(或仅日志输出)。
|
||||
* <p>
|
||||
* 使用 webhook {@code markdown}(v1):引用块 + 换行排版,三色 font(info/comment/warning)。
|
||||
* v1 不支持无序列表,各项以 {@code >标签:值} 分行展示。
|
||||
* v1 不支持无序列表,各项以 {@code >标签: 值} 分行展示(冒号后两空格)。
|
||||
*/
|
||||
public class WeComNotifier {
|
||||
private static final int MAX_LENGTH = 3800;
|
||||
@@ -82,14 +82,14 @@ public class WeComNotifier {
|
||||
return truncate(sb.toString());
|
||||
}
|
||||
|
||||
/** 头部元信息,每项一行引用 */
|
||||
/** 头部元信息,每项一行引用(加粗) */
|
||||
private void appendHeader(StringBuilder sb, ClassChangeReport report,
|
||||
String modifier, String modifyTime) {
|
||||
sb.append(quoteKv("变更对象", colorInfo(safe(report.getClassName()))
|
||||
sb.append(quoteKvBold("变更对象", colorInfo(safe(report.getClassName()))
|
||||
+ "(" + report.getClassType().getLabel() + ")")).append("\n");
|
||||
sb.append(quoteKv("修改人", colorComment(modifier))).append("\n");
|
||||
sb.append(quoteKv("时间", colorComment(modifyTime))).append("\n");
|
||||
sb.append(quoteKv("路径", colorComment(report.getSourceFile()))).append("\n");
|
||||
sb.append(quoteKvBold("修改人", colorComment(modifier))).append("\n");
|
||||
sb.append(quoteKvBold("时间", colorComment(modifyTime))).append("\n");
|
||||
sb.append(quoteKvBold("路径", colorComment(report.getSourceFile()))).append("\n");
|
||||
}
|
||||
|
||||
/** 渲染删除 / 重命名 / 字段变更 */
|
||||
@@ -112,8 +112,9 @@ public class WeComNotifier {
|
||||
}
|
||||
|
||||
if (!report.getFieldChanges().isEmpty()) {
|
||||
sb.append(quoteLine(colorComment("共 "
|
||||
+ report.getFieldChanges().size() + " 项字段变更"))).append("\n\n");
|
||||
int count = report.getFieldChanges().size();
|
||||
sb.append(quoteLine("**共 " + colorWarning(String.valueOf(count)) + " 项变更**"))
|
||||
.append("\n\n");
|
||||
for (int i = 0; i < report.getFieldChanges().size(); i++) {
|
||||
if (i > 0) {
|
||||
sb.append("\n");
|
||||
@@ -204,10 +205,7 @@ public class WeComNotifier {
|
||||
return quoteLine(inlineCode(safe(line)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 单条字段变更:引用块多行,字段间空行分隔。
|
||||
* 避免 font 内嵌 bold。
|
||||
*/
|
||||
/** 单条字段变更:标签、说明、类型合并为一行,字段间空行分隔 */
|
||||
private String formatFieldChange(FieldChange change) {
|
||||
String fieldName = inlineCode(safe(change.getFieldName()));
|
||||
String desc = change.getDescription() == null ? "" : change.getDescription();
|
||||
@@ -217,21 +215,19 @@ public class WeComNotifier {
|
||||
|
||||
switch (change.getKind()) {
|
||||
case ADDED:
|
||||
return quoteLine(tagAdded() + " " + fieldName) + "\n"
|
||||
+ quoteKv("说明", descPart);
|
||||
return quoteLine(tagAdded() + " " + fieldName + " 说明: " + descPart);
|
||||
case REMOVED:
|
||||
return quoteLine(tagRemoved() + " " + fieldName) + "\n"
|
||||
+ quoteKv("说明", descPart);
|
||||
return quoteLine(tagRemoved() + " " + fieldName + " 说明: " + descPart);
|
||||
case MODIFIED:
|
||||
default:
|
||||
StringBuilder block = new StringBuilder();
|
||||
block.append(quoteLine(tagModified() + " " + fieldName)).append("\n");
|
||||
block.append(quoteKv("说明", descPart));
|
||||
StringBuilder line = new StringBuilder();
|
||||
line.append(tagModified()).append(" ").append(fieldName)
|
||||
.append(" 说明: ").append(descPart);
|
||||
String detail = change.getDetail();
|
||||
if (detail != null && !detail.isBlank()) {
|
||||
block.append("\n").append(quoteKv("类型", formatTypeChange(detail)));
|
||||
line.append(" 类型: ").append(formatTypeChange(detail));
|
||||
}
|
||||
return block.toString();
|
||||
return quoteLine(line.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,9 +254,14 @@ public class WeComNotifier {
|
||||
return colorWarning("[修改]");
|
||||
}
|
||||
|
||||
/** 引用行:{@code >标签:值} */
|
||||
/** 引用行:{@code >标签: 值}(冒号后两空格) */
|
||||
private String quoteKv(String key, String value) {
|
||||
return "> " + key + ":" + value;
|
||||
return "> " + key + ": " + value;
|
||||
}
|
||||
|
||||
/** 加粗引用行:用于类变更通知头部 */
|
||||
private String quoteKvBold(String key, String value) {
|
||||
return "> **" + key + ": " + value + "**";
|
||||
}
|
||||
|
||||
/** 纯引用行 */
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# 本地打包 class-checker 并复制到 .gitea/workflows/
|
||||
$ErrorActionPreference = "Stop"
|
||||
$Root = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Path)
|
||||
$CheckerDir = Join-Path $Root ".gitea\class-checker"
|
||||
$CheckerDir = Join-Path $Root ".gitea\checker"
|
||||
$WorkflowsDir = Join-Path $Root ".gitea\workflows"
|
||||
$TargetJar = Join-Path $CheckerDir "target\class-checker.jar"
|
||||
$OutputJar = Join-Path $WorkflowsDir "class-checker.jar"
|
||||
|
||||
Write-Host ">> 编译 class-checker..."
|
||||
Push-Location $Root
|
||||
& mvn -q -f .gitea/class-checker/pom.xml package -DskipTests
|
||||
& mvn -q -f .gitea/checker/pom.xml package -DskipTests
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Pop-Location
|
||||
Write-Error "Maven 编译失败,exit code: $LASTEXITCODE"
|
||||
|
||||
Reference in New Issue
Block a user