Commit 3e0eadae authored by fitzcao's avatar fitzcao Committed by irwinsun
Browse files

feat: 手动取消流水线,希望能够不发送企业微信消息通知 #5329

No related merge requests found
Showing with 12 additions and 12 deletions
+12 -12
......@@ -31,26 +31,25 @@ class NotifySendCmd @Autowired constructor(
var templateCode = ""
var notifyType = mutableSetOf<String>()
var settingDetailFlag = false
var sendMsg = false
when {
buildStatus.isFailure() -> {
settingDetailFlag = setting.failSubscription.detailFlag
templateCode = getNotifyTemplateCode(shutdownType, settingDetailFlag)
notifyType = setting.failSubscription.types.map { it.name }.toMutableSet()
}
buildStatus.isCancel() -> {
settingDetailFlag = setting.failSubscription.detailFlag
templateCode = getNotifyTemplateCode(shutdownType, settingDetailFlag)
notifyType = setting.failSubscription.types.map { it.name }.toMutableSet()
sendMsg = true
}
buildStatus.isSuccess() -> {
settingDetailFlag = setting.successSubscription.detailFlag
templateCode = getNotifyTemplateCode(shutdownType, settingDetailFlag)
notifyType = setting.successSubscription.types.map { it.name }.toMutableSet()
sendMsg = true
}
else -> Result<Any>(0)
}
if (sendMsg) {
sendNotifyByTemplate(
templateCode = templateCode,
receivers = commandContextBuild.receivers,
......@@ -59,6 +58,7 @@ class NotifySendCmd @Autowired constructor(
bodyParams = commandContextBuild.notifyValue
)
}
}
private fun getNotifyTemplateCode(type: Int, detailFlag: Boolean): String {
return if (detailFlag) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment