articleService

package
v0.0.0-...-dffa276 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 25 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Article업로더        = articleUploader()
	ArticleUploader   = articleUploader()
	ArticleCargador   = articleUploader()
	ArticleShàngchuán = articleUploader()
	Articleзагрузчик  = articleUploader()
)

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, int, error)

RetrieveArticle retrieve an article.

func RetrieveArticles

func RetrieveArticles(c *gin.Context) (model.ArticleList, int, error)

RetrieveArticles retrieves articles.

func RetrieveCommentsOnArticle

func RetrieveCommentsOnArticle(c *gin.Context) (model.CommentList, int, error)

RetrieveCommentsOnArticles retrieve comments on an article.

func RetrieveLikingsOnArticles

func RetrieveLikingsOnArticles(c *gin.Context) (model.LikingList, 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.

func UploadAndSyncArticles

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

UploadAndSyncArticles uploads images and sync articles.

Types

type ArticleFilter

type ArticleFilter struct {
	UserId         int   `form:"userId" json:"userId"`
	Categories     []int `form:"categories" json:"categories"`
	CurrentPage    int   `form:"currentPage" json:"currentPage"`
	ArticlePerPage int   `form:"articlePerPage" json:"articlePerPage"`
}

ArticleFilter is a filter for retriving articles.

type ArticleForm

type ArticleForm struct {
	Id            uint   `form:"id"`
	UserId        uint   `form:"userId"`
	CategoryId    int    `form:"categoryId"`
	Title         string `form:"title" binding:"required"`
	Content       string `form:"content"  binding:"required"`
	Url           string `form:"url"`
	ImageName     string `form:"imageName"`
	ThumbnailName string `form:"thumbnailName"`
}

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