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: 11 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

Inject - injection ctl

Types

type Login

type Login struct {
	LoginBll controllers.ILogin
}

Login - Manage Login

func NewLogin

func NewLogin(bLogin controllers.ILogin) *Login

NewLogin - Create login manage controller

func (*Login) GetCaptcha

func (a *Login) GetCaptcha(c *gin.Context)

GetCaptcha - Get verification code information @Tags Manage Login @Summary Get verification code information @Success 200 {object} schema.LoginCaptcha @Router /api/v1/pub/login/captchaid [get]

func (*Login) GetUserInfo

func (a *Login) GetUserInfo(c *gin.Context)

GetUserInfo - Get current user information @Tags Manage Login @Summary Get current user information @Param Authorization header string false "Bearer User Token" @Success 200 {object} schema.UserLoginInfo @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/pub/current/user [get]

func (*Login) Login

func (a *Login) Login(c *gin.Context)

Login - User login @Tags Manage Login @Summary User login @Param body body schema.LoginParam true "Request parameter" @Success 200 {object} schema.LoginTokenInfo @Failure 400 {object} schema.HTTPError "{error:{code:0,message: Invalid request parameter}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/pub/login [post]

func (*Login) Logout

func (a *Login) Logout(c *gin.Context)

Logout - User logout @Tags Manage Login @Summary User logout @Success 200 {object} schema.HTTPStatus "{status: OK}" @Router /api/v1/pub/login/exit [post]

func (*Login) QueryUserPermissionTree

func (a *Login) QueryUserPermissionTree(c *gin.Context)

QueryUserPermissionTree - Query current user permission tree @Tags Manage Login @Summary Query current user permission tree @Param Authorization header string false "Bearer User Token" @Success 200 {object} schema.Permission "Search result: {list:Permission tree}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/pub/current/permissiontree [get]

func (*Login) RefreshToken

func (a *Login) RefreshToken(c *gin.Context)

RefreshToken - Refresh token @Tags Manage Login @Summary Refresh token @Param Authorization header string false "Bearer User Token" @Success 200 {object} schema.LoginTokenInfo @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/pub/refresh-token [post]

func (*Login) ResCaptcha

func (a *Login) ResCaptcha(c *gin.Context)

ResCaptcha - Response graphic verification code @Tags Manage Login @Summary Response graphic verification code @Param id query string true "Verification code ID" @Param reload query string false "Reload" @Produce image/png @Success 200 "Captcha" @Failure 400 {object} schema.HTTPError "{error:{code:0,message: Invalid request parameter}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/pub/login/captcha [get]

func (*Login) UpdatePassword

func (a *Login) UpdatePassword(c *gin.Context)

UpdatePassword - Update personal password @Tags Manage Login @Summary Update personal password @Param Authorization header string false "Bearer User Token" @Param body body schema.UpdatePasswordParam true "Request parameter" @Success 200 {object} schema.HTTPStatus "{status:OK}" @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/pub/current/password [put]

type Permission

type Permission struct {
	PermissionBll controllers.IPermission
}

Permission - Manage Permission

func NewPermission

func NewPermission(bPermission controllers.IPermission) *Permission

NewPermission - Create a Permission management controller

func (*Permission) Create

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

Create - Create data @Tags Manage Permission @Summary Create data @Param Authorization header string false "Bearer User Token" @Param body body schema.Permission true "Create data" @Success 200 {object} schema.Permission @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/permissions [post]

func (*Permission) Delete

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

Delete - Delete data @Tags Manage Permission @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/permissions/{id} [delete]

func (*Permission) Get

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

Get - Query specified data @Tags Manage Permission @Summary Query specified data @Param Authorization header string false "Bearer User Token" @Param id path string true "Record ID" @Success 200 {object} schema.Permission @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/permissions/{id} [get]

func (*Permission) Query

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

Query - Query data @Tags Manage Permission @Summary Query data @Param Authorization header string false "Bearer User Token" @Param current query int true "Paging index" default(1) @Param pageSize query int true "Paging Size" default(10) @Param name query string false "Name" @Param hidden query int false "Hide permission (0: don't hide 1: hide)" @Param parentID query string false "Parent ID" @Success 200 {array} schema.Permission "Search result: {list:List data,pagination:{current:Page index,pageSize:Page size,total: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/permissions [get]

func (*Permission) QueryTree

func (a *Permission) QueryTree(c *gin.Context)

QueryTree - Query permission tree @Tags Manage Permission @Summary Query permission tree @Param Authorization header string false "Bearer User Token" @Param includeActions query int false "Whether to include action data (1 is)" @Param includeResources query int false "Whether to include resource data (1 is)" @Success 200 {array} schema.PermissionTree "Search result: {list: List data}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/permissions.tree [get]

func (*Permission) Update

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

Update - Update data @Tags Manage Permission @Summary Update data @Param Authorization header string false "Bearer User Token" @Param id path string true "Record ID" @Param body body schema.Permission true "Update data" @Success 200 {object} schema.Permission @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/permissions/{id} [put]

type Role

type Role struct {
	RoleBll controllers.IRole
}

Role - Manage Role

func NewRole

func NewRole(bRole controllers.IRole) *Role

NewRole - Create Role management controller

func (*Role) Create

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

Create - Create data @Tags Manage Role @Summary Create data @Param Authorization header string false "Bearer User Token" @Param body body schema.Role true "Create data" @Success 200 {object} schema.Role @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/roles [post]

func (*Role) Delete

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

Delete - Delete data @Tags Manage Role @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/roles/{id} [delete]

func (*Role) Get

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

Get - Query specified data @Tags Manage Role @Summary Query specified data @Param Authorization header string false "Bearer User Token" @Param id path string true "Record ID" @Success 200 {object} schema.Role @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/roles/{id} [get]

func (*Role) Query

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

Query - Query data @Tags Manage Role @Summary Query data @Param Authorization header string false "Bearer User Token" @Param current query int true "Paging index" default(1) @Param pageSize query int true "Paging Size" default(10) @Param name query string false "Role name (fuzzy query)" @Success 200 {array} schema.Role "Search result: {list:List data,pagination:{current:Page index,pageSize:Page size,total: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/roles [get]

func (*Role) QuerySelect

func (a *Role) QuerySelect(c *gin.Context)

QuerySelect - Query selection data @Tags Manage Role @Summary Query selection data @Param Authorization header string false "Bearer User Token" @Success 200 {array} schema.Role "Search result: {list: Role list}" @Failure 400 {object} schema.HTTPError "{error:{code:0,message: Unknown query type}}" @Failure 401 {object} schema.HTTPError "{error:{code:0,message: Unauthorized}}" @Failure 500 {object} schema.HTTPError "{error:{code:0,message: Server Error}}" @Router /api/v1/roles.select [get]

func (*Role) Update

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

Update - Update data @Tags Manage Role @Summary Update data @Param Authorization header string false "Bearer User Token" @Param id path string true "Record ID" @Param body body schema.Role true "Update data" @Success 200 {object} schema.Role @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/roles/{id} [put]

type User

type User struct {
	UserBll controllers.IUser
}

User - Manage Users

func NewUser

func NewUser(bUser controllers.IUser) *User

NewUser - Create a User Management Controller

func (*User) Create

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

Create - Create data @Tags Manage Users @Summary Create data @Param Authorization header string false "Bearer User Token" @Param body body schema.User true "Create data" @Success 200 {object} schema.User @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/users [post]

func (*User) Delete

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

Delete - Delete data @Tags Manage Users @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/users/{id} [delete]

func (*User) Disable

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

Disable - Disable data @Tags Manage Users @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/users/{id}/disable [patch]

func (*User) Enable

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

Enable - Enable data @Tags Manage Users @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/users/{id}/enable [patch]

func (*User) Get

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

Get - Query specified data @Tags Manage Users @Summary Query specified data @Param Authorization header string false "Bearer User Token" @Param id path string true "Record ID" @Success 200 {object} schema.User @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/users/{id} [get]

func (*User) Query

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

Query - Query data @Tags Manage Users @Summary Query data @Param Authorization header string false "Bearer User Token" @Param current query int true "Paging index" default(1) @Param pageSize query int true "Paging Size" default(10) @Param userName query string false "Username (fuzzy query)" @Param realName query string false "Real name (fuzzy query)" @Param roleIDs query string false "Role ID (multiple separated by commas)" @Param status query int false "Status (1: Enable 2: Disable)" @Success 200 {array} schema.UserShow "Search result: {list:List data,pagination:{current:Page index,pageSize:Page size,total: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/users [get]

func (*User) Update

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

Update - Update data @Tags Manage Users @Summary Update data @Param Authorization header string false "Bearer User Token" @Param id path string true "Record ID" @Param body body schema.User true "Update data" @Success 200 {object} schema.User @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/users/{id} [put]

Jump to

Keyboard shortcuts

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