feat(drivers/fwalert): - 新增饭碗警告

- 将 msg 移入饭碗警告body中
This commit is contained in:
mei
2026-08-02 20:53:39 +08:00
parent 9220cf82aa
commit 3831950780
4 changed files with 43 additions and 2 deletions
+6 -1
View File
@@ -10,7 +10,12 @@ import (
func send(config *FwAlertRuleConfig) error {
restyClient := resty.New()
req := restyClient.R()
resp, err := req.Execute("GET", config.WebhookURL+"?message="+config.Msg)
req.SetBody(FwAlertRequest{
Message: config.Msg,
})
resp, err := req.Execute(resty.MethodPost, config.WebhookURL)
if err != nil {
return err
}
+4
View File
@@ -6,3 +6,7 @@ type FwAlertRuleConfig struct {
WebhookURL string `json:"webhook_url"`
Msg string `json:"msg"`
}
type FwAlertRequest struct {
Message string `json:"message"`
}