Documentation ¶
Index ¶
- func Inject(container *dig.Container) error
- type Demo
- func (a *Demo) Create(c iris.Context)
- func (a *Demo) Delete(c iris.Context)
- func (a *Demo) Disable(c iris.Context)
- func (a *Demo) Enable(c iris.Context)
- func (a *Demo) Get(c iris.Context)
- func (a *Demo) Query(c iris.Context)
- func (a *Demo) QueryPage(c iris.Context)
- func (a *Demo) Update(c iris.Context)
- type Login
- func (a *Login) GetCaptcha(c iris.Context)
- func (a *Login) GetUserInfo(c iris.Context)
- func (a *Login) Login(c iris.Context)
- func (a *Login) Logout(c iris.Context)
- func (a *Login) QueryUserMenuTree(c iris.Context)
- func (a *Login) RefreshToken(c iris.Context)
- func (a *Login) ResCaptcha(c iris.Context)
- func (a *Login) UpdatePassword(c iris.Context)
- type Menu
- type Role
- type User
- func (a *User) Create(c *iris.Context)
- func (a *User) Delete(c *iris.Context)
- func (a *User) Disable(c *iris.Context)
- func (a *User) Enable(c *iris.Context)
- func (a *User) Get(c *iris.Context)
- func (a *User) Query(c *iris.Context)
- func (a *User) QueryPage(c *iris.Context)
- func (a *User) Update(c *iris.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Demo ¶
Demo demo @Name Demo @Description 示例接口
func (*Demo) Create ¶
Create 创建数据 @Summary 创建数据 @Param Authorization header string false "Bearer 用户令牌" @Param body body schema.Demo true @Success 200 schema.Demo @Failure 400 schema.HTTPError "{error:{code:0,message:无效的请求参数}}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router POST /api/v1/demos
func (*Demo) Delete ¶
Delete 删除数据 @Summary 删除数据 @Param Authorization header string false "Bearer 用户令牌" @Param id path string true "记录ID" @Success 200 schema.HTTPStatus "{status:OK}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router DELETE /api/v1/demos/{id}
func (*Demo) Disable ¶
Disable 禁用数据 @Summary 禁用数据 @Param Authorization header string false "Bearer 用户令牌" @Param id path string true "记录ID" @Success 200 schema.HTTPStatus "{status:OK}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router PATCH /api/v1/demos/{id}/disable
func (*Demo) Enable ¶
Enable 启用数据 @Summary 启用数据 @Param Authorization header string false "Bearer 用户令牌" @Param id path string true "记录ID" @Success 200 schema.HTTPStatus "{status:OK}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router PATCH /api/v1/demos/{id}/enable
func (*Demo) Get ¶
Get 查询指定数据 @Summary 查询指定数据 @Param Authorization header string false "Bearer 用户令牌" @Param id path string true "记录ID" @Success 200 schema.Demo @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 404 schema.HTTPError "{error:{code:0,message:资源不存在}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router GET /api/v1/demos/{id}
func (*Demo) QueryPage ¶
QueryPage 查询分页数据 @Summary 查询分页数据 @Param Authorization header string false "Bearer 用户令牌" @Param current query int true "分页索引" 1 @Param pageSize query int true "分页大小" 10 @Param code query string false "编号" @Param name query string false "名称" @Param status query int false "状态(1:启用 2:停用)" @Success 200 []schema.Demo "查询结果:{list:列表数据,pagination:{current:页索引,pageSize:页大小,total:总数量}}" @Failure 400 schema.HTTPError "{error:{code:0,message:未知的查询类型}}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router GET /api/v1/demos?q=page
func (*Demo) Update ¶
Update 更新数据 @Summary 更新数据 @Param Authorization header string false "Bearer 用户令牌" @Param id path string true "记录ID" @Param body body schema.Demo true @Success 200 schema.Demo @Failure 400 schema.HTTPError "{error:{code:0,message:无效的请求参数}}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router PUT /api/v1/demos/{id}
type Login ¶
Login 登录管理 @Name Login @Description 登录管理接口
func (*Login) GetCaptcha ¶
GetCaptcha 获取验证码信息 @Summary 获取验证码信息 @Success 200 schema.LoginCaptcha @Router GET /api/v1/pub/login/captchaid
func (*Login) GetUserInfo ¶
GetUserInfo 获取当前用户信息 @Summary 获取当前用户信息 @Param Authorization header string false "Bearer 用户令牌" @Success 200 schema.UserLoginInfo @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router GET /api/v1/pub/current/user
func (*Login) Login ¶
Login 用户登录 @Summary 用户登录 @Param body body schema.LoginParam true @Success 200 schema.LoginTokenInfo @Failure 400 schema.HTTPError "{error:{code:0,message:无效的请求参数}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router POST /api/v1/pub/login
func (*Login) Logout ¶
Logout 用户登出 @Summary 用户登出 @Success 200 schema.HTTPStatus "{status:OK}" @Router POST /api/v1/pub/login/exit
func (*Login) QueryUserMenuTree ¶
QueryUserMenuTree 查询当前用户菜单树 @Summary 查询当前用户菜单树 @Param Authorization header string false "Bearer 用户令牌" @Success 200 schema.Menu "查询结果:{list:菜单树}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router GET /api/v1/pub/current/menutree
func (*Login) RefreshToken ¶
RefreshToken 刷新令牌 @Summary 刷新令牌 @Param Authorization header string false "Bearer 用户令牌" @Success 200 schema.LoginTokenInfo "{access_token:访问令牌,token_type:令牌类型,expires_in:过期时长(单位秒)}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router POST /api/v1/pub/refresh_token
func (*Login) ResCaptcha ¶
ResCaptcha 响应图形验证码 @Summary 响应图形验证码 @Param id query string true "验证码ID" @Param reload query string false "重新加载" @Success 200 file "图形验证码" @Failure 400 schema.HTTPError "{error:{code:0,message:无效的请求参数}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router GET /api/v1/pub/login/captcha
func (*Login) UpdatePassword ¶
UpdatePassword 更新个人密码 @Summary 更新个人密码 @Param Authorization header string false "Bearer 用户令牌" @Param body body schema.UpdatePasswordParam true @Success 200 schema.HTTPStatus "{status:OK}" @Failure 400 schema.HTTPError "{error:{code:0,message:无效的请求参数}}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router PUT /api/v1/pub/current/password
type Menu ¶
Menu 菜单管理 @Name Menu @Description 菜单管理接口
func (*Menu) Create ¶
Create 创建数据 @Summary 创建数据 @Param Authorization header string false "Bearer 用户令牌" @Param body body schema.Menu true @Success 200 schema.Menu @Failure 400 schema.HTTPError "{error:{code:0,message:无效的请求参数}}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router POST /api/v1/menus
func (*Menu) Delete ¶
Delete 删除数据 @Summary 删除数据 @Param Authorization header string false "Bearer 用户令牌" @Param id path string true "记录ID" @Success 200 schema.HTTPStatus "{status:OK}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router DELETE /api/v1/menus/{id}
func (*Menu) Get ¶
Get 查询指定数据 @Summary 查询指定数据 @Param Authorization header string false "Bearer 用户令牌" @Param id path string true "记录ID" @Success 200 schema.Menu @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 404 schema.HTTPError "{error:{code:0,message:资源不存在}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router GET /api/v1/menus/{id}
func (*Menu) QueryPage ¶
QueryPage 查询分页数据 @Summary 查询分页数据 @Param Authorization header string false "Bearer 用户令牌" @Param current query int true "分页索引" 1 @Param pageSize query int true "分页大小" 10 @Param name query string false "名称" @Param hidden query int false "隐藏菜单(0:不隐藏 1:隐藏)" @Param parent_id query string false "父级ID" @Success 200 []schema.Menu "分页查询结果:{list:列表数据,pagination:{current:页索引,pageSize:页大小,total:总数量}}" @Failure 400 schema.HTTPError "{error:{code:0,message:未知的查询类型}}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router GET /api/v1/menus?q=page
func (*Menu) QueryTree ¶
QueryTree 查询菜单树 @Summary 查询菜单树 @Param Authorization header string false "Bearer 用户令牌" @Param include_actions query int false "是否包含动作数据(1是)" @Param include_resources query int false "是否包含资源数据(1是)" @Success 200 option.Interface "查询结果:{list:菜单树}" @Failure 400 schema.HTTPError "{error:{code:0,message:未知的查询类型}}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router GET /api/v1/menus?q=tree
func (*Menu) Update ¶
Update 更新数据 @Summary 更新数据 @Param Authorization header string false "Bearer 用户令牌" @Param id path string true "记录ID" @Param body body schema.Menu true @Success 200 schema.Menu @Failure 400 schema.HTTPError "{error:{code:0,message:无效的请求参数}}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router PUT /api/v1/menus/{id}
type Role ¶
Role 角色管理 @Name Role @Description 角色管理接口
func (*Role) Create ¶
Create 创建数据 @Summary 创建数据 @Param Authorization header string false "Bearer 用户令牌" @Param body body schema.Role true @Success 200 schema.Role @Failure 400 schema.HTTPError "{error:{code:0,message:无效的请求参数}}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router POST /api/v1/roles
func (*Role) Delete ¶
Delete 删除数据 @Summary 删除数据 @Param Authorization header string false "Bearer 用户令牌" @Param id path string true "记录ID" @Success 200 schema.HTTPStatus "{status:OK}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router DELETE /api/v1/roles/{id}
func (*Role) Get ¶
Get 查询指定数据 @Summary 查询指定数据 @Param Authorization header string false "Bearer 用户令牌" @Param id path string true "记录ID" @Success 200 schema.Role @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 404 schema.HTTPError "{error:{code:0,message:资源不存在}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router GET /api/v1/roles/{id}
func (*Role) QueryPage ¶
QueryPage 查询分页数据 @Summary 查询分页数据 @Param Authorization header string false "Bearer 用户令牌" @Param current query int true "分页索引" 1 @Param pageSize query int true "分页大小" 10 @Param name query string false "角色名称(模糊查询)" @Success 200 []schema.Role "分页查询结果:{list:列表数据,pagination:{current:页索引,pageSize:页大小,total:总数量}}" @Failure 400 schema.HTTPError "{error:{code:0,message:未知的查询类型}}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router GET /api/v1/roles?q=page
func (*Role) QuerySelect ¶
QuerySelect 查询选择数据 @Summary 查询选择数据 @Param Authorization header string false "Bearer 用户令牌" @Success 200 []schema.Role "{list:角色列表}" @Failure 400 schema.HTTPError "{error:{code:0,message:未知的查询类型}}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router GET /api/v1/roles?q=select
func (*Role) Update ¶
Update 更新数据 @Summary 更新数据 @Param Authorization header string false "Bearer 用户令牌" @Param id path string true "记录ID" @Param body body schema.Role true @Success 200 schema.Role @Failure 400 schema.HTTPError "{error:{code:0,message:无效的请求参数}}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router PUT /api/v1/roles/{id}
type User ¶
User 用户管理 @Name User @Description 用户管理接口
func (*User) Create ¶
Create 创建数据 @Summary 创建数据 @Param Authorization header string false "Bearer 用户令牌" @Param body body schema.User true @Success 200 schema.User @Failure 400 schema.HTTPError "{error:{code:0,message:无效的请求参数}}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router POST /api/v1/users
func (*User) Delete ¶
Delete 删除数据 @Summary 删除数据 @Param Authorization header string false "Bearer 用户令牌" @Param id path string true "记录ID" @Success 200 schema.HTTPStatus "{status:OK}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router DELETE /api/v1/users/{id}
func (*User) Disable ¶
Disable 禁用数据 @Summary 禁用数据 @Param Authorization header string false "Bearer 用户令牌" @Param id path string true "记录ID" @Success 200 schema.HTTPStatus "{status:OK}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router PATCH /api/v1/users/{id}/disable
func (*User) Enable ¶
Enable 启用数据 @Summary 启用数据 @Param Authorization header string false "Bearer 用户令牌" @Param id path string true "记录ID" @Success 200 schema.HTTPStatus "{status:OK}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router PATCH /api/v1/users/{id}/enable
func (*User) Get ¶
Get 查询指定数据 Get 查询指定数据 @Summary 查询指定数据 @Param Authorization header string false "Bearer 用户令牌" @Param id path string true "记录ID" @Success 200 schema.User @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 404 schema.HTTPError "{error:{code:0,message:资源不存在}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router GET /api/v1/users/{id}
func (*User) QueryPage ¶
QueryPage 查询分页数据 @Summary 查询分页数据 @Param Authorization header string false "Bearer 用户令牌" @Param current query int true "分页索引" 1 @Param pageSize query int true "分页大小" 10 @Param user_name query string false "用户名(模糊查询)" @Param real_name query string false "真实姓名(模糊查询)" @Param role_ids query string false "角色ID(多个以英文逗号分隔)" @Param status query int false "状态(1:启用 2:停用)" @Success 200 []schema.UserShow "分页查询结果:{list:列表数据,pagination:{current:页索引,pageSize:页大小,total:总数量}}" @Failure 400 schema.HTTPError "{error:{code:0,message:未知的查询类型}}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router GET /api/v1/users?q=page
func (*User) Update ¶
Update 更新数据 @Summary 更新数据 @Param Authorization header string false "Bearer 用户令牌" @Param id path string true "记录ID" @Param body body schema.User true @Success 200 schema.User @Failure 400 schema.HTTPError "{error:{code:0,message:无效的请求参数}}" @Failure 401 schema.HTTPError "{error:{code:0,message:未授权}}" @Failure 500 schema.HTTPError "{error:{code:0,message:服务器错误}}" @Router PUT /api/v1/users/{id}