@@ -295,34 +295,33 @@ private void send(Run<?, ?> run, TaskListener listener, NoticeOccasionEnum notic
295
295
atMobiles .add (executorMobile );
296
296
}
297
297
298
- MessageModel msgModel =
299
- item .isRaw () ? MessageModel .builder ()
300
- .type (MsgTypeEnum .MARKDOWN )
301
- .text (
302
- envVars .expand (message ).replace ("\\ \\ n" , "\n " )
303
- ).build ()
304
- : MessageModel .builder ()
305
- .type (MsgTypeEnum .ACTION_CARD )
306
- .atAll (atAll )
307
- .atMobiles (atMobiles )
308
- .title (
309
- String .format ("%s %s" , projectName , statusType .getLabel ())
310
- )
311
- .text (
312
- BuildJobModel .builder ().projectName (projectName ).projectUrl (projectUrl )
313
- .jobName (jobName )
314
- .jobUrl (jobUrl )
315
- .statusType (statusType )
316
- .duration (duration )
317
- .executorName (executorName )
318
- .executorMobile (executorMobile )
319
- .content (
320
- envVars .expand (content ).replace ("\\ \\ n" , "\n " )
321
- )
322
- .build ()
323
- .toMarkdown ()
324
- )
325
- .btns (btns ).build ();
298
+ String title = String .format ("%s %s" , projectName , statusType .getLabel ());
299
+
300
+ MessageModel msgModel = item .isRaw ()
301
+ ? MessageModel .builder ()
302
+ .type (MsgTypeEnum .MARKDOWN )
303
+ .title (title )
304
+ .text (envVars .expand (message ).replace ("\\ \\ n" , "\n " ))
305
+ .build ()
306
+ : MessageModel .builder ()
307
+ .type (MsgTypeEnum .ACTION_CARD )
308
+ .atAll (atAll )
309
+ .atMobiles (atMobiles )
310
+ .title (title )
311
+ .text (BuildJobModel .builder ()
312
+ .projectName (projectName )
313
+ .projectUrl (projectUrl )
314
+ .jobName (jobName )
315
+ .jobUrl (jobUrl )
316
+ .statusType (statusType )
317
+ .duration (duration )
318
+ .executorName (executorName )
319
+ .executorMobile (executorMobile )
320
+ .content (envVars .expand (content ).replace ("\\ \\ n" , "\n " ))
321
+ .build ()
322
+ .toMarkdown ())
323
+ .btns (btns )
324
+ .build ();
326
325
327
326
DingTalkUtils .log (listener , "当前机器人信息,%s" , Utils .toJson (item ));
328
327
DingTalkUtils .log (listener , "发送的消息详情,%s" , Utils .toJson (message ));
0 commit comments