aa
This commit is contained in:
@@ -3,6 +3,9 @@ package controllers
|
||||
import (
|
||||
"crypto/sha1"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/platformapi/dingdingapi"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/ddmsg"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
@@ -55,3 +58,21 @@ func (c *DDAPIController) Sign() {
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 发送钉钉消息
|
||||
// @Description 发送钉钉消息
|
||||
// @Param token header string true "认证token"
|
||||
// @Param title query string true "消息标题"
|
||||
// @Param content query string true "消息内容"
|
||||
// @Param mobile query string true "发送给谁"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /SendDDmsgToUser [post]
|
||||
func (c *DDAPIController) SendDDmsgToUser() {
|
||||
c.callSendDDmsgToUser(func(params *tDdapiSendDDmsgToUserParams) (retVal interface{}, errCode string, err error) {
|
||||
if user, _ := dao.GetUserByID(dao.GetDB(), "mobile", params.Mobile); user != nil {
|
||||
err = ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, params.Title, params.Content)
|
||||
}
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user