This commit is contained in:
@@ -75,6 +75,9 @@ def build_markdown_notification(
|
|||||||
"""
|
"""
|
||||||
parts: List[str] = []
|
parts: List[str] = []
|
||||||
|
|
||||||
|
# 统一格式化 @ 用户名
|
||||||
|
mention_user = push_user if push_user.startswith("@") else f"@{push_user}"
|
||||||
|
|
||||||
# 所有 API 级变更(新增、修改路径、修改请求方式、删除、参数变更)统一走 model1.md 路径变更通知
|
# 所有 API 级变更(新增、修改路径、修改请求方式、删除、参数变更)统一走 model1.md 路径变更通知
|
||||||
method_changed_reports = [r for r in reports if r.is_method_changed]
|
method_changed_reports = [r for r in reports if r.is_method_changed]
|
||||||
renamed_reports = [r for r in reports if r.is_renamed_endpoint]
|
renamed_reports = [r for r in reports if r.is_renamed_endpoint]
|
||||||
@@ -144,7 +147,7 @@ def build_markdown_notification(
|
|||||||
if changed_reports:
|
if changed_reports:
|
||||||
parts.append("# API参数变更通知")
|
parts.append("# API参数变更通知")
|
||||||
parts.append(f"- **变更类型:** 修改参数")
|
parts.append(f"- **变更类型:** 修改参数")
|
||||||
parts.append(f"- **修改人:** {push_user}")
|
parts.append(f"- **修改人:** {mention_user}")
|
||||||
parts.append(f"- **修改时间:** {push_time}")
|
parts.append(f"- **修改时间:** {push_time}")
|
||||||
parts.append("")
|
parts.append("")
|
||||||
for report in changed_reports:
|
for report in changed_reports:
|
||||||
@@ -288,6 +291,8 @@ def build_path_change_markdown(
|
|||||||
- URI 详情使用列表(更直观)
|
- URI 详情使用列表(更直观)
|
||||||
- 「修改请求方式」额外展示方法变更
|
- 「修改请求方式」额外展示方法变更
|
||||||
"""
|
"""
|
||||||
|
mention_user = push_user if push_user.startswith("@") else f"@{push_user}"
|
||||||
|
|
||||||
# 变更类型高亮
|
# 变更类型高亮
|
||||||
type_highlight = f"<font color=\"warning\">**{change_type}**</font>"
|
type_highlight = f"<font color=\"warning\">**{change_type}**</font>"
|
||||||
|
|
||||||
@@ -310,7 +315,7 @@ def build_path_change_markdown(
|
|||||||
"",
|
"",
|
||||||
f" 变更类型: {type_highlight}",
|
f" 变更类型: {type_highlight}",
|
||||||
f" 全路径类名: {class_highlight}",
|
f" 全路径类名: {class_highlight}",
|
||||||
f" 修改人: {push_user}",
|
f" 修改人: {mention_user}",
|
||||||
f" 修改时间: {push_time}",
|
f" 修改时间: {push_time}",
|
||||||
"",
|
"",
|
||||||
"---------------",
|
"---------------",
|
||||||
@@ -337,6 +342,8 @@ def build_method_change_markdown(
|
|||||||
格式参考 model1.md,但专门针对 HTTP 方法变更场景设计,
|
格式参考 model1.md,但专门针对 HTTP 方法变更场景设计,
|
||||||
突出「原请求方式 → 新请求方式」的对比。
|
突出「原请求方式 → 新请求方式」的对比。
|
||||||
"""
|
"""
|
||||||
|
mention_user = push_user if push_user.startswith("@") else f"@{push_user}"
|
||||||
|
|
||||||
type_highlight = '<font color="warning">**修改请求方式**</font>'
|
type_highlight = '<font color="warning">**修改请求方式**</font>'
|
||||||
class_highlight = f'<font color="info">**{file_name}**</font>'
|
class_highlight = f'<font color="info">**{file_name}**</font>'
|
||||||
uri_highlight = f'<font color="info">**`{uri}`**</font>'
|
uri_highlight = f'<font color="info">**`{uri}`**</font>'
|
||||||
@@ -348,17 +355,16 @@ def build_method_change_markdown(
|
|||||||
"",
|
"",
|
||||||
f" 变更类型: {type_highlight}",
|
f" 变更类型: {type_highlight}",
|
||||||
f" 全路径类名: {class_highlight}",
|
f" 全路径类名: {class_highlight}",
|
||||||
f" 修改人: {push_user}",
|
f" 修改人: {mention_user}",
|
||||||
f" 修改时间: {push_time}",
|
f" 修改时间: {push_time}",
|
||||||
"",
|
"",
|
||||||
"---",
|
"---------------------------------",
|
||||||
"",
|
"",
|
||||||
"#### 【请求方式变更详情】",
|
"#### 【请求方式变更详情】",
|
||||||
f"- **URI:** {uri_highlight}",
|
f"- **URI:** {uri_highlight}",
|
||||||
f"- **原请求方式:** {old_m}",
|
f"- **原请求方式:** {old_m}",
|
||||||
f"- **新请求方式:** {new_m} ← <font color=\"info\">**请求方式已变更**</font>",
|
f"- **新请求方式:** {new_m} ← <font color=\"info\">**请求方式已变更**</font>",
|
||||||
"",
|
"",
|
||||||
"---",
|
|
||||||
]
|
]
|
||||||
return "\n".join(parts).strip()
|
return "\n".join(parts).strip()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user