This commit is contained in:
@@ -261,40 +261,44 @@ def build_path_change_markdown(
|
||||
push_time: str,
|
||||
file_name: str,
|
||||
) -> str:
|
||||
"""构建 API路径变更通知,匹配 model1.md 模板,并加强高亮。
|
||||
"""构建 API路径变更通知,完全匹配 model1.md 模板,并加强视觉区分。
|
||||
|
||||
支持的 change_type:
|
||||
- 新增接口:原路径显示 "-",新路径高亮显示
|
||||
- 修改路径:原路径删除线,新路径高亮
|
||||
- 删除接口:原路径高亮,新路径显示 "已删除"
|
||||
改进点:
|
||||
- 标题使用【】风格
|
||||
- 头部信息缩进 + 颜色高亮
|
||||
- URI 详情使用列表(更直观)
|
||||
- 根据变更类型动态强调「原/新路径」
|
||||
"""
|
||||
# 变更类型高亮
|
||||
type_highlight = f"<font color=\"warning\">**{change_type}**</font>"
|
||||
|
||||
# 全路径类名高亮
|
||||
class_highlight = f"<font color=\"info\">**{file_name}**</font>"
|
||||
|
||||
# 根据变更类型优化 URI 展示
|
||||
if change_type == "新增接口":
|
||||
old_display = "-"
|
||||
new_display = f"<font color=\"info\">**`{new_uri}`**</font>"
|
||||
old_display = "`-`"
|
||||
new_display = f"<font color=\"info\">**`{new_uri}`**</font> ← <font color=\"info\">**新增**</font>"
|
||||
elif change_type == "删除接口":
|
||||
old_display = f"<font color=\"warning\">**`{old_uri}`**</font>"
|
||||
new_display = "<font color=\"comment\">已删除</font>"
|
||||
old_display = f"<font color=\"warning\">**`{old_uri}`**</font> ← <font color=\"warning\">**已删除**</font>"
|
||||
new_display = "`已删除`"
|
||||
else: # 修改路径
|
||||
old_display = f"<font color=\"warning\">~~`{old_uri}`~~</font>" if old_uri else "-"
|
||||
new_display = f"<font color=\"info\">**`{new_uri}`**</font>" if new_uri else "<font color=\"comment\">已删除</font>"
|
||||
old_display = f"<font color=\"warning\">~~`{old_uri}`~~</font> ← <font color=\"warning\">**旧路径**</font>"
|
||||
new_display = f"<font color=\"info\">**`{new_uri}`**</font> ← <font color=\"info\">**新路径**</font>"
|
||||
|
||||
parts = [
|
||||
"# 【API路径变更通知】",
|
||||
f"- **变更类型:** <font color=\"warning\">**{change_type}**</font>",
|
||||
f"- **修改人:** {push_user}",
|
||||
f"- **修改时间:** {push_time}",
|
||||
f"- **全路径类名:** <font color=\"info\">**{file_name}**</font>",
|
||||
"",
|
||||
f" 变更类型: {type_highlight}",
|
||||
f" 全路径类名: {class_highlight}",
|
||||
f" 修改人: {push_user}",
|
||||
f" 修改时间: {push_time}",
|
||||
"",
|
||||
"---",
|
||||
"",
|
||||
"## URI变更详情",
|
||||
"",
|
||||
"---",
|
||||
"",
|
||||
"| 项目 | 路径 |",
|
||||
"|------|------|",
|
||||
f"| 原路径 | {old_display} |",
|
||||
f"| 新路径 | {new_display} |",
|
||||
"#### 【URI变更详情】",
|
||||
f"- **原路径:** {old_display}",
|
||||
f"- **新路径:** {new_display}",
|
||||
"",
|
||||
"---",
|
||||
]
|
||||
|
||||
@@ -1,26 +1,17 @@
|
||||
# 【API路径变更通知】
|
||||
|
||||
- **变更类型:** {新增接口 / 修改路径 / 删除接口}
|
||||
- **修改人:** {Modifier}
|
||||
- **修改时间:** {ModifyTime}
|
||||
- **全路径类名:** {FileName}
|
||||
变更类型: {新增接口 / 修改路径 / 删除接口}
|
||||
全路径类名: {FullClassName}
|
||||
修改人: {Modifier}
|
||||
修改时间: {ModifyTime}
|
||||
|
||||
---
|
||||
|
||||
## URI变更详情
|
||||
|
||||
---
|
||||
|
||||
| 项目 | 路径 |
|
||||
|------|------|
|
||||
| 原路径 | `{OldURI}` *(新增时显示:-)* |
|
||||
| 新路径 | `{NewURI}` *(删除时显示:已删除 / -)* |
|
||||
|
||||
---
|
||||
#### 【URI变更详情】
|
||||
- **原路径:** `{OldURI}` *(新增时显示:-)*
|
||||
- **新路径:** `{NewURI}` *(删除时显示:已删除 / -)*
|
||||
|
||||
**示例:**
|
||||
|
||||
| 项目 | 路径 |
|
||||
|------|------|
|
||||
| 原路径 | `/api/users/{id}` |
|
||||
| 新路径 | `/api/users/getall` |
|
||||
- 全路径类名:`com.example.controller.UserController`
|
||||
- 原路径:`/api/users/{id}`
|
||||
- 新路径:`/api/users/getall`
|
||||
Reference in New Issue
Block a user