Files
old-svevijesti/internal/model/model.go

36 lines
568 B
Go
Raw Normal View History

2022-02-10 21:11:13 +01:00
package model
2022-02-13 05:12:49 +01:00
import "time"
2022-02-10 21:11:13 +01:00
type ScrapedArticle struct {
Title string
Content string
Slug string
OriginalUrl string
SourceId int
}
2022-02-13 05:12:49 +01:00
type DisplayArticle struct {
ID int
Title string
Content string
Slug string
OriginalUrl string
SourceId int
CreatedAt time.Time
FormatedCreatedAt string
SourceName string
}
2022-02-10 21:11:13 +01:00
const (
KlixSource = 1
)
2022-02-13 05:12:49 +01:00
func SourceName(sourceId int) string {
switch sourceId {
case KlixSource:
return "klix"
}
return "starenovine"
}