Documentation ¶
Index ¶
- Variables
- type Demo
- type Login
- func (a *Login) GetCaptcha(c *gin.Context)
- func (a *Login) GetUserInfo(c *gin.Context)
- func (a *Login) Login(c *gin.Context)
- func (a *Login) Logout(c *gin.Context)
- func (a *Login) QueryUserMenuTree(c *gin.Context)
- func (a *Login) RefreshToken(c *gin.Context)
- func (a *Login) ResCaptcha(c *gin.Context)
- func (a *Login) UpdatePassword(c *gin.Context)
- type Menu
- func (a *Menu) Create(c *gin.Context)
- func (a *Menu) Delete(c *gin.Context)
- func (a *Menu) Disable(c *gin.Context)
- func (a *Menu) Enable(c *gin.Context)
- func (a *Menu) Get(c *gin.Context)
- func (a *Menu) Query(c *gin.Context)
- func (a *Menu) QueryTree(c *gin.Context)
- func (a *Menu) Update(c *gin.Context)
- type Role
- func (a *Role) Create(c *gin.Context)
- func (a *Role) Delete(c *gin.Context)
- func (a *Role) Disable(c *gin.Context)
- func (a *Role) Enable(c *gin.Context)
- func (a *Role) Get(c *gin.Context)
- func (a *Role) Query(c *gin.Context)
- func (a *Role) QuerySelect(c *gin.Context)
- func (a *Role) Update(c *gin.Context)
- type User
Constants ¶
This section is empty.
Variables ¶
DemoSet Depedency Injection
LoginSet 注入Login
MenuSet 注入Menu
MockSet 注入mock
RoleSet 注入Role
UserSet 注入User
Functions ¶
This section is empty.
Types ¶
type Demo ¶
type Demo struct { }
Demo Sample program
func (*Demo) Create ¶
Create Create new demo data @Tags Demo @Security ApiKeyAuth @Summary Create new demo data @Param body body schema.Demo true "Create new data" @Success 200 {object} schema.IDResult @Failure 400 {object} schema.ErrorResult "{error:{code:0,message:Invalid request parameter}}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:Unauthorized}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:Server Error}}" @Router /api/v1/demos [post]
func (*Demo) Delete ¶
Delete Delete demo data @Tags Demo @Security ApiKeyAuth @Summary deleting demo data @Param id path string true "uuid" @Success 200 {object} schema.StatusResult "{status:OK}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:Unauthorized}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:Server Error}}" @Router /api/v1/demos/{id} [delete]
func (*Demo) Disable ¶
Disable Disable data status @Tags Demo @Security ApiKeyAuth @Summary Disable demo data @Param id path string true "uuid" @Success 200 {object} schema.StatusResult "{status:OK}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:Unauthorized}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:Server Error}}" @Router /api/v1/demos/{id}/disable [patch]
func (*Demo) Enable ¶
Enable Enable data status @Tags Demo @Security ApiKeyAuth @Summary enable demo data @Param id path string true "uuid" @Success 200 {object} schema.StatusResult "{status:OK}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:Unauthorized}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:Server Error}}" @Router /api/v1/demos/{id}/enable [patch]
func (*Demo) Get ¶
Get Get demo data by id @Tags Demo @Security ApiKeyAuth @Summary Get demo data by id @Param id path string true "uuid" @Success 200 {object} schema.Demo @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:Unauthorized}}" @Failure 404 {object} schema.ErrorResult "{error:{code:0,message:Resource does not exists}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:Server Error}}" @Router /api/v1/demos/{id} [get]
func (*Demo) Query ¶
Query Get all demo data @Tags Demo @Security ApiKeyAuth @Summary Get all demo data @Param current query int true "Pagination index" default(1) @Param pageSize query int true "Paging size" default(10) @Param queryValue query string false "Query Value" @Success 200 {array} schema.Demo "Result:{list:List of data,pagination:{current:Page index,pageSize:page size,total:total data}}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:Unauthorized}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:Server Error}}" @Router /api/v1/demos [get]
func (*Demo) Update ¶
Update update demo data @Tags Demo @Security ApiKeyAuth @Summary updating demo data @Param id path string true "uuid" @Param body body schema.Demo true "update data" @Success 200 {object} schema.StatusResult "{status:OK}" @Failure 400 {object} schema.ErrorResult "{error:{code:0,message:Invalid request parameter}}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:Unauthorized}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:Server Error}}" @Router /api/v1/demos/{id} [put]
type Login ¶
type Login struct { }
Login 登录管理
func (*Login) GetCaptcha ¶
GetCaptcha 获取验证码信息 @Tags 登录管理 @Summary 获取验证码信息 @Success 200 {object} schema.LoginCaptcha @Router /api/v1/pub/login/captchaid [get]
func (*Login) GetUserInfo ¶
GetUserInfo 获取当前用户信息 @Tags 登录管理 @Summary 获取当前用户信息 @Security ApiKeyAuth @Success 200 {object} schema.UserLoginInfo @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/pub/current/user [get]
func (*Login) Login ¶
Login 用户登录 @Tags 登录管理 @Summary 用户登录 @Param body body schema.LoginParam true "请求参数" @Success 200 {object} schema.LoginTokenInfo @Failure 400 {object} schema.ErrorResult "{error:{code:0,message:无效的请求参数}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/pub/login [post]
func (*Login) Logout ¶
Logout 用户登出 @Tags 登录管理 @Summary 用户登出 @Success 200 {object} schema.StatusResult "{status:OK}" @Router /api/v1/pub/login/exit [post]
func (*Login) QueryUserMenuTree ¶
QueryUserMenuTree 查询当前用户菜单树 @Tags 登录管理 @Summary 查询当前用户菜单树 @Security ApiKeyAuth @Success 200 {object} schema.Menu "查询结果:{list:菜单树}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/pub/current/menutree [get]
func (*Login) RefreshToken ¶
RefreshToken 刷新令牌 @Tags 登录管理 @Summary 刷新令牌 @Security ApiKeyAuth @Success 200 {object} schema.LoginTokenInfo @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/pub/refresh-token [post]
func (*Login) ResCaptcha ¶
ResCaptcha 响应图形验证码 @Tags 登录管理 @Summary 响应图形验证码 @Param id query string true "验证码ID" @Param reload query string false "重新加载" @Produce image/png @Success 200 "图形验证码" @Failure 400 {object} schema.ErrorResult "{error:{code:0,message:无效的请求参数}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/pub/login/captcha [get]
func (*Login) UpdatePassword ¶
UpdatePassword 更新个人密码 @Tags 登录管理 @Summary 更新个人密码 @Security ApiKeyAuth @Param body body schema.UpdatePasswordParam true "请求参数" @Success 200 {object} schema.StatusResult "{status:OK}" @Failure 400 {object} schema.ErrorResult "{error:{code:0,message:无效的请求参数}}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/pub/current/password [put]
type Menu ¶
type Menu struct{}
Menu 菜单管理
func (*Menu) Create ¶
Create 创建数据 @Tags 菜单管理 @Summary 创建数据 @Security ApiKeyAuth @Param body body schema.Menu true "创建数据" @Success 200 {object} schema.IDResult @Failure 400 {object} schema.ErrorResult "{error:{code:0,message:无效的请求参数}}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/menus [post]
func (*Menu) Delete ¶
Delete 删除数据 @Tags 菜单管理 @Summary 删除数据 @Security ApiKeyAuth @Param id path string true "唯一标识" @Success 200 {object} schema.StatusResult "{status:OK}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/menus/{id} [delete]
func (*Menu) Disable ¶
Disable 禁用数据 @Tags 菜单管理 @Summary 禁用数据 @Security ApiKeyAuth @Param id path string true "唯一标识" @Success 200 {object} schema.StatusResult "{status:OK}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/menus/{id}/disable [patch]
func (*Menu) Enable ¶
Enable 启用数据 @Tags 菜单管理 @Summary 启用数据 @Security ApiKeyAuth @Param id path string true "唯一标识" @Success 200 {object} schema.StatusResult "{status:OK}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/menus/{id}/enable [patch]
func (*Menu) Get ¶
Get 查询指定数据 @Tags 菜单管理 @Summary 查询指定数据 @Security ApiKeyAuth @Param id path string true "唯一标识" @Success 200 {object} schema.Menu @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 404 {object} schema.ErrorResult "{error:{code:0,message:资源不存在}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/menus/{id} [get]
func (*Menu) Query ¶
Query 查询数据 @Tags 菜单管理 @Summary 查询数据 @Security ApiKeyAuth @Param current query int true "分页索引" default(1) @Param pageSize query int true "分页大小" default(10) @Param queryValue query string false "查询值" @Param status query int false "状态(1:启用 2:禁用)" @Param showStatus query int false "显示状态(1:显示 2:隐藏)" @Param parentID query string false "父级ID" @Success 200 {array} schema.Menu "查询结果:{list:列表数据,pagination:{current:页索引,pageSize:页大小,total:总数量}}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/menus [get]
func (*Menu) QueryTree ¶
QueryTree 查询菜单树 @Tags 菜单管理 @Summary 查询菜单树 @Security ApiKeyAuth @Param status query int false "状态(1:启用 2:禁用)" @Param parentID query string false "父级ID" @Success 200 {array} schema.MenuTree "查询结果:{list:列表数据}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/menus.tree [get]
func (*Menu) Update ¶
Update 更新数据 @Tags 菜单管理 @Summary 更新数据 @Security ApiKeyAuth @Param id path string true "唯一标识" @Param body body schema.Menu true "更新数据" @Success 200 {object} schema.StatusResult "{status:OK}" @Failure 400 {object} schema.ErrorResult "{error:{code:0,message:无效的请求参数}}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/menus/{id} [put]
type Role ¶
type Role struct { }
Role 角色管理
func (*Role) Create ¶
Create 创建数据 @Tags 角色管理 @Summary 创建数据 @Security ApiKeyAuth @Param body body schema.Role true "创建数据" @Success 200 {object} schema.IDResult @Failure 400 {object} schema.ErrorResult "{error:{code:0,message:无效的请求参数}}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/roles [post]
func (*Role) Delete ¶
Delete 删除数据 @Tags 角色管理 @Summary 删除数据 @Security ApiKeyAuth @Param id path string true "唯一标识" @Success 200 {object} schema.StatusResult "{status:OK}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/roles/{id} [delete]
func (*Role) Disable ¶
Disable 禁用数据 @Tags 角色管理 @Summary 禁用数据 @Security ApiKeyAuth @Param id path string true "唯一标识" @Success 200 {object} schema.StatusResult "{status:OK}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/roles/{id}/disable [patch]
func (*Role) Enable ¶
Enable 启用数据 @Tags 角色管理 @Summary 启用数据 @Security ApiKeyAuth @Param id path string true "唯一标识" @Success 200 {object} schema.StatusResult "{status:OK}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/roles/{id}/enable [patch]
func (*Role) Get ¶
Get 查询指定数据 @Tags 角色管理 @Summary 查询指定数据 @Security ApiKeyAuth @Param id path string true "唯一标识" @Success 200 {object} schema.Role @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 404 {object} schema.ErrorResult "{error:{code:0,message:资源不存在}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/roles/{id} [get]
func (*Role) Query ¶
Query 查询数据 @Tags 角色管理 @Summary 查询数据 @Security ApiKeyAuth @Param current query int true "分页索引" default(1) @Param pageSize query int true "分页大小" default(10) @Param queryValue query string false "查询值" @Param status query int false "状态(1:启用 2:禁用)" @Success 200 {array} schema.Role "查询结果:{list:列表数据,pagination:{current:页索引,pageSize:页大小,total:总数量}}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/roles [get]
func (*Role) QuerySelect ¶
QuerySelect 查询选择数据 @Tags 角色管理 @Summary 查询选择数据 @Security ApiKeyAuth @Param queryValue query string false "查询值" @Param status query int false "状态(1:启用 2:禁用)" @Success 200 {array} schema.Role "查询结果:{list:角色列表}" @Failure 400 {object} schema.ErrorResult "{error:{code:0,message:未知的查询类型}}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/roles.select [get]
func (*Role) Update ¶
Update 更新数据 @Tags 角色管理 @Summary 更新数据 @Security ApiKeyAuth @Param id path string true "唯一标识" @Param body body schema.Role true "更新数据" @Success 200 {object} schema.Role @Failure 400 {object} schema.ErrorResult "{error:{code:0,message:无效的请求参数}}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/roles/{id} [put]
type User ¶
type User struct { }
User 用户管理
func (*User) Create ¶
Create 创建数据 @Tags 用户管理 @Summary 创建数据 @Security ApiKeyAuth @Param body body schema.User true "创建数据" @Success 200 {object} schema.IDResult @Failure 400 {object} schema.ErrorResult "{error:{code:0,message:无效的请求参数}}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/users [post]
func (*User) Delete ¶
Delete 删除数据 @Tags 用户管理 @Summary 删除数据 @Security ApiKeyAuth @Param id path string true "唯一标识" @Success 200 {object} schema.StatusResult "{status:OK}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/users/{id} [delete]
func (*User) Disable ¶
Disable 禁用数据 @Tags 用户管理 @Summary 禁用数据 @Security ApiKeyAuth @Param id path string true "唯一标识" @Success 200 {object} schema.StatusResult "{status:OK}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/users/{id}/disable [patch]
func (*User) Enable ¶
Enable 启用数据 @Tags 用户管理 @Summary 启用数据 @Security ApiKeyAuth @Param id path string true "唯一标识" @Success 200 {object} schema.StatusResult "{status:OK}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/users/{id}/enable [patch]
func (*User) Get ¶
Get 查询指定数据 Get 查询指定数据 @Tags 用户管理 @Summary 查询指定数据 @Security ApiKeyAuth @Param id path string true "唯一标识" @Success 200 {object} schema.User @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 404 {object} schema.ErrorResult "{error:{code:0,message:资源不存在}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/users/{id} [get]
func (*User) Query ¶
Query 查询数据 @Tags 用户管理 @Summary 查询数据 @Security ApiKeyAuth @Param current query int true "分页索引" default(1) @Param pageSize query int true "分页大小" default(10) @Param queryValue query string false "查询值" @Param roleIDs query string false "角色ID(多个以英文逗号分隔)" @Param status query int false "状态(1:启用 2:停用)" @Success 200 {array} schema.UserShow "查询结果:{list:列表数据,pagination:{current:页索引,pageSize:页大小,total:总数量}}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/users [get]
func (*User) Update ¶
Update 更新数据 @Tags 用户管理 @Summary 更新数据 @Security ApiKeyAuth @Param id path string true "唯一标识" @Param body body schema.User true "更新数据" @Success 200 {object} schema.User @Failure 400 {object} schema.ErrorResult "{error:{code:0,message:无效的请求参数}}" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/users/{id} [put]