ctl

package
v0.0.0-...-831d175 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Inject

func Inject(container *dig.Container) error

Inject 注入ctl 使用方式:

container := dig.New()
Inject(container)
container.Invoke(func(foo *ctl.Demo) {
})

Types

type Demo

type Demo struct {
	DemoBll bll.IDemo
}

Demo demo @Name Demo @Description 示例接口

func NewDemo

func NewDemo(bDemo bll.IDemo) *Demo

NewDemo 创建demo控制器

func (*Demo) Create

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

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

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

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

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

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

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

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

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

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) Query

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

Query 查询数据

func (*Demo) QueryPage

func (a *Demo) QueryPage(c iris.Context)

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

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

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

type Login struct {
	LoginBll bll.ILogin
}

Login 登录管理 @Name Login @Description 登录管理接口

func NewLogin

func NewLogin(bLogin bll.ILogin) *Login

NewLogin 创建登录管理控制器

func (*Login) GetCaptcha

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

GetCaptcha 获取验证码信息 @Summary 获取验证码信息 @Success 200 schema.LoginCaptcha @Router GET /api/v1/pub/login/captchaid

func (*Login) GetUserInfo

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

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

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

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

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

Logout 用户登出 @Summary 用户登出 @Success 200 schema.HTTPStatus "{status:OK}" @Router POST /api/v1/pub/login/exit

func (*Login) QueryUserMenuTree

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

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

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

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

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

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

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

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 struct {
	MenuBll bll.IMenu
}

Menu 菜单管理 @Name Menu @Description 菜单管理接口

func NewMenu

func NewMenu(bMenu bll.IMenu) *Menu

NewMenu 创建菜单管理控制器

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

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

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

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

Query 查询数据

func (a *Menu) QueryPage(c iris.Context)

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

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

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

type Role struct {
	RoleBll bll.IRole
}

Role 角色管理 @Name Role @Description 角色管理接口

func NewRole

func NewRole(bRole bll.IRole) *Role

NewRole 创建角色管理控制器

func (*Role) Create

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

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

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

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

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

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) Query

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

Query 查询数据

func (*Role) QueryPage

func (a *Role) QueryPage(c iris.Context)

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

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

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

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

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

type User struct {
	UserBll bll.IUser
}

User 用户管理 @Name User @Description 用户管理接口

func NewUser

func NewUser(bUser bll.IUser) *User

NewUser 创建用户管理控制器

func (*User) Create

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

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

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

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

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

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

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

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

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

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) Query

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

Query 查询数据

func (*User) QueryPage

func (a *User) QueryPage(c *iris.Context)

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

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

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}

Jump to

Keyboard shortcuts

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