1
All checks were successful
API接口参数变更检测 / api-param-check (push) Successful in 17s

This commit is contained in:
2026-06-05 10:56:37 +08:00
parent 9fa95bae16
commit 21f84d0a9c
2 changed files with 6 additions and 12 deletions

View File

@@ -75,9 +75,6 @@ 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]
@@ -147,7 +144,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"- **修改人:** {mention_user}") parts.append(f"- **修改人:** {push_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:
@@ -291,8 +288,6 @@ 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>"
@@ -315,7 +310,7 @@ def build_path_change_markdown(
"", "",
f" 变更类型: {type_highlight}", f" 变更类型: {type_highlight}",
f" 全路径类名: {class_highlight}", f" 全路径类名: {class_highlight}",
f" 修改人: {mention_user}", f" 修改人: {push_user}",
f" 修改时间: {push_time}", f" 修改时间: {push_time}",
"", "",
"---------------", "---------------",
@@ -342,8 +337,6 @@ 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>'
@@ -355,16 +348,17 @@ def build_method_change_markdown(
"", "",
f" 变更类型: {type_highlight}", f" 变更类型: {type_highlight}",
f" 全路径类名: {class_highlight}", f" 全路径类名: {class_highlight}",
f" 修改人: {mention_user}", f" 修改人: {push_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()

View File

@@ -91,7 +91,7 @@ public class CultureClockInController {
* @param lastCombo 上次组合 * @param lastCombo 上次组合
* @param response HttpServletResponse * @param response HttpServletResponse
*/ */
@PostMapping(value = "/random-preview/delete") @GetMapping(value = "/random-preview/delete")
public ActionResult<Base64ImageVo> getRandomPicPreviewBase64(@RequestParam(value = "lastCombo", required = false) String lastCombo, HttpServletRequest request, HttpServletResponse response) throws Exception { public ActionResult<Base64ImageVo> getRandomPicPreviewBase64(@RequestParam(value = "lastCombo", required = false) String lastCombo, HttpServletRequest request, HttpServletResponse response) throws Exception {
MutablePair<String, BufferedImage> pair = cultureClockInService.getRandomPicPreview(lastCombo, requestUrl); MutablePair<String, BufferedImage> pair = cultureClockInService.getRandomPicPreview(lastCombo, requestUrl);