From d45ac769b782b0748398aa4906655765ea4ae8f6 Mon Sep 17 00:00:00 2001 From: louis Date: Sun, 12 Nov 2023 11:17:38 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20Property=20for=20Mastodon=20P?= =?UTF-8?q?rofile=20URL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger.yaml | 2 ++ internal/api/response/init.go | 2 ++ internal/api/response/ticker.go | 2 ++ internal/api/tickers.go | 2 ++ internal/storage/ticker.go | 1 + 5 files changed, 9 insertions(+) diff --git a/docs/swagger.yaml b/docs/swagger.yaml index eab496da..9263b34a 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -40,6 +40,8 @@ definitions: type: string url: type: string + mastodon: + type: string status: type: string error: diff --git a/internal/api/response/init.go b/internal/api/response/init.go index 89273db7..5c8a5001 100644 --- a/internal/api/response/init.go +++ b/internal/api/response/init.go @@ -22,6 +22,7 @@ type InitTickerInformation struct { Twitter string `json:"twitter"` Facebook string `json:"facebook"` Telegram string `json:"telegram"` + Mastodon string `json:"mastodon"` } func InitTickerResponse(ticker storage.Ticker) InitTicker { @@ -38,6 +39,7 @@ func InitTickerResponse(ticker storage.Ticker) InitTicker { Twitter: ticker.Information.Twitter, Facebook: ticker.Information.Facebook, Telegram: ticker.Information.Telegram, + Mastodon: ticker.Information.Mastodon, }, } } diff --git a/internal/api/response/ticker.go b/internal/api/response/ticker.go index 9560c392..2ab28fba 100644 --- a/internal/api/response/ticker.go +++ b/internal/api/response/ticker.go @@ -27,6 +27,7 @@ type Information struct { Twitter string `json:"twitter"` Facebook string `json:"facebook"` Telegram string `json:"telegram"` + Mastodon string `json:"mastodon"` } type Telegram struct { @@ -66,6 +67,7 @@ func TickerResponse(t storage.Ticker, config config.Config) Ticker { Twitter: t.Information.Twitter, Facebook: t.Information.Facebook, Telegram: t.Information.Telegram, + Mastodon: t.Information.Mastodon, }, Telegram: Telegram{ Active: t.Telegram.Active, diff --git a/internal/api/tickers.go b/internal/api/tickers.go index 0ca0da99..b56f23cf 100644 --- a/internal/api/tickers.go +++ b/internal/api/tickers.go @@ -328,6 +328,7 @@ func updateTicker(t *storage.Ticker, c *gin.Context) error { Twitter string `json:"twitter"` Facebook string `json:"facebook"` Telegram string `json:"telegram"` + Mastodon string `json:"mastodon"` } `json:"information"` Location struct { Lat float64 `json:"lat"` @@ -350,6 +351,7 @@ func updateTicker(t *storage.Ticker, c *gin.Context) error { t.Information.Twitter = body.Information.Twitter t.Information.Facebook = body.Information.Facebook t.Information.Telegram = body.Information.Telegram + t.Information.Mastodon = body.Information.Mastodon t.Location.Lat = body.Location.Lat t.Location.Lon = body.Location.Lon diff --git a/internal/storage/ticker.go b/internal/storage/ticker.go index 3597fe3a..17a091d4 100644 --- a/internal/storage/ticker.go +++ b/internal/storage/ticker.go @@ -40,6 +40,7 @@ type TickerInformation struct { Twitter string Facebook string Telegram string + Mastodon string } type TickerTelegram struct {