{"modulePath":"github.com/GoProjectGroupForEducation/Go-Blog","version":"v0.0.0-20190118092757-cc686c7a0d74","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package models\n\n## Functions\n\n```go\nfunc CreateArticle(article Article) int\n```\n\n```go\nfunc CreateComment(comment *Comment) int\n```\n\n```go\nfunc CreateTag(tag string)\n```\n\n```go\nfunc CreateUser(user User) int\n```\n\n```go\nfunc Follow(userid int, followerid int) bool\n```\n\n```go\nfunc Unfollow(userid int, followerid int) bool\n```\n\n```go\nfunc UpdateArticleByID(article Article) bool\n```\n\n```go\nfunc UpdateCommentByID(comment Comment) bool\n```\n\n```go\nfunc UpdateUserByID(id int, user User) bool\n```\n\n```go\nfunc UpdateUserIconByID(id int, iconPath string) bool\n```\n\n## Types\n\n```go\ntype Article struct {\n\tID        int       `json:\"id, omitempty\"`\n\tAuthor    int       `json:\"author_id\"`\n\tTitle     string    `json:\"title\"`\n\tTags      []Tag     `json:\"tags\"`\n\tContent   string    `json:\"content\"`\n\tCreatedAt time.Time `json:\"created_at\"`\n\tUpdatedAt time.Time `json:\"updated_at\"`\n}\n```\n\n```go\ntype ArticleList struct {\n\tID        int           `json:\"id\"`\n\tAuthor    UserList      `json:\"author\"`\n\tAuthorId  int           `json:\"author_id\"`\n\tContent   string        `json:\"content\"`\n\tComments  []CommentList `json:\"comments\"`\n\tTitle     string        `json:\"title\"`\n\tTags      []Tag         `json:\"tags\"`\n\tUpdatedAt time.Time     `json:\"updated_at\"`\n}\n```\n\n```go\nfunc GetAllArticles() []ArticleList\n```\n\n```go\nfunc GetArticleByID(id int) *ArticleList\n```\n\n```go\nfunc GetArticleByUserID(id int) []ArticleList\n```\n\n```go\nfunc GetArticlesByTag(tag string) []ArticleList\n```\n\n```go\ntype ArticlePage struct {\n\tNumber   int           `json: \"number\"`\n\tArticles []ArticleList `json: \"articles\"`\n}\n```\n\n```go\nfunc GetArticlesPerPage(pageNum int) ArticlePage\n```\n\n```go\ntype Comment struct {\n\tID        int       `json:\"id\"`\n\tContent   string    `json:\"content\"`\n\tCreatedAt time.Time `json:\"created_at\"`\n\tArticleID int       `json:\"article_id\"`\n\tCreatorID int       `json:\"creator_id\"`\n}\n```\n\n```go\ntype CommentList struct {\n\tID        int       `json:\"id\"`\n\tContent   string    `json:\"content\"`\n\tCreatedAt time.Time `json:\"created_at\"`\n\tArticleID int       `json:\"article_id\"`\n\tCreator   UserList  `json:\"creator\"`\n\tCreatorID int       `json:\"creator_id\"`\n}\n```\n\n```go\nfunc GetAllCommentsByArticleID(articleID int) []CommentList\n```\n\n```go\ntype Tag struct {\n\tContent string `json: \"content\"`\n}\n```\n\n```go\nfunc GetAllTags() []Tag\n```\n\n```go\ntype User struct {\n\tUserID    int    `json:\"id, omitempty\"`\n\tUsername  string `json:\"username\"`\n\tPassword  string `json:\"password\"`\n\tEmail     string `json:\"email\"`\n\tFollowers []int  `json:\"followers,[]\"`\n\tFollowing []int  `json:\"following,[]\"`\n\tIconpath  string `json:\"iconpath\"`\n}\n```\n\n```go\nfunc GetUserByID(id int) *User\n```\n\n```go\nfunc GetUserByUsername(username string) *User\n```\n\n```go\ntype UserDetail struct {\n\tUserID    int           `json:\"id\"`\n\tUsername  string        `json:\"username\"`\n\tEmail     string        `json:\"email\"`\n\tFollowers []int         `json:\"followers\"`\n\tFollowing []int         `json:\"following\"`\n\tArticles  []ArticleList `json:\"articles\"`\n\tIconpath  string        `json:\"iconpath\"`\n}\n```\n\n```go\nfunc GetUserDetailByID(id int) *UserDetail\n```\n\n```go\ntype UserList struct {\n\tUserID    int    `json:\"id\"`\n\tUsername  string `json:\"username\"`\n\tEmail     string `json:\"email\"`\n\tFollowers []int  `json:\"followers\"`\n\tFollowing []int  `json:\"following\"`\n\tIconpath  string `json:\"iconpath\"`\n}\n```\n\n```go\nfunc GetUserFollowers(id int) []UserList\n```\n\n```go\nfunc GetUserFollowing(id int) []UserList\n```\n\n```go\nfunc GetUserListByID(id int) *UserList\n```\n\n","path":"github.com/GoProjectGroupForEducation/Go-Blog/models","name":"models","synopsis":"","isRedistributable":true}
