v1

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

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

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

@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

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 /articles/{id} [delete]

func (*Article) Get

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

@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

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

@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

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

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

func (*Tag) Get

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

@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

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

Jump to

Keyboard shortcuts

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