Documentation ¶
Index ¶
- func AddArticle(data map[string]interface{}) error
- func AddTag(name, createdBy string, state int) error
- func CheckAuth(username, password string) bool
- func CleanAllArticles() error
- func CleanAllTags() error
- func CloseDB()
- func DeleteArticle(id int) error
- func DeleteTag(id int) error
- func EditArticle(id int, data interface{}) error
- func EditTag(id int, data map[string]interface{}) error
- func ExistTagByID(id int) (bool, error)
- func ExistTagByName(name string) (bool, error)
- func ExistedArticleByID(id int) (bool, error)
- func GetArticleTotal(maps interface{}) (int, error)
- func GetTagTotal(maps interface{}) (int, error)
- func Setup()
- type Article
- type Auth
- type Model
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Article ¶
type Article struct { Model TagID int `json:"tag_id" gorm:"index"` // gorm:"index" 用于声明这个字段为索引,如果使用了自动迁移功能则会有所影响 Tag Tag `json:"tag"` Title string `json:"title"` Desc string `json:"desc"` Content string `json:"content"` CreatedBy string `json:"created_by"` ModifiedBy string `json:"modified_by"` State int `json:"state"` CoverImageURL string `json:"cover_image_url"` }
func GetArticles ¶
获取文章列表
Click to show internal directories.
Click to hide internal directories.