Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add Property for Mastodon Profile URL #278

Merged
merged 1 commit into from
Nov 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ definitions:
type: string
url:
type: string
mastodon:
type: string
status:
type: string
error:
Expand Down
2 changes: 2 additions & 0 deletions internal/api/response/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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,
},
}
}
2 changes: 2 additions & 0 deletions internal/api/response/ticker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions internal/api/tickers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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

Expand Down
1 change: 1 addition & 0 deletions internal/storage/ticker.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ type TickerInformation struct {
Twitter string
Facebook string
Telegram string
Mastodon string
}

type TickerTelegram struct {
Expand Down
Loading