Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyRoutes ¶
func ApplyRoutes(r *gin.RouterGroup, jwtAuth jwt.Auth)
ApplyRoutes All routes for articles
func CreateArticle ¶
CreateArticle will generate a command CreateArticleCommand @Summary Create article in elastic search @Tags articles @Accept json @Produce json @Param article body Request true "Add article" @Success 201 {object} pkg.HTTPStatus "created" @Failure 500 {object} pkg.HTTPError "Internal Server Error" @Router /articles [post]
func GetArticle ¶
GetArticle returns article from read-model index from elastic search @Summary Get an article from elastic search @Description Get article struct @Tags articles @Accept json @Produce json @Param aggregate_article_id path int true "Article ID" @Success 200 {object} database.Article @Failure 404 {object} pkg.HTTPError "Article Not found" @Router /articles/{aggregate_article_id} [get]
func GetArticles ¶
GetArticles returns array of article from elastic search @Summary Get all articles from elastic search @Description Get an array of article struct @Tags articles @Accept json @Produce json @Success 200 {string} string "GET /articles" @Router /articles [get]
func UpdateArticle ¶
UpdateArticle will generate a command UpdateArticleCommand @Summary Update article in elastic search @Tags articles @Accept json @Produce json @Param aggregate_article_id path int true "Article ID" @Param article body Request true "Update article" @Success 201 {object} pkg.HTTPStatus "updated" @Failure 500 {object} pkg.HTTPError "Internal Server Error" @Router /articles/{aggregate_article_id}} [put]