Documentation ¶
Index ¶
- func AddArticle(data map[string]interface{}) error
- func AddTag(name string, state int, createdBy string) error
- func CheckAuth(username string, auth int) bool
- func CleanAllArticle() error
- func CleanAllTag() (bool, 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 interface{}) error
- func ExistArticleByID(id int) (bool, error)
- func ExistTagByID(id int) (bool, error)
- func ExistTagByName(name string) (bool, error)
- func GetArticleTotal(maps interface{}) (int, error)
- func GetTagTotal(maps interface{}) (int, error)
- func Setup()
- type Article
- type Auth
- type Model
- type Tag
- type UserInfo
- type UserMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddArticle ¶
AddArticle add a single article
func EditArticle ¶
EditArticle modify a single article
func ExistArticleByID ¶
ExistArticleByID checks if an article exists based on ID
func ExistTagByID ¶
ExistTagByID determines whether a Tag exists based on the ID
func ExistTagByName ¶
ExistTagByName checks if there is a tag with the same name
func GetArticleTotal ¶
GetArticleTotal gets the total number of articles based on the constraints
func GetTagTotal ¶
GetTagTotal counts the total number of tags based on the constraint
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"` CoverImageUrl string `json:"cover_image_url"` CreatedBy string `json:"created_by"` ModifiedBy string `json:"modified_by"` State int `json:"state"` }
func GetArticle ¶
GetArticle Get a single article based on ID
type Tag ¶
type UserInfo ¶
type UserInfo struct { ID int `gorm:"primary_key" json:"id"` Username string `json:"username"` Nickname string `json:"nickname"` Email string `json:"email"` Organization string `json:"organization"` Activetime string `json:"active_time"` ChatStatus string `json:"chat_status"` CanUsePaid int `json:"can_use_paid"` MaxConvCount int `json:"max_conv_count"` AvailableAskCount int `json:"available_ask_count"` IsSuperuser int `json:"is_superuser"` IsActive int `json:"is_active"` IsVerified int `json:"is_verified"` HashedPassword string `json:"hashed_password"` FunctionList []string `json:"function_list"` }
type UserMessage ¶
type UserMessage struct { ID int `gorm:"primary_key" json:"id"` Username string `json:"username"` Nickname string `json:"nickname"` Email string `json:"email"` Organization string `json:"organization"` Activetime string `json:"active_time"` ChatStatus string `json:"chat_status"` CanUsePaid int `json:"can_use_paid"` MaxConvCount int `json:"max_conv_count"` AvailableAskCount int `json:"available_ask_count"` IsSuperuser int `json:"is_superuser"` IsActive int `json:"is_active"` IsVerified int `json:"is_verified"` HashedPassword string `json:"hashed_password"` FunctionList string `json:"function_list"` }
Click to show internal directories.
Click to hide internal directories.