Documentation ¶
Index ¶
- func CreateArticle(c *gin.Context) (model.Article, int, error)
- func CreateArticles(c *gin.Context) (int, error)
- func CreateCommentOnArticle(c *gin.Context) (int, error)
- func CreateLikingOnArticle(c *gin.Context) (int, error)
- func DeleteArticle(c *gin.Context) (int, error)
- func DeleteCommentOnArticle(c *gin.Context) (int, error)
- func DeleteLikingOnArticle(c *gin.Context) (int, error)
- func RetrieveArticle(c *gin.Context) (model.Article, bool, int64, int, error)
- func RetrieveArticles(c *gin.Context) ([]model.Article, bool, int, int, bool, bool, int, error)
- func RetrieveCommentsOnArticle(c *gin.Context) ([]model.Comment, int, bool, bool, int, int, error)
- func RetrieveLikingsOnArticles(c *gin.Context) ([]*model.PublicUser, int, bool, bool, int, int, error)
- func UpdateArticle(c *gin.Context) (model.Article, int, error)
- func UpdateArticleCommentCount(article *model.Article) (int, error)
- func UpdateArticleLikingCount(article *model.Article) (int, error)
- func UpdateCommentOnArticle(c *gin.Context) (int, error)
- type ArticleFilter
- type ArticleForm
- type ArticlesForm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateArticle ¶
CreateArticle creates an article.
func CreateArticles ¶
CreateArticles creates articles.
func CreateCommentOnArticle ¶
CreateCommentOnArticle creates a comment to an article.
func CreateLikingOnArticle ¶
CreateLikingOnArticle creates a liking on article.
func DeleteArticle ¶
DeleteArticle deletes an article.
func DeleteCommentOnArticle ¶
DeleteCommentOnArticle deletes a comment from an article.
func DeleteLikingOnArticle ¶
DeleteLikingOnArticle deletes liking on article.
func RetrieveArticle ¶
RetrieveArticle retrieve an article.
func RetrieveArticles ¶
RetrieveArticles retrieves articles.
func RetrieveCommentsOnArticle ¶
RetrieveCommentsOnArticles retrieve comments on an article.
func RetrieveLikingsOnArticles ¶
func RetrieveLikingsOnArticles(c *gin.Context) ([]*model.PublicUser, int, bool, bool, int, int, error)
RetrieveLikingsOnArticles retrieves likings on article.
func UpdateArticle ¶
UpdateArticle updates an article.
func UpdateArticleCommentCount ¶
UpdateArticleCommentCount updates article's comment count.
func UpdateArticleLikingCount ¶
UpdateArticleLikingCount updates a liking count on article.
Types ¶
type ArticleFilter ¶
type ArticleFilter struct { UserId int `json:"userId"` Categories []int `json:"categories"` CurrentPage int `json:"currentPage"` ArticlePerPage int `json:"articlePerPage"` }
ArticleFilter is a filter for retriving articles.
type ArticleForm ¶
type ArticleForm struct { Id int64 `form:"id"` UserId int64 `form:"userId"` CategoryId int `form:"categoryId"` Title string `form:"title"` Url string `form:"url" binding:"required"` ImageName string `form:"imageName" binding:"required"` ThumbnailName string `form:"thumbnailName"` Content string `form:"content"` }
ArticleForm is a form of article.
type ArticlesForm ¶
type ArticlesForm struct {
Articles []ArticleForm `form:"json" binding:"required"`
}
ArticlesForm is used when creating or updating multiple Articles.