mock

package
v7.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DemoSet = wire.NewSet(wire.Struct(new(Demo), "*"))

DemoSet 注入Demo

View Source
var LoginSet = wire.NewSet(wire.Struct(new(Login), "*"))

LoginSet 注入Login

View Source
var MenuSet = wire.NewSet(wire.Struct(new(Menu), "*"))

MenuSet 注入Menu

MockSet 注入mock

View Source
var RoleSet = wire.NewSet(wire.Struct(new(Role), "*"))

RoleSet 注入Role

View Source
var UserSet = wire.NewSet(wire.Struct(new(User), "*"))

UserSet 注入User

Functions

This section is empty.

Types

type Demo

type Demo struct {
}

Demo 示例程序

func (*Demo) Create

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

Create 创建数据 @Tags Demo @Security ApiKeyAuth @Summary 创建数据 @Param body body schema.Demo 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/demos [post]

func (*Demo) Delete

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

Delete 删除数据 @Tags Demo @Security ApiKeyAuth @Summary 删除数据 @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/demos/{id} [delete]

func (*Demo) Disable

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

Disable 禁用数据 @Tags Demo @Security ApiKeyAuth @Summary 禁用数据 @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/demos/{id}/disable [patch]

func (*Demo) Enable

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

Enable 启用数据 @Tags Demo @Security ApiKeyAuth @Summary 启用数据 @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/demos/{id}/enable [patch]

func (*Demo) Get

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

Get 查询指定数据 @Tags Demo @Security ApiKeyAuth @Summary 查询指定数据 @Param id path string true "唯一标识" @Success 200 {object} schema.Demo @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/demos/{id} [get]

func (*Demo) Query

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

Query 查询数据 @Tags Demo @Security ApiKeyAuth @Summary 查询数据 @Param current query int true "分页索引" default(1) @Param pageSize query int true "分页大小" default(10) @Param queryValue query string false "查询值" @Success 200 {object} schema.ListResult{list=[]schema.Demo} "查询结果" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/demos [get]

func (*Demo) Update

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

Update 更新数据 @Tags Demo @Security ApiKeyAuth @Summary 更新数据 @Param id path string true "唯一标识" @Param body body schema.Demo 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/demos/{id} [put]

type Login

type Login struct {
}

Login 登录管理

func (*Login) GetCaptcha

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

GetCaptcha 获取验证码信息 @Tags 登录管理 @Summary 获取验证码信息 @Success 200 {object} schema.LoginCaptcha @Router /api/v1/pub/login/captchaid [get]

func (*Login) GetUserInfo

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

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

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

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

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

Logout 用户登出 @Tags 登录管理 @Summary 用户登出 @Success 200 {object} schema.StatusResult "{status:OK}" @Router /api/v1/pub/login/exit [post]

func (*Login) QueryUserMenuTree

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

QueryUserMenuTree 查询当前用户菜单树 @Tags 登录管理 @Summary 查询当前用户菜单树 @Security ApiKeyAuth @Success 200 {object} schema.ListResult{list=[]schema.MenuTree} "查询结果" @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

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

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

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

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

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

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 struct{}

Menu 菜单管理

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

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 (a *Menu) Delete(c *gin.Context)

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 (a *Menu) Disable(c *gin.Context)

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 (a *Menu) Enable(c *gin.Context)

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 (a *Menu) Get(c *gin.Context)

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 (a *Menu) Query(c *gin.Context)

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 {object} schema.ListResult{list=[]schema.Menu} "查询结果" @Failure 401 {object} schema.ErrorResult "{error:{code:0,message:未授权}}" @Failure 500 {object} schema.ErrorResult "{error:{code:0,message:服务器错误}}" @Router /api/v1/menus [get]

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

QueryTree 查询菜单树 @Tags 菜单管理 @Summary 查询菜单树 @Security ApiKeyAuth @Param status query int false "状态(1:启用 2:禁用)" @Param parentID query string false "父级ID" @Success 200 {object} schema.ListResult{list=[]schema.MenuTree} "查询结果" @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 (a *Menu) Update(c *gin.Context)

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

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

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

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

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

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

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

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

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

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

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

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

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 {object} schema.ListResult{list=[]schema.Role} "查询结果" @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

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

QuerySelect 查询选择数据 @Tags 角色管理 @Summary 查询选择数据 @Security ApiKeyAuth @Param queryValue query string false "查询值" @Param status query int false "状态(1:启用 2:禁用)" @Success 200 {object} schema.ListResult{list=[]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.select [get]

func (*Role) Update

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

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

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

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

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

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

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

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

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

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

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

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

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

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 {object} schema.ListResult{list=[]schema.UserShow} "查询结果" @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

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

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]

Jump to

Keyboard shortcuts

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