Documentation
¶
Index ¶
- Variables
- type RoleController
- func (a RoleController) Create(ctx echo.Context) error
- func (a RoleController) Delete(ctx echo.Context) error
- func (a RoleController) Disable(ctx echo.Context) error
- func (a RoleController) Enable(ctx echo.Context) error
- func (a RoleController) Get(ctx echo.Context) error
- func (a RoleController) GetAll(ctx echo.Context) error
- func (a RoleController) Query(ctx echo.Context) error
- func (a RoleController) Update(ctx echo.Context) error
Constants ¶
This section is empty.
Variables ¶
var Module = fx.Options( fx.Provide(NewRoleController), )
Module exported for initializing application
Functions ¶
This section is empty.
Types ¶
type RoleController ¶
type RoleController struct {
// contains filtered or unexported fields
}
func NewRoleController ¶
func NewRoleController( logger lib.Logger, roleService services.RoleService, ) RoleController
NewRoleController creates new role controller
func (RoleController) Create ¶
func (a RoleController) Create(ctx echo.Context) error
@tags Role @summary Role Create @produce application/json @param data body models.Role true "Role" @success 200 {object} echox.Response "ok" @failure 400 {object} echox.Response "bad request" @failure 500 {object} echox.Response "internal error" @router /api/roles [post]
func (RoleController) Delete ¶
func (a RoleController) Delete(ctx echo.Context) error
@tags Role @summary Role Delete By ID @produce application/json @param id path int true "role id" @success 200 {object} echox.Response "ok" @failure 400 {object} echox.Response "bad request" @failure 500 {object} echox.Response "internal error" @router /api/roles/{id} [delete]
func (RoleController) Disable ¶
func (a RoleController) Disable(ctx echo.Context) error
@tags Role @summary Role Disable By ID @produce application/json @param id path int true "role id" @success 200 {object} echox.Response "ok" @failure 400 {object} echox.Response "bad request" @failure 500 {object} echox.Response "internal error" @router /api/roles/{id}/disable [patch]
func (RoleController) Enable ¶
func (a RoleController) Enable(ctx echo.Context) error
@tags Role @summary Role Enable By ID @produce application/json @param id path int true "role id" @success 200 {object} echox.Response "ok" @failure 400 {object} echox.Response "bad request" @failure 500 {object} echox.Response "internal error" @router /api/roles/{id}/enable [patch]
func (RoleController) Get ¶
func (a RoleController) Get(ctx echo.Context) error
@tags Role @summary Role Get By ID @produce application/json @param id path int true "role id" @success 200 {object} echox.Response{data=models.Role} "ok" @failure 400 {object} echox.Response "bad request" @failure 500 {object} echox.Response "internal error" @router /api/roles/{id} [get]
func (RoleController) GetAll ¶
func (a RoleController) GetAll(ctx echo.Context) error
@tags Role @summary Role Get All @produce application/json @param data query models.RoleQueryParam true "RoleQueryParam" @success 200 {object} echox.Response{data=models.Roles} "ok" @failure 400 {object} echox.Response "bad request" @failure 500 {object} echox.Response "internal error" @router /api/roles [get]
func (RoleController) Query ¶
func (a RoleController) Query(ctx echo.Context) error
@tags Role @summary Role Query @produce application/json @param data query models.RoleQueryParam true "RoleQueryParam" @success 200 {object} echox.Response{data=models.RoleQueryResult} "ok" @failure 400 {object} echox.Response "bad request" @failure 500 {object} echox.Response "internal error" @router /api/roles [get]
func (RoleController) Update ¶
func (a RoleController) Update(ctx echo.Context) error
@tags Role @summary Role Update By ID @produce application/json @param id path int true "role id" @param data body models.Role true "Role" @success 200 {object} echox.Response "ok" @failure 400 {object} echox.Response "bad request" @failure 500 {object} echox.Response "internal error" @router /api/roles/{id} [put]