swag: github.com/swaggo/swag/example/celler/controller Index | Files

package controller

import "github.com/swaggo/swag/example/celler/controller"

Index

Package Files

accounts.go admin.go bottles.go controller.go examples.go

type Controller Uses

type Controller struct {
}

Controller example

func NewController Uses

func NewController() *Controller

NewController example

func (*Controller) AddAccount Uses

func (c *Controller) AddAccount(ctx *gin.Context)

AddAccount godoc @Summary Add a account @Description add by json account @Tags accounts @Accept json @Produce json @Param account body model.AddAccount true "Add account" @Success 200 {object} model.Account @Failure 400 {object} httputil.HTTPError @Failure 404 {object} httputil.HTTPError @Failure 500 {object} httputil.HTTPError @Router /accounts [post]

func (*Controller) AttributeExample Uses

func (c *Controller) AttributeExample(ctx *gin.Context)

AttributeExample godoc @Summary attribute example @Description attribute @Tags example @Accept json @Produce json @Param enumstring query string false "string enums" Enums(A, B, C) @Param enumint query int false "int enums" Enums(1, 2, 3) @Param enumnumber query number false "int enums" Enums(1.1, 1.2, 1.3) @Param string query string false "string valid" minlength(5) maxlength(10) @Param int query int false "int valid" mininum(1) maxinum(10) @Param default query string false "string default" default(A) @Success 200 {string} string "answer" @Failure 400 {string} string "ok" @Failure 404 {string} string "ok" @Failure 500 {string} string "ok" @Router /examples/attribute [get]

func (*Controller) Auth Uses

func (c *Controller) Auth(ctx *gin.Context)

Auth godoc @Summary Auth admin @Description get admin info @Tags accounts,admin @Accept json @Produce json @Success 200 {object} model.Admin @Failure 400 {object} httputil.HTTPError @Failure 401 {object} httputil.HTTPError @Failure 404 {object} httputil.HTTPError @Failure 500 {object} httputil.HTTPError @Security ApiKeyAuth @Router /admin/auth [post]

func (*Controller) CalcExample Uses

func (c *Controller) CalcExample(ctx *gin.Context)

CalcExample godoc @Summary calc example @Description plus @Tags example @Accept json @Produce json @Param val1 query int true "used for calc" @Param val2 query int true "used for calc" @Success 200 {integer} integer "answer" @Failure 400 {string} string "ok" @Failure 404 {string} string "ok" @Failure 500 {string} string "ok" @Router /examples/calc [get]

func (*Controller) DeleteAccount Uses

func (c *Controller) DeleteAccount(ctx *gin.Context)

DeleteAccount godoc @Summary Update a account @Description Delete by account ID @Tags accounts @Accept json @Produce json @Param id path int true "Account ID" Format(int64) @Success 204 {object} model.Account @Failure 400 {object} httputil.HTTPError @Failure 404 {object} httputil.HTTPError @Failure 500 {object} httputil.HTTPError @Router /accounts/{id} [delete]

func (*Controller) HeaderExample Uses

func (c *Controller) HeaderExample(ctx *gin.Context)

HeaderExample godoc @Summary custome header example @Description custome header @Tags example @Accept json @Produce json @Param Authorization header string true "Authentication header" @Success 200 {string} string "answer" @Failure 400 {string} string "ok" @Failure 404 {string} string "ok" @Failure 500 {string} string "ok" @Router /examples/header [get]

func (*Controller) ListAccounts Uses

func (c *Controller) ListAccounts(ctx *gin.Context)

ListAccounts godoc @Summary List accounts @Description get accounts @Tags accounts @Accept json @Produce json @Param q query string false "name search by q" Format(email) @Success 200 {array} model.Account @Failure 400 {object} httputil.HTTPError @Failure 404 {object} httputil.HTTPError @Failure 500 {object} httputil.HTTPError @Router /accounts [get]

func (*Controller) ListBottles Uses

func (c *Controller) ListBottles(ctx *gin.Context)

ListBottles godoc @Summary List bottles @Description get bottles @Tags bottles @Accept json @Produce json @Success 200 {array} model.Bottle @Failure 400 {object} httputil.HTTPError @Failure 404 {object} httputil.HTTPError @Failure 500 {object} httputil.HTTPError @Router /bottles [get]

func (*Controller) PathParamsExample Uses

func (c *Controller) PathParamsExample(ctx *gin.Context)

PathParamsExample godoc @Summary path params example @Description path params @Tags example @Accept json @Produce json @Param group_id path int true "Group ID" @Param account_id path int true "Account ID" @Success 200 {string} string "answer" @Failure 400 {string} string "ok" @Failure 404 {string} string "ok" @Failure 500 {string} string "ok" @Router /examples/groups/{group_id}/accounts/{account_id} [get]

func (*Controller) PingExample Uses

func (c *Controller) PingExample(ctx *gin.Context)

PingExample godoc @Summary ping example @Description do ping @Tags example @Accept json @Produce json @Success 200 {string} string "pong" @Failure 400 {string} string "ok" @Failure 404 {string} string "ok" @Failure 500 {string} string "ok" @Router /examples/ping [get]

func (*Controller) SecuritiesExample Uses

func (c *Controller) SecuritiesExample(ctx *gin.Context)

SecuritiesExample godoc @Summary custome header example @Description custome header @Tags example @Accept json @Produce json @Param Authorization header string true "Authentication header" @Success 200 {string} string "answer" @Failure 400 {string} string "ok" @Failure 404 {string} string "ok" @Failure 500 {string} string "ok" @Security ApiKeyAuth @Security OAuth2Implicit[admin, write] @Router /examples/securities [get]

func (*Controller) ShowAccount Uses

func (c *Controller) ShowAccount(ctx *gin.Context)

ShowAccount godoc @Summary Show a account @Description get string by ID @Tags accounts @Accept json @Produce json @Param id path int true "Account ID" @Success 200 {object} model.Account @Failure 400 {object} httputil.HTTPError @Failure 404 {object} httputil.HTTPError @Failure 500 {object} httputil.HTTPError @Router /accounts/{id} [get]

func (*Controller) ShowBottle Uses

func (c *Controller) ShowBottle(ctx *gin.Context)

ShowBottle godoc @Summary Show a bottle @Description get string by ID @ID get-string-by-int @Tags bottles @Accept json @Produce json @Param id path int true "Bottle ID" @Success 200 {object} model.Bottle @Failure 400 {object} httputil.HTTPError @Failure 404 {object} httputil.HTTPError @Failure 500 {object} httputil.HTTPError @Router /bottles/{id} [get]

func (*Controller) UpdateAccount Uses

func (c *Controller) UpdateAccount(ctx *gin.Context)

UpdateAccount godoc @Summary Update a account @Description Update by json account @Tags accounts @Accept json @Produce json @Param id path int true "Account ID" @Param account body model.UpdateAccount true "Update account" @Success 200 {object} model.Account @Failure 400 {object} httputil.HTTPError @Failure 404 {object} httputil.HTTPError @Failure 500 {object} httputil.HTTPError @Router /accounts/{id} [patch]

func (*Controller) UploadAccountImage Uses

func (c *Controller) UploadAccountImage(ctx *gin.Context)

UploadAccountImage godoc @Summary Upload account image @Description Upload file @Tags accounts @Accept multipart/form-data @Produce json @Param id path int true "Account ID" @Param file formData file true "account image" @Success 200 {object} controller.Message @Failure 400 {object} httputil.HTTPError @Failure 404 {object} httputil.HTTPError @Failure 500 {object} httputil.HTTPError @Router /accounts/{id}/images [post]

type Message Uses

type Message struct {
    Message string `json:"message" example:"message"`
}

Message example

Package controller imports 7 packages (graph) and is imported by 1 packages. Updated 2019-06-19. Refresh now. Tools for package owners.