controller

package
v1.6.6-0...-00ef992 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
}

Controller example

func NewController

func NewController() *Controller

NewController example

func (*Controller) AddAccount

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

AddAccount godoc @Summary Add an 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) Auth

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) DeleteAccount

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

DeleteAccount godoc @Summary Delete an 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) ListAccounts

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

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) ShowAccount

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

ShowAccount godoc @Summary Show an 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

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

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

UpdateAccount godoc @Summary Update an 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

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

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

Message example

Jump to

Keyboard shortcuts

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