Documentation
¶
Overview ¶
Description: Author: Michael Cheung Github: https://github.com/gzmichaelcheung Date: 2020-07-29 16:09:12 LastEditors: Michael Cheung LastEditTime: 2020-09-10 15:20:30
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 ¶
@Summary 新增文章 @Produce json @Param title body string true "文章标题" minlength(3) maxlength(100) @Param description body string true "文章描述" minlength(3) maxlength(100) @Param content body string true "文章内容" @Param state body int false "状态" Enums(0, 1) default(1) @Param created_by body string false "创建者" minlength(3) maxlength(100) @Success 200 {object} model.Tag "成功" @Failure 400 {object} errcode.Error "请求错误" @Failure 500 {object} errcode.Error "内部错误" @Router /articles [post]
func (*Article) Delete ¶
@Summary 删除文章 @Produce json @Param id path int true "文章ID" @Success 200 {string} string "成功" @Failure 400 {object} errcode.Error "请求错误" @Failure 500 {object} errcode.Error "内部错误" @Router /articles/{id} [delete]
func (*Article) Get ¶
@Summary 获取单个文章 @Product json @Param id path int true "文章ID" @Param title query string false "文章标题" maxlength(100) @Param state query int false "状态" Enums(0, 1) default(1) @Success 200 {object} model.Article "成功" @Failure 400 {object} errcode.Error "请求错误" @Failure 500 {object} errcode.Error "内部错误" @Router /articles/{id} [get]
func (*Article) List ¶
@Summary 获取多个文章 @Produce json @Param title query string false "文章标题" maxlength(100) @Param state query int false "状态" Enums(0, 1) default(1) @Param page query int false "页码" @Param page_size query int false "每页数量" @Success 200 {object} model.ArticleSwagger "成功" @Failure 400 {object} errcode.Error "请求错误" @Failure 500 {object} errcode.Error "内部错误" @Router /articles [get]
func (*Article) Update ¶
@Summary 更新文章 @Produce json @Param id path int true "文章ID" @Param title body string false "文章标题"" minlength(3) maxlength(100) @Param description body string true "文章描述" minlength(3) maxlength(100) @Param content body string true "文章内容" @Param state body int false "状态" Enums(0, 1) default(1) @Param modified_by body string true "修改者" minlength(3) maxlength(100) @Success 200 {array} model.Tag "成功" @Failure 400 {object} errcode.Error "请求错误" @Failure 500 {object} errcode.Error "内部错误" @Router /articles/{id} [put]
type Tag ¶
type Tag struct { }
func (*Tag) Create ¶
@Summary 新增标签 @Produce json @Param name body string true "标签名称" minlength(3) maxlength(100) @Param state body int false "状态" Enums(0, 1) default(1) @Param created_by body string false "创建者" minlength(3) maxlength(100) @Success 200 {object} model.Tag "成功" @Failure 400 {object} errcode.Error "请求错误" @Failure 500 {object} errcode.Error "内部错误" @Router /tags [post]
func (*Tag) Delete ¶
@Summary 删除标签 @Produce json @Param id path int true "标签ID" @Success 200 {string} string "成功" @Failure 400 {object} errcode.Error "请求错误" @Failure 500 {object} errcode.Error "内部错误" @Router /tags/{id} [delete]
func (*Tag) Get ¶
@Summary 获取单个标签 @Product json @Param id path int true "标签ID" @Param name query string false "标签名称" maxlength(100) @Param state query int false "状态" Enums(0, 1) default(1) @Success 200 {object} model.Tag "成功" @Failure 400 {object} errcode.Error "请求错误" @Failure 500 {object} errcode.Error "内部错误" @Router /tags/{id} [get]
func (*Tag) List ¶
@Summary 获取多个标签 @Produce json @Param name query string false "标签名称" maxlength(100) @Param state query int false "状态" Enums(0, 1) default(1) @Param page query int false "页码" @Param page_size query int false "每页数量" @Success 200 {object} model.TagSwagger "成功" @Failure 400 {object} errcode.Error "请求错误" @Failure 500 {object} errcode.Error "内部错误" @Router /tags [get]
func (*Tag) Update ¶
@Summary 更新标签 @Produce json @Param id path int true "标签ID" @Param name body string false "标签名称" minlength(3) maxlength(100) @Param state body int false "状态" Enums(0, 1) default(1) @Param modified_by body string true "修改者" minlength(3) maxlength(100) @Success 200 {array} model.Tag "成功" @Failure 400 {object} errcode.Error "请求错误" @Failure 500 {object} errcode.Error "内部错误" @Router /tags/{id} [put]