feat: support dingtalk push

This commit is contained in:
engigu
2024-01-06 17:44:45 +08:00
parent 2730bb97ca
commit e6f7c2c64e
26 changed files with 418 additions and 121 deletions
+3 -1
View File
@@ -11,6 +11,7 @@ import (
type SendMessageReq struct {
TaskID string `json:"task_id" validate:"required,len=36" label:"任务id"`
Text string `json:"text" validate:"required" label:"文本内容"`
Title string `json:"title" label:"消息标题"`
HTML string `json:"html" label:"html内容"`
MarkDown string `json:"markdown" label:"markdown内容"`
Mode string `json:"mode" label:"是否异步发送"`
@@ -31,11 +32,12 @@ func DoSendMassage(c *gin.Context) {
msgService := send_message_service.SendMessageService{
TaskID: req.TaskID,
Title: req.Title,
Text: req.Text,
HTML: req.HTML,
MarkDown: req.MarkDown,
}
if req.Mode != "async" {
if req.Mode == "sync" {
// 同步发送
err := msgService.Send()
if err != "" {