Documentation ¶
Index ¶
- func AddArticle(data map[string]interface{}) error
- func AddCategory(data map[string]interface{}) error
- func AddComment(data map[string]interface{}) error
- func AddTag(data map[string]interface{}) error
- func AddUser(data map[string]interface{}) error
- func DeleteArticleByIds(ids []int) error
- func DeleteCategoryByIds(ids []int) error
- func DeleteCommentByArticleIds(articleIds []int) error
- func DeleteCommentByIds(ids []int) error
- func DeleteCommentByUserIds(userIds []int) error
- func DeleteOwnCommentByIds(userId int, ids []int) error
- func DeleteTagByIds(ids []int) error
- func DeleteUserByIds(ids []int) error
- func ExistArticleByIds(ids []int) (bool, error)
- func ExistByMail(mail string) (bool, error)
- func ExistCategoryByIds(ids []int) (bool, error)
- func ExistCommentByIds(ids []int) (bool, error)
- func ExistTagByIds(ids []int) (bool, error)
- func ExistUserByIds(ids []int) (bool, error)
- func GeCommentTotal(userId int, maps interface{}) (int, error)
- func GetArticleTotal(maps interface{}) (int, error)
- func GetCategoryTotal(maps interface{}) (int, error)
- func GetTagTotal(maps interface{}) (int, error)
- func GetUserTotal(maps interface{}) (int, error)
- func SetUp()
- func UpdArticle(id int, data map[string]interface{}) error
- func UpdArticleViews(id int, views int) error
- func UpdCategory(id int, data map[string]interface{}) error
- func UpdCurrentUser(data map[string]interface{}) error
- func UpdTag(id int, data map[string]interface{}) error
- func UpdUser(id int, data map[string]interface{}) error
- type Article
- type Category
- type Comment
- type Model
- type Profile
- type Role
- type Tag
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddArticle ¶
func AddCategory ¶
func AddComment ¶
func DeleteArticleByIds ¶
func DeleteCategoryByIds ¶
func DeleteCommentByIds ¶
func DeleteCommentByUserIds ¶
func DeleteOwnCommentByIds ¶
func DeleteTagByIds ¶
func DeleteUserByIds ¶
func ExistArticleByIds ¶
func ExistByMail ¶
func ExistCategoryByIds ¶
func ExistCommentByIds ¶
func ExistTagByIds ¶
func ExistUserByIds ¶
func GeCommentTotal ¶
func GetArticleTotal ¶
func GetCategoryTotal ¶
func GetTagTotal ¶
func GetUserTotal ¶
func UpdArticle ¶
func UpdArticleViews ¶
func UpdCategory ¶
func UpdCurrentUser ¶
Types ¶
type Article ¶
type Article struct { Model Title string `json:"title"` Desc string `json:"description" gorm:"column:description"` Content string `json:"content"` Cover string `json:"cover"` State int `json:"state"` Views int `json:"views" gorm:"default:0"` CategoryId int `json:"-" gorm:"index"` Category Category `json:"category"` Tags []*Tag `json:"tag" gorm:"many2many:article_tag"` }
func GetArticle ¶
type Comment ¶
type Comment struct { Model Content string `json:"content"` ProfileId int `json:"-" gorm:"index"` Profile Profile `json:"profile"` ArticleId int `json:"-"` }
func GetComment ¶
func GetComments ¶
type Tag ¶
func GetTagList ¶
Click to show internal directories.
Click to hide internal directories.