articleService

package
v0.0.0-...-b754639 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2015 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateArticle

func CreateArticle(c *gin.Context) (model.Article, int, error)

CreateArticle creates an article.

func CreateArticles

func CreateArticles(c *gin.Context) (int, error)

CreateArticles creates articles.

func CreateCommentOnArticle

func CreateCommentOnArticle(c *gin.Context) (int, error)

CreateCommentOnArticle creates a comment to an article.

func CreateLikingOnArticle

func CreateLikingOnArticle(c *gin.Context) (int, error)

CreateLikingOnArticle creates a liking on article.

func DeleteArticle

func DeleteArticle(c *gin.Context) (int, error)

DeleteArticle deletes an article.

func DeleteCommentOnArticle

func DeleteCommentOnArticle(c *gin.Context) (int, error)

DeleteCommentOnArticle deletes a comment from an article.

func DeleteLikingOnArticle

func DeleteLikingOnArticle(c *gin.Context) (int, error)

DeleteLikingOnArticle deletes liking on article.

func RetrieveArticle

func RetrieveArticle(c *gin.Context) (model.Article, bool, int64, int, error)

RetrieveArticle retrieve an article.

func RetrieveArticles

func RetrieveArticles(c *gin.Context) ([]model.Article, bool, int, int, bool, bool, int, error)

RetrieveArticles retrieves articles.

func RetrieveCommentsOnArticle

func RetrieveCommentsOnArticle(c *gin.Context) ([]model.Comment, int, bool, bool, int, int, error)

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

func UpdateArticle(c *gin.Context) (model.Article, int, error)

UpdateArticle updates an article.

func UpdateArticleCommentCount

func UpdateArticleCommentCount(article *model.Article) (int, error)

UpdateArticleCommentCount updates article's comment count.

func UpdateArticleLikingCount

func UpdateArticleLikingCount(article *model.Article) (int, error)

UpdateArticleLikingCount updates a liking count on article.

func UpdateCommentOnArticle

func UpdateCommentOnArticle(c *gin.Context) (int, error)

UpdateCommentOnArticle updates a comment on an 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL