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