Documentation ¶
Index ¶
- Variables
- func Archive(tag string, t string) (map[string][]Post, int)
- func DeletePost(idList []string) bool
- func GetAllPostId() []string
- func GetSettings() map[string]string
- func InsertPost(article_form ArticleForm, uid int64) (int64, error)
- func SetAdmin() (string, error)
- func UpdateCommentCount(id int, count int) int64
- func UpdatePost(aid int, article_form ArticleForm) error
- type ArticleForm
- type Category
- type Friends
- type Post
- type Setting
- type Tag
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var UserNotBindSecretError = errors.New("user not bind error")
View Source
var UserSecretNotMatchError = errors.New("user secret not match error")
Functions ¶
func UpdatePost ¶
func UpdatePost(aid int, article_form ArticleForm) error
Types ¶
type ArticleForm ¶
type ArticleForm struct { Title string `json:"title" form:"title" binding:"required"` CategoryId string `json:"category_id" form:"category" binding:"required,gt=0"` Content string `json:"content" form:"content"` PublishedAt string `json:"published_at" form:"published_at"` Summary string `json:"abstract" form:"abstract"` Tags []string `json:"tags" form:"tags[]"` Status string `json:"status" form:"status"` }
type Category ¶
type Category struct { Id int `json:"id" form:"id"` Name string `json:"name" form:"name"` Description string `json:"description" form:"name"` EnName string `json:"en_name" form:"en_name"` PostCount int `json:"post_count"` }
栏目
type Friends ¶
type Post ¶
type Post struct { Id int `json:"id" form:"id"` Title string `json:"title" form:"title"` Content string `json:"content" form:"content"` ContentHtml template.HTML Status int `json:"status" form:"status"` AuthorId int `json:"author_id" form:"author_id"` CatId int `json:"cat_id" form:"cat_id"` PublishedAt time.Time `json:"published_at" form:"published_at"` CreatedAt time.Time `json:"created_at" form:"created_at"` UpdatedAt time.Time `json:"updated_at" form:"updated_at"` Abstract string `json:"abstract" form:"abstract"` CommentCount uint64 `json:"comments_count" form:"comments_count"` TagImg string `json:"tag_img" form:"tag_img"` TagName sql.NullString `json:"tag_name"` CName string `json:"name" form:"name"` CEnName string `json:"en_name" form:"en_name"` Tags []Tag `json:"tag"` }
文章
type Tag ¶
type User ¶
type User struct { Id int `json:"id"` Nickname string `json:"nickname"` Username string `json:"username"` Secret string `json:"secret"` BindSecret int `json:"bind_secret"` Email string `json:"email"` Password string `json:"password"` RememberToken string `json:"remember_token"` CreatedAt time.Time `json:"created_at"` LastLoginAt time.Time `json:"last_login_at"` LastLoginIp int `json:"last_login_ip"` }
Click to show internal directories.
Click to hide internal directories.