controllers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2019 License: GPL-3.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Inject

func Inject(container *dig.Container) error

Types

type Country

type Country struct {
	CountryBll controllers.ICountry
}

Country - Sample program

func NewCountry

func NewCountry(bCountry controllers.ICountry) *Country

NewCountry - Create a country controller

func (*Country) Create

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

Create - Create data @Tags Country @Summary Create data @Param Authorization header string false "Bearer User Token" @Param body body schema.Country true "Create data" @Success 200 {object} schema.Country @Failure 400 {object} schema.HTTPError "{error:{code:0,message: Invalid request parameter}}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/countries [post]

func (*Country) Delete

func (a *Country) Delete(c *gin.Context)

Delete - Delete data @Tags Country @Summary Delete data @Param Authorization header string false "Bearer User Token" @Param code path string true "code" @Success 200 {object} schema.HTTPStatus "{status:OK}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/countries/{code} [delete]

func (*Country) Get

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

Get - Query specified data @Tags Country @Summary Query specified data @Param Authorization header string false "Bearer User Token" @Param code path string true "code" @Success 200 {object} schema.Country @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 404 {object} schema.HTTPError "{error:{code:0,message: Resource does not exist.}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/countries/{code} [get]

func (*Country) Query

func (a *Country) Query(c *gin.Context)

Query - Query data @Tags Country @Summary Query data @Param Authorization header string false "Bearer User Token" @Param current query int true "Page Index" default(1) @Param pageSize query int true "Paging Size" default(10) @Param code query string false "Numbering" @Param name query string false "Name" @Param status query int false "Status (1: Enable 2: Disable)" @Success 200 {array} schema.Country "Search result: {list:List data,pagination:{current:Page index, pageSize: Page size, total: The total number}}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/countries [get]

func (*Country) Update

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

Update - Update data @Tags Country @Summary Update data @Param Authorization header string false "Bearer User Token" @Param code path string true "code" @Param body body schema.Country true "Update data" @Success 200 {object} schema.Country @Failure 400 {object} schema.HTTPError "{error:{code:0,message: Invalid request parameter}}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/countries/{code} [put]

type Language

type Language struct {
	LanguageBll controllers.ILanguage
}

Language - Sample program

func NewLanguage

func NewLanguage(bLanguage controllers.ILanguage) *Language

NewLanguage - Create a language controller

func (*Language) Create

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

Create - Create data @Tags Language @Summary Create data @Param Authorization header string false "Bearer User Token" @Param body body schema.Language true "Create data" @Success 200 {object} schema.Language @Failure 400 {object} schema.HTTPError "{error:{code:0,message: Invalid request parameter}}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/language [post]

func (*Language) Delete

func (a *Language) Delete(c *gin.Context)

Delete - Delete data @Tags Language @Summary Delete data @Param Authorization header string false "Bearer User Token" @Param code path string true "code" @Success 200 {object} schema.HTTPStatus "{status:OK}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/language/{code} [delete]

func (*Language) Disable

func (a *Language) Disable(c *gin.Context)

Disable - Disable data @Tags Language @Summary Disable data @Param Authorization header string false "Bearer User Token" @Param code path string true "code" @Success 200 {object} schema.HTTPStatus "{status: OK}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/language/{code}/disable [patch]

func (*Language) Enable

func (a *Language) Enable(c *gin.Context)

Enable - Enable data @Tags Language @Summary Enable data @Param Authorization header string false "Bearer User Token" @Param code path string true "code" @Success 200 {object} schema.HTTPStatus "{status:OK}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/language/{code}/enable [patch]

func (*Language) Get

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

Get - Query specified data @Tags Language @Summary Query specified data @Param Authorization header string false "Bearer User Token" @Param code path string true "code" @Success 200 {object} schema.Language @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 404 {object} schema.HTTPError "{error:{code:0,message: Resource does not exist.}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/language/{code} [get]

func (*Language) Query

func (a *Language) Query(c *gin.Context)

Query - Query data @Tags Language @Summary Query data @Param Authorization header string false "Bearer User Token" @Param current query int true "Page Index" default(1) @Param pageSize query int true "Paging Size" default(10) @Param code query string false "Numbering" @Param name query string false "Name" @Param status query int false "Status (1: Enable 2: Disable)" @Success 200 {array} schema.Language "Search result: {list:List data,pagination:{current:Page index, pageSize: Page size, total: The total number}}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/language [get]

func (*Language) Update

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

Update - Update data @Tags Language @Summary Update data @Param Authorization header string false "Bearer User Token" @Param code path string true "code" @Param body body schema.Language true "Update data" @Success 200 {object} schema.Language @Failure 400 {object} schema.HTTPError "{error:{code:0,message: Invalid request parameter}}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/language/{code} [put]

Jump to

Keyboard shortcuts

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