Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArticleHandler ¶
type ArticleHandler struct {
// contains filtered or unexported fields
}
func NewArticleHandler ¶
func NewArticleHandler(svc ArticleService) *ArticleHandler
func (*ArticleHandler) HandleCreateArticle ¶
func (h *ArticleHandler) HandleCreateArticle(w http.ResponseWriter, r *http.Request)
HandleCreateArticle godoc @Summary Create an article @Tags articles @Produce json @Param request body request.CreateArticleRequest true "request body" @Success 200 {object} domain.Article @Failure 400 {object} response.ErrResponse @Failure 500 {object} response.ErrResponse @Router /articles [post]
func (*ArticleHandler) HandleGetArticle ¶
func (h *ArticleHandler) HandleGetArticle(w http.ResponseWriter, r *http.Request)
HandleGetArticle godoc @Summary Get an article @Tags articles @Produce json @Param articleID path int true "article ID" @Success 200 {object} domain.Article @Failure 400 {object} response.ErrResponse @Failure 404 {object} response.ErrResponse @Failure 500 {object} response.ErrResponse @Router /articles/{articleID} [get]
func (*ArticleHandler) HandleListArticles ¶
func (h *ArticleHandler) HandleListArticles(w http.ResponseWriter, r *http.Request)
HandleListArticles godoc @Summary List all articles @Tags articles @Produce json @Success 200 {object} []domain.Article @Failure 500 {object} response.ErrResponse @Router /articles [get]