luhaowen 5 days ago
parent
commit
763f864ecc
1 changed files with 3 additions and 12 deletions
  1. 3 12
      src/com/example/FeishuNotifier.groovy

+ 3 - 12
src/com/example/FeishuNotifier.groovy

@@ -23,7 +23,7 @@ class FeishuNotifier implements Serializable {
                     (status == 'SUCCESS') ? '✅ 构建成功' :
                     (status == 'FAILURE') ? '❌ 构建失败' : '🟡 构建不稳定'
 
-        // 2. 飞书卡片:header + elements
+        // 2. 飞书极简卡片:header + elements(采用做法2:elements里放大加粗任务名称)
         def payload = [
             msg_type: 'interactive',
             card: [
@@ -32,24 +32,15 @@ class FeishuNotifier implements Serializable {
                         tag: 'plain_text',
                         content: title
                     ],
-                    template: color
+                    template: color   // 左侧条颜色
                 ],
                 elements: [
-                    // 单独一行:任务名称(加粗 + 火箭 emoji)
-                    [
-                        tag: 'div',
-                        text: [
-                            tag: 'plain_text',
-                            content: "🚀 任务名称:${jobName}",
-                            bold: true
-                        ]
-                    ],
-                    // 其余信息
                     [
                         tag: 'div',
                         text: [
                             tag: 'lark_md',
                             content: """
+**<font size=4>任务名称</font>**: <font size=4><b>${jobName}</b></font>  
 **构建编号**: [#${buildNumber}](${buildUrl})  
 **持续时间**: ${duration}  
 **分支**: ${branch}