From 6ae391a3c99d019d4a67771fdcd14613fce523fa Mon Sep 17 00:00:00 2001 From: yusing Date: Fri, 31 Jan 2025 14:56:55 +0800 Subject: [PATCH] make POST and JSON as notification defaults --- internal/notif/base.go | 9 +++++++++ internal/notif/gotify.go | 10 ---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/internal/notif/base.go b/internal/notif/base.go index 272d2d24..a1d1a290 100644 --- a/internal/notif/base.go +++ b/internal/notif/base.go @@ -1,6 +1,7 @@ package notif import ( + "net/http" "net/url" "strings" @@ -45,3 +46,11 @@ func (base *ProviderBase) GetURL() string { func (base *ProviderBase) GetToken() string { return base.Token } + +func (base *ProviderBase) GetMethod() string { + return http.MethodPost +} + +func (base *ProviderBase) GetMIMEType() string { + return "application/json" +} diff --git a/internal/notif/gotify.go b/internal/notif/gotify.go index d0a7b1ba..882805a4 100644 --- a/internal/notif/gotify.go +++ b/internal/notif/gotify.go @@ -24,16 +24,6 @@ func (client *GotifyClient) GetURL() string { return client.URL + gotifyMsgEndpoint } -// GetMethod implements Provider. -func (client *GotifyClient) GetMethod() string { - return http.MethodPost -} - -// GetMIMEType implements Provider. -func (client *GotifyClient) GetMIMEType() string { - return "application/json" -} - // MakeBody implements Provider. func (client *GotifyClient) MakeBody(logMsg *LogMessage) (io.Reader, error) { var priority int