v1

package
v0.0.0-...-e972461 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: MIT Imports: 8 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 {
	// contains filtered or unexported fields
}

func NewArticle

func NewArticle(db *gorm.DB, cfg *setting.Configuration) Article

func (*Article) Create

func (art *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} string "成功" @Failure 400 {object} errcode.Error "请求错误" @Failure 500 {object} errcode.Error "内部错误" @Router /api/v1/articles [post].

func (*Article) Delete

func (art *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 (art *Article) Get(c *gin.Context)

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

func (*Article) List

func (art *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} app.ListResponse "成功" @Failure 400 {object} errcode.Error "请求错误" @Failure 500 {object} errcode.Error "内部错误" @Router /api/v1/articles [get].

func (*Article) Update

func (art *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} app.MapResponse "成功" @Failure 400 {object} errcode.Error "请求错误" @Failure 500 {object} errcode.Error "内部错误" @Router /api/v1/articles/{id} [put].

type Tag

type Tag struct {
	// contains filtered or unexported fields
}

func NewTag

func NewTag(db *gorm.DB, cfg *setting.Configuration) Tag

func (*Tag) Create

func (tag *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} app.MapResponse "成功" @Failure 400 {object} errcode.Error "请求错误" @Failure 500 {object} errcode.Error "内部错误" @Router /api/v1/tags [post].

func (*Tag) Delete

func (tag *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 (tag *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} app.ListResponse "成功" @Failure 400 {object} errcode.Error "请求错误" @Failure 500 {object} errcode.Error "内部错误" @Router /api/v1/tags [get].

func (*Tag) Update

func (tag *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} app.MapResponse "成功" @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