![]() |
3 년 전 | |
---|---|---|
.. | ||
api | 3 년 전 | |
config | 3 년 전 | |
global | 3 년 전 | |
router | 3 년 전 | |
service | 3 년 전 | |
utils | 3 년 전 | |
README.MD | 3 년 전 | |
main.go | 3 년 전 |
本插件用于向钉钉群推送消息
钉钉 token 等相关信息的获取,请参考 钉钉官网
在plugin/notify/global/global.go
文件中配置钉钉通知的URL ,Token 等
var GlobalConfig_ = &config.DingDing{
Url: "https://oapi.dingtalk.com/robot/send",
Token: "xxx",
Secret: "xxx",
}
在代码中调用 SendTextMessage
方法即可
func NotifyController(c *gin.Context) {
if err := service.ServiceGroupApp.SendTextMessage("test"); err != nil {
global.GVA_LOG.Error("发送失败!", zap.Any("err", err))
response.FailWithMessage("发送失败", c)
} else {
response.OkWithData("发送成功", c)
}
}