36 lines
568 B
Go
36 lines
568 B
Go
package model
|
|
|
|
import "time"
|
|
|
|
type ScrapedArticle struct {
|
|
Title string
|
|
Content string
|
|
Slug string
|
|
OriginalUrl string
|
|
SourceId int
|
|
}
|
|
|
|
type DisplayArticle struct {
|
|
ID int
|
|
Title string
|
|
Content string
|
|
Slug string
|
|
OriginalUrl string
|
|
SourceId int
|
|
CreatedAt time.Time
|
|
FormatedCreatedAt string
|
|
SourceName string
|
|
}
|
|
|
|
const (
|
|
KlixSource = 1
|
|
)
|
|
|
|
func SourceName(sourceId int) string {
|
|
switch sourceId {
|
|
case KlixSource:
|
|
return "klix"
|
|
}
|
|
return "starenovine"
|
|
}
|