Back to godoc.org

Package v1

v0.0.0-...-6396397
Latest Go to latest

The highest tagged major version is .

Published: May 5, 2020 | License: MIT | Module: github.com/EDDYCJY/go-gin-example

Index

Constants

const (
	QRCODE_URL = "https://github.com/EDDYCJY/blog#gin%E7%B3%BB%E5%88%97%E7%9B%AE%E5%BD%95"
)

func AddArticle

func AddArticle(c *gin.Context)

@Summary Add article @Produce json @Param tag_id body int true "TagID" @Param title body string true "Title" @Param desc body string true "Desc" @Param content body string true "Content" @Param created_by body string true "CreatedBy" @Param state body int true "State" @Success 200 {object} app.Response @Failure 500 {object} app.Response @Router /api/v1/articles [post]

func AddTag

func AddTag(c *gin.Context)

@Summary Add article tag @Produce json @Param name body string true "Name" @Param state body int false "State" @Param created_by body int false "CreatedBy" @Success 200 {object} app.Response @Failure 500 {object} app.Response @Router /api/v1/tags [post]

func DeleteArticle

func DeleteArticle(c *gin.Context)

@Summary Delete article @Produce json @Param id path int true "ID" @Success 200 {object} app.Response @Failure 500 {object} app.Response @Router /api/v1/articles/{id} [delete]

func DeleteTag

func DeleteTag(c *gin.Context)

@Summary Delete article tag @Produce json @Param id path int true "ID" @Success 200 {object} app.Response @Failure 500 {object} app.Response @Router /api/v1/tags/{id} [delete]

func EditArticle

func EditArticle(c *gin.Context)

@Summary Update article @Produce json @Param id path int true "ID" @Param tag_id body string false "TagID" @Param title body string false "Title" @Param desc body string false "Desc" @Param content body string false "Content" @Param modified_by body string true "ModifiedBy" @Param state body int false "State" @Success 200 {object} app.Response @Failure 500 {object} app.Response @Router /api/v1/articles/{id} [put]

func EditTag

func EditTag(c *gin.Context)

@Summary Update article tag @Produce json @Param id path int true "ID" @Param name body string true "Name" @Param state body int false "State" @Param modified_by body string true "ModifiedBy" @Success 200 {object} app.Response @Failure 500 {object} app.Response @Router /api/v1/tags/{id} [put]

func ExportTag

func ExportTag(c *gin.Context)

@Summary Export article tag @Produce json @Param name body string false "Name" @Param state body int false "State" @Success 200 {object} app.Response @Failure 500 {object} app.Response @Router /api/v1/tags/export [post]

func GenerateArticlePoster

func GenerateArticlePoster(c *gin.Context)

func GetArticle

func GetArticle(c *gin.Context)

@Summary Get a single article @Produce json @Param id path int true "ID" @Success 200 {object} app.Response @Failure 500 {object} app.Response @Router /api/v1/articles/{id} [get]

func GetArticles

func GetArticles(c *gin.Context)

@Summary Get multiple articles @Produce json @Param tag_id body int false "TagID" @Param state body int false "State" @Param created_by body int false "CreatedBy" @Success 200 {object} app.Response @Failure 500 {object} app.Response @Router /api/v1/articles [get]

func GetTags

func GetTags(c *gin.Context)

@Summary Get multiple article tags @Produce json @Param name query string false "Name" @Param state query int false "State" @Success 200 {object} app.Response @Failure 500 {object} app.Response @Router /api/v1/tags [get]

func ImportTag

func ImportTag(c *gin.Context)

@Summary Import article tag @Produce json @Param file body file true "Excel File" @Success 200 {object} app.Response @Failure 500 {object} app.Response @Router /api/v1/tags/import [post]

type AddArticleForm

type AddArticleForm struct {
	TagID         int    `form:"tag_id" valid:"Required;Min(1)"`
	Title         string `form:"title" valid:"Required;MaxSize(100)"`
	Desc          string `form:"desc" valid:"Required;MaxSize(255)"`
	Content       string `form:"content" valid:"Required;MaxSize(65535)"`
	CreatedBy     string `form:"created_by" valid:"Required;MaxSize(100)"`
	CoverImageUrl string `form:"cover_image_url" valid:"Required;MaxSize(255)"`
	State         int    `form:"state" valid:"Range(0,1)"`
}

type AddTagForm

type AddTagForm struct {
	Name      string `form:"name" valid:"Required;MaxSize(100)"`
	CreatedBy string `form:"created_by" valid:"Required;MaxSize(100)"`
	State     int    `form:"state" valid:"Range(0,1)"`
}

type EditArticleForm

type EditArticleForm struct {
	ID            int    `form:"id" valid:"Required;Min(1)"`
	TagID         int    `form:"tag_id" valid:"Required;Min(1)"`
	Title         string `form:"title" valid:"Required;MaxSize(100)"`
	Desc          string `form:"desc" valid:"Required;MaxSize(255)"`
	Content       string `form:"content" valid:"Required;MaxSize(65535)"`
	ModifiedBy    string `form:"modified_by" valid:"Required;MaxSize(100)"`
	CoverImageUrl string `form:"cover_image_url" valid:"Required;MaxSize(255)"`
	State         int    `form:"state" valid:"Range(0,1)"`
}

type EditTagForm

type EditTagForm struct {
	ID         int    `form:"id" valid:"Required;Min(1)"`
	Name       string `form:"name" valid:"Required;MaxSize(100)"`
	ModifiedBy string `form:"modified_by" valid:"Required;MaxSize(100)"`
	State      int    `form:"state" valid:"Range(0,1)"`
}

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier