49 lines
771 B
Go
49 lines
771 B
Go
package model
|
|
|
|
import (
|
|
"html/template"
|
|
"time"
|
|
)
|
|
|
|
type ScrapedArticle struct {
|
|
Title string
|
|
Content string
|
|
Slug string
|
|
OriginalUrl string
|
|
SourceId int
|
|
}
|
|
|
|
type DisplayArticle struct {
|
|
ID int
|
|
Title string
|
|
Content template.HTML
|
|
Slug string
|
|
OriginalUrl string
|
|
SourceId int
|
|
CreatedAt time.Time
|
|
FormatedCreatedAt string
|
|
SourceName string
|
|
}
|
|
|
|
const (
|
|
KlixSource = 1
|
|
SrpskainfoSource = 2
|
|
BljesakSource = 3
|
|
)
|
|
|
|
func SourceName(sourceId int) string {
|
|
switch sourceId {
|
|
case KlixSource:
|
|
return "klix"
|
|
case SrpskainfoSource:
|
|
return "srpskainfo"
|
|
case BljesakSource:
|
|
return "bljesak"
|
|
}
|
|
return "starenovine"
|
|
}
|
|
|
|
const (
|
|
Terminator = "TERMINATED"
|
|
)
|