package models import ( "database/sql" "time" ) type Language uint8 const ( LangRu Language = 1 LangEn Language = 2 ) type ArticlePreview struct { ID uint64 `db:"id"` URL string `db:"url"` Title string `db:"title"` Image sql.NullString `db:"image"` PreviewText sql.NullString `db:"preview_text"` PublishTime time.Time `db:"publish_time"` } type Article struct { ID uint64 `db:"id"` URL string `db:"url"` Title string `db:"title"` Image sql.NullString `db:"image"` Text string `db:"text"` PreviewText sql.NullString `db:"preview_text"` PublishTime time.Time `db:"publish_time"` MetaKeywords sql.NullString `db:"meta_keywords"` MetaDescription sql.NullString `db:"meta_desc"` IsActive bool `db:"is_active"` Language Language `db:"language"` } type ArticleForm struct { ID uint64 Title string `form:"title" validate:"required,max=255"` Image string `form:"image" validate:"uri,max=255"` URL string `form:"url" validate:"required,max=255"` Text string `form:"text" validate:"required"` PreviewText string `form:"preview_text" validate:"max=255"` MetaKeywords string `form:"meta_keywords" validate:"max=255"` MetaDescription string `form:"meta_description" validate:"max=255"` IsActive bool `form:"is_active"` PublishTime string `form:"publish_time" validate:"required"` Tags []string `form:"tag"` ActiveTags map[uint64]bool }