64 Star 412 Fork 133

admpub/nging

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
alertRecipient_ext.go 642 Bytes
一键复制 编辑 原始数据 按行查看 历史
admpub 提交于 2020-06-10 20:05 +08:00 . improved
package model
import (
"encoding/json"
"github.com/admpub/nging/application/dbschema"
"github.com/webx-top/com"
"github.com/webx-top/echo"
"github.com/webx-top/echo/param"
)
type AlertRecipientExt struct {
*dbschema.NgingAlertRecipient
Extra echo.H
}
func (a *AlertRecipientExt) Parse() *AlertRecipientExt {
if a.Extra != nil {
return a
}
a.Extra = echo.H{}
if len(a.NgingAlertRecipient.Extra) > 0 {
json.Unmarshal(com.Str2bytes(a.NgingAlertRecipient.Extra), &a.Extra)
}
return a
}
func (a *AlertRecipientExt) Send(params param.Store) (err error) {
a.Parse()
return alertSend(a.NgingAlertRecipient, a.Extra, params)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/admpub/nging.git
git@gitee.com:admpub/nging.git
admpub
nging
nging
v2.2.3

搜索帮助