From 2c0a6d7adc46413ea35ea7acc372f09a0b93740f Mon Sep 17 00:00:00 2001 From: kercylan98 Date: Thu, 27 Apr 2023 19:48:30 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A3=9E=E4=B9=A6=E9=80=9A=E7=9F=A5=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E5=9F=BA=E6=9C=AC=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notify/notifies/feishu.go | 6 +----- notify/notify.go | 6 ++---- notify/readers/feishu.go | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/notify/notifies/feishu.go b/notify/notifies/feishu.go index 8cafa25..7aac1b6 100644 --- a/notify/notifies/feishu.go +++ b/notify/notifies/feishu.go @@ -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 diff --git a/notify/notify.go b/notify/notify.go index e28afa1..14ca7e8 100644 --- a/notify/notify.go +++ b/notify/notify.go @@ -2,8 +2,6 @@ package notify // Notify 通用通知接口定义 type Notify interface { - // GetTitle 获取通知标题 - GetTitle() string - // GetContent 获取通知内容 - GetContent() (string, error) + // Format 格式化通知内容 + Format() (string, error) } diff --git a/notify/readers/feishu.go b/notify/readers/feishu.go index 53e11fe..355c373 100644 --- a/notify/readers/feishu.go +++ b/notify/readers/feishu.go @@ -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 }