v1

package
v0.0.0-...-5fb2406 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: MIT Imports: 6 Imported by: 0

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

func (a Article) Create(c *gin.Context)

@Summary 创建文章 @Produce json @Param tag_id body string true "标签ID" @Param title body string true "文章标题" @Param desc body string false "文章简述" @Param cover_image_url body string true "封面图片地址" @Param content body string true "文章内容" @Param created_by body int true "创建者" @Param state body int false "状态" @Success 200 {object} model.Article "成功" @Failure 400 {object} errcode.Error "请求错误" @Failure 500 {object} errcode.Error "内部错误" @Router /api/v1/articles [post]

func (Article) Delete

func (a Article) Delete(c *gin.Context)

@Summary 删除文章 @Produce json @Param id path int true "文章ID" @Success 200 {string} string "成功" @Failure 400 {object} errcode.Error "请求错误" @Failure 500 {object} errcode.Error "内部错误" @Router /api/v1/articles/{id} [delete]

func (Article) Get

func (a Article) Get(c *gin.Context)

@Summary 获取单个文章 @Produce json @Param id path int true "文章ID" @Success 200 {object} model.Article "成功" @Failure 400 {object} errcode.Error "请求错误" @Failure 500 {object} errcode.Error "内部错误" @Router /api/v1/articles/{id} [get]

func (Article) List

func (a Article) List(c *gin.Context)

@Summary 获取多个文章 @Produce json @Param name query string false "文章名称" @Param tag_id query int false "标签ID" @Param state query int false "状态" @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 /api/v1/articles [get]

func (Article) Update

func (a Article) Update(c *gin.Context)

@Summary 更新文章 @Produce json @Param tag_id body string false "标签ID" @Param title body string false "文章标题" @Param desc body string false "文章简述" @Param cover_image_url body string false "封面图片地址" @Param content body string false "文章内容" @Param modified_by body string true "修改者" @Success 200 {object} model.Article "成功" @Failure 400 {object} errcode.Error "请求错误" @Failure 500 {object} errcode.Error "内部错误" @Router /api/v1/articles/{id} [put]

type Tag

type Tag struct{}

func NewTag

func NewTag() Tag

func (Tag) Create

func (t Tag) Create(c *gin.Context)

@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 /api/v1/tags [post]

func (Tag) Delete

func (t Tag) Delete(c *gin.Context)

@Summary 删除标签 @Produce json @Param id path int true "标签ID" @Success 200 {string} string "成功" @Failure 400 {object} errcode.Error "请求错误" @Failure 500 {object} errcode.Error "内部错误" @Router /api/v1/tags/{id} [delete]

func (Tag) List

func (t Tag) List(c *gin.Context)

@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 /api/v1/tags [get]

func (Tag) Update

func (t Tag) Update(c *gin.Context)

@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 /api/v1/tags/{id} [put]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL