飞书通知推送基本实现
This commit is contained in:
parent
6216af500f
commit
2c0a6d7adc
|
@ -30,11 +30,7 @@ type FeiShu struct {
|
|||
MsgType string `json:"msg_type"`
|
||||
}
|
||||
|
||||
func (slf *FeiShu) GetTitle() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (slf *FeiShu) GetContent() (string, error) {
|
||||
func (slf *FeiShu) Format() (string, error) {
|
||||
data, err := json.Marshal(slf)
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
|
|
@ -2,8 +2,6 @@ package notify
|
|||
|
||||
// Notify 通用通知接口定义
|
||||
type Notify interface {
|
||||
// GetTitle 获取通知标题
|
||||
GetTitle() string
|
||||
// GetContent 获取通知内容
|
||||
GetContent() (string, error)
|
||||
// Format 格式化通知内容
|
||||
Format() (string, error)
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ type FeiShu struct {
|
|||
}
|
||||
|
||||
func (slf *FeiShu) Push(notify notify.Notify) error {
|
||||
content, err := notify.GetContent()
|
||||
content, err := notify.Format()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue