Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Example ¶
type Example struct {
ExampleBll controllers.IExample
}
Example - Sample Example entity
func NewExample ¶
func NewExample(bExample controllers.IExample) *Example
NewExample - Create a Example controller
func (*Example) Create ¶
Create - Create data @Tags Example @Summary Create data @Param Authorization header string false "Bearer User Token" @Param body body schema.Example true "Create data" @Success 200 {object} schema.Example @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/example [post]
func (*Example) Delete ¶
Delete - Delete data @Tags Example @Summary Delete data @Param Authorization header string false "Bearer User Token" @Param id path string true "Record ID" @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/example/{id} [delete]
func (*Example) Disable ¶
Disable - Disable data @Tags Example @Summary Disable data @Param Authorization header string false "Bearer User Token" @Param id path string true "Record ID" @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/example/{id}/disable [patch]
func (*Example) Enable ¶
Enable - Enable data @Tags Example @Summary Enable data @Param Authorization header string false "Bearer User Token" @Param id path string true "Record ID" @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/example/{id}/enable [patch]
func (*Example) Get ¶
Get - Query specified data @Tags Example @Summary Query specified data @Param Authorization header string false "Bearer User Token" @Param id path string true "Record ID" @Success 200 {object} schema.Example @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/example/{id} [get]
func (*Example) Query ¶
Query - Query data @Tags Example @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.Example "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/example [get]
func (*Example) Update ¶
Update - Update data @Tags Example @Summary Update data @Param Authorization header string false "Bearer User Token" @Param id path string true "Record ID" @Param body body schema.Example true "Update data" @Success 200 {object} schema.Example @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/example/{id} [put]