Documentation ¶
Index ¶
- Variables
- func AddArticle(data map[string]interface{}) bool
- func AddTag(name string, state int, createdBy string) bool
- func CheckAuth(username, password string) bool
- func CleanAllArticle() bool
- func CleanAllCategory() bool
- func CleanAllTag() bool
- func CloseDB()
- func DelCategory(id uint) bool
- func DeleteArticle(id int) bool
- func DeleteTag(id int) bool
- func EditArticle(id int, data interface{}) bool
- func EditTag(id int, data interface{}) bool
- func ExistArticleByID(id int) bool
- func ExistTagByID(id int) bool
- func ExistTagByName(name string) bool
- func GetArticleTotal(maps interface{}) (count int)
- func GetTagTotal(maps interface{}) (count int)
- func Open(host, port, username, password, name string) *gorm.DB
- func SaveCategory(c Category) bool
- func UpdatePwd(id uint, pwd string) int64
- type Article
- type Auth
- type Category
- type Model
- type SysUsers
- type Tag
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *gorm.DB
Functions ¶
func AddArticle ¶
func DeleteArticle ¶
func EditArticle ¶
func ExistArticleByID ¶
func ExistTagByID ¶
func ExistTagByName ¶
func GetArticleTotal ¶
func GetArticleTotal(maps interface{}) (count int)
func GetTagTotal ¶
func GetTagTotal(maps interface{}) (count int)
Types ¶
type Article ¶
type Article struct { Model TagID int `json:"tag_id" 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.