Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct{}
func NewArticle ¶
func NewArticle() Article
func (Article) Create ¶
Create godoc @Summary Create article @Produce json @Param tag_id body string true "Tag ID" @Param title body string true "Article Title" @Param desc body string false "Article Description" @Param cover_image_url body string true "Cover Image URL" @Param content body string true "Article Content" @Param created_by body int true "Creator" @Param state body int false "State" @Success 200 {object} model.Article "Success" @Failure 400 {object} errcode.Error "request error" @Failure 500 {object} errcode.Error "internal error" @Router /api/v1/articles [post]
func (Article) Delete ¶
Delete godoc @Summary Delete article @Produce json @Param id path int true "Article ID" @Success 200 {string} string "Success" @Failure 400 {object} errcode.Error "request error" @Failure 500 {object} errcode.Error "internal error" @Router /api/v1/articles/{id} [delete]
func (Article) Get ¶
Get godoc @Summary Get an article @Produce json @Param id path int true "Article ID" @Success 200 {object} model.Article "Success" @Failure 400 {object} errcode.Error "request error" @Failure 500 {object} errcode.Error "internal error" @Router /api/v1/articles/{id} [get]
func (Article) List ¶
List godoc @Summary List articles @Produce json @Param name query string false "Article Name" @Param tag_id query int false "Tag ID" @Param state query int false "State" @Param page query int false "Page" @Param page_size query int false "Page Size" @Success 200 {object} model.ArticleSwagger "Success" @Failure 400 {object} errcode.Error "request error" @Failure 500 {object} errcode.Error "internal error" @Router /api/v1/articles [get]
func (Article) Update ¶
Update godoc @Summary Update article @Produce json @Param tag_id body string false "Tag ID" @Param title body string false "Article Title" @Param desc body string false "Article Description" @Param cover_image_url body string false "Cover Image URL" @Param content body string false "Article Content" @Param modified_by body string true "Modifier" @Success 200 {object} model.Article "Success" @Failure 400 {object} errcode.Error "request error" @Failure 500 {object} errcode.Error "internal error" @Router /api/v1/articles/{id} [put]
type Tag ¶
type Tag struct{}
func (Tag) Create ¶
Create godoc @Summary Create tag @Produce json @Param name body string true "Tag Name" minlength(3) maxlength(100) @Param state body int false "State" Enums(0, 1) default(1) @Param created_by body string false "Creator" minlength(3) maxlength(100) @Success 200 {object} model.Tag "Success" @Failure 400 {object} errcode.Error "request error" @Failure 500 {object} errcode.Error "internal error" @Router /api/v1/tags [post]
func (Tag) Delete ¶
Delete godoc @Summary Delete tag @Produce json @Param id path int true "Tag ID" @Success 200 {string} string "Success" @Failure 400 {object} errcode.Error "request error" @Failure 500 {object} errcode.Error "internal error" @Router /api/v1/tags/{id} [delete]
func (Tag) List ¶
List godoc @Summary List tags @Produce json @Param name query string false "Tag Name" maxlength(100) @Param state query int false "State" Enums(0, 1) default(1) @Param page query int false "Page" @Param page_size query int false "Page Size" @Success 200 {object} model.TagSwagger "Success" @Failure 400 {object} errcode.Error "request error" @Failure 500 {object} errcode.Error "internal error" @Router /api/v1/tags [get]
func (Tag) Update ¶
Update godoc @Summary Update tag @Produce json @Param id path int true "Tag ID" @Param name body string false "Tag Name" minlength(3) maxlength(100) @Param state body int false "State" Enums(0, 1) default(1) @Param modified_by body string true "Modifier" minlength(3) maxlength(100) @Success 200 {array} model.Tag "Success" @Failure 400 {object} errcode.Error "request error" @Failure 500 {object} errcode.Error "internal error" @Router /api/v1/tags/{id} [put]