12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package models
- import (
- "database/sql"
- "time"
- )
- type ArticlePreview struct {
- ID int
- URL string
- Title string
- PublishTime time.Time
- PreviewText sql.NullString
- Image sql.NullString
- }
- type Article struct {
- ID int
- URL string
- Title string
- PublishTime time.Time
- Text string
- PreviewText sql.NullString
- IsActive bool
- Image sql.NullString
- MetaKeywords sql.NullString
- MetaDescription sql.NullString
- }
- type ArticleForm struct {
- ID int
- 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[int]bool
- }
|