feat: add custom webhook message
This commit is contained in:
@@ -47,12 +47,12 @@ func (sm *SendMessageService) Send() string {
|
||||
errStr := ""
|
||||
|
||||
sm.LogsAndStatusMark(fmt.Sprintf("开始任务[%s]的发送", sm.TaskID), sm.Status)
|
||||
sm.LogsAndStatusMark(fmt.Sprintf("发送标题:%s \n", sm.Title), sm.Status)
|
||||
|
||||
sendTaskService := send_task_service.SendTaskService{
|
||||
ID: sm.TaskID,
|
||||
}
|
||||
task, err := sendTaskService.GetTaskWithIns()
|
||||
sm.LogsAndStatusMark(fmt.Sprintf("任务名称:%s", task.Name), sm.Status)
|
||||
sm.LogsAndStatusMark(fmt.Sprintf("发送标题:%s \n", sm.Title), sm.Status)
|
||||
if err != nil {
|
||||
errStr = fmt.Sprintf("任务[%s]不存在!退出发送!", sm.TaskID)
|
||||
sm.LogsAndStatusMark(errStr, SendFail)
|
||||
@@ -109,6 +109,14 @@ func (sm *SendMessageService) Send() string {
|
||||
sm.LogsAndStatusMark(sm.TransError(errMsg), errStrIsSuccess(errMsg))
|
||||
continue
|
||||
}
|
||||
// 自定义webhook类型的实例发送
|
||||
customAuth, ok := msgObj.(send_way_service.WayDetailCustom)
|
||||
if ok {
|
||||
cs := CustomService{}
|
||||
errMsg := cs.SendCustomMessage(customAuth, ins.SendTasksIns, typeC, sm.Title, content)
|
||||
sm.LogsAndStatusMark(sm.TransError(errMsg), errStrIsSuccess(errMsg))
|
||||
continue
|
||||
}
|
||||
sm.LogsAndStatusMark(fmt.Sprintf("发送失败:未知渠道的发信实例: %s\n", ins.ID), SendFail)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user