api

package
v10.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Login

type Login struct {
	LoginBIZ *biz.Login
}

func (*Login) GetCaptcha

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

@Tags LoginAPI @Summary Get captcha ID @Success 200 {object} util.ResponseResult{data=schema.Captcha} @Router /api/v1/captcha/id [get]

func (*Login) GetUserInfo

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

@Tags LoginAPI @Security ApiKeyAuth @Summary Get current user info @Success 200 {object} util.ResponseResult{data=schema.User} @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/current/user [get]

func (*Login) Login

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

@Tags LoginAPI @Summary Login system with username and password @Param body body schema.LoginForm true "Request body" @Success 200 {object} util.ResponseResult{data=schema.LoginToken} @Failure 400 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/login [post]

func (*Login) Logout

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

@Tags LoginAPI @Security ApiKeyAuth @Summary Logout system @Success 200 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/current/logout [post]

func (*Login) QueryMenus

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

@Tags LoginAPI @Security ApiKeyAuth @Summary Query current user menus based on the current user role @Success 200 {object} util.ResponseResult{data=[]schema.Menu} @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/current/menus [get]

func (*Login) RefreshToken

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

@Tags LoginAPI @Security ApiKeyAuth @Summary Refresh current access token @Success 200 {object} util.ResponseResult{data=schema.LoginToken} @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/current/refresh-token [post]

func (*Login) ResponseCaptcha

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

@Tags LoginAPI @Summary Response captcha image @Param id query string true "Captcha ID" @Param reload query number false "Reload captcha image (reload=1)" @Produce image/png @Success 200 "Captcha image" @Failure 404 {object} util.ResponseResult @Router /api/v1/captcha/image [get]

func (*Login) UpdatePassword

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

@Tags LoginAPI @Security ApiKeyAuth @Summary Change current user password @Param body body schema.UpdateLoginPassword true "Request body" @Success 200 {object} util.ResponseResult @Failure 400 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/current/password [put]

func (*Login) UpdateUser

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

@Tags LoginAPI @Security ApiKeyAuth @Summary Update current user info @Param body body schema.UpdateCurrentUser true "Request body" @Success 200 {object} util.ResponseResult @Failure 400 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/current/user [put]

type Menu struct {
	MenuBIZ *biz.Menu
}

Menu management for RBAC

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

@Tags MenuAPI @Security ApiKeyAuth @Summary Create menu record @Param body body schema.MenuForm true "Request body" @Success 200 {object} util.ResponseResult{data=schema.Menu} @Failure 400 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/menus [post]

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

@Tags MenuAPI @Security ApiKeyAuth @Summary Delete menu record by ID @Param id path string true "unique id" @Success 200 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/menus/{id} [delete]

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

@Tags MenuAPI @Security ApiKeyAuth @Summary Get menu record by ID @Param id path string true "unique id" @Success 200 {object} util.ResponseResult{data=schema.Menu} @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/menus/{id} [get]

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

@Tags MenuAPI @Security ApiKeyAuth @Summary Query menu tree data @Param code query string false "Code path of menu (like xxx.xxx.xxx)" @Param name query string false "Name of menu" @Param includeResources query bool false "Whether to include menu resources" @Success 200 {object} util.ResponseResult{data=[]schema.Menu} @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/menus [get]

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

@Tags MenuAPI @Security ApiKeyAuth @Summary Update menu record by ID @Param id path string true "unique id" @Param body body schema.MenuForm true "Request body" @Success 200 {object} util.ResponseResult @Failure 400 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/menus/{id} [put]

type Role

type Role struct {
	RoleBIZ *biz.Role
}

Role management for RBAC

func (*Role) Create

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

@Tags RoleAPI @Security ApiKeyAuth @Summary Create role record @Param body body schema.RoleForm true "Request body" @Success 200 {object} util.ResponseResult{data=schema.Role} @Failure 400 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/roles [post]

func (*Role) Delete

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

@Tags RoleAPI @Security ApiKeyAuth @Summary Delete role record by ID @Param id path string true "unique id" @Success 200 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/roles/{id} [delete]

func (*Role) Get

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

@Tags RoleAPI @Security ApiKeyAuth @Summary Get role record by ID @Param id path string true "unique id" @Success 200 {object} util.ResponseResult{data=schema.Role} @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/roles/{id} [get]

func (*Role) Query

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

@Tags RoleAPI @Security ApiKeyAuth @Summary Query role list @Param current query int true "pagination index" default(1) @Param pageSize query int true "pagination size" default(10) @Param name query string false "Display name of role" @Param status query string false "Status of role (disabled, enabled)" @Success 200 {object} util.ResponseResult{data=[]schema.Role} @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/roles [get]

func (*Role) Update

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

@Tags RoleAPI @Security ApiKeyAuth @Summary Update role record by ID @Param id path string true "unique id" @Param body body schema.RoleForm true "Request body" @Success 200 {object} util.ResponseResult @Failure 400 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/roles/{id} [put]

type User

type User struct {
	UserBIZ *biz.User
}

User management for RBAC

func (*User) Create

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

@Tags UserAPI @Security ApiKeyAuth @Summary Create user record @Param body body schema.UserForm true "Request body" @Success 200 {object} util.ResponseResult{data=schema.User} @Failure 400 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/users [post]

func (*User) Delete

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

@Tags UserAPI @Security ApiKeyAuth @Summary Delete user record by ID @Param id path string true "unique id" @Success 200 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/users/{id} [delete]

func (*User) Get

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

@Tags UserAPI @Security ApiKeyAuth @Summary Get user record by ID @Param id path string true "unique id" @Success 200 {object} util.ResponseResult{data=schema.User} @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/users/{id} [get]

func (*User) Query

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

@Tags UserAPI @Security ApiKeyAuth @Summary Query user list @Param current query int true "pagination index" default(1) @Param pageSize query int true "pagination size" default(10) @Param username query string false "Username for login" @Param name query string false "Name of user" @Param status query string false "Status of user (activated, freezed)" @Success 200 {object} util.ResponseResult{data=[]schema.User} @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/users [get]

func (*User) ResetPassword

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

@Tags UserAPI @Security ApiKeyAuth @Summary Reset user password by ID @Param id path string true "unique id" @Success 200 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/users/{id}/reset-pwd [patch]

func (*User) Update

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

@Tags UserAPI @Security ApiKeyAuth @Summary Update user record by ID @Param id path string true "unique id" @Param body body schema.UserForm true "Request body" @Success 200 {object} util.ResponseResult @Failure 400 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/users/{id} [put]

Jump to

Keyboard shortcuts

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