HEAVY: migrate accounts and logs to service/repo architecture
This commit is contained in:
parent
5c255fb34b
commit
49e14b5bc5
37 changed files with 1019 additions and 687 deletions
|
|
@ -1,43 +0,0 @@
|
|||
package model
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
type (
|
||||
TwitchOAuthToken struct {
|
||||
AccessToken string
|
||||
ExpiresAt time.Time
|
||||
TokenType string
|
||||
}
|
||||
|
||||
TwitchState struct {
|
||||
Token *TwitchOAuthToken
|
||||
}
|
||||
|
||||
TwitchStreamInfo struct {
|
||||
ID string `json:"id"`
|
||||
UserID string `json:"user_id"`
|
||||
UserLogin string `json:"user_login"`
|
||||
UserName string `json:"user_name"`
|
||||
GameID string `json:"game_id"`
|
||||
GameName string `json:"game_name"`
|
||||
Type string `json:"type"`
|
||||
Title string `json:"title"`
|
||||
ViewerCount int `json:"viewer_count"`
|
||||
StartedAt string `json:"started_at"`
|
||||
Language string `json:"language"`
|
||||
ThumbnailURL string `json:"thumbnail_url"`
|
||||
TagIDs []string `json:"tag_ids"`
|
||||
Tags []string `json:"tags"`
|
||||
IsMature bool `json:"is_mature"`
|
||||
}
|
||||
)
|
||||
|
||||
func (info *TwitchStreamInfo) Thumbnail(width int, height int) string {
|
||||
res := strings.Replace(info.ThumbnailURL, "{width}", fmt.Sprintf("%d", width), 1)
|
||||
res = strings.Replace(res, "{height}", fmt.Sprintf("%d", height), 1)
|
||||
return res
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue