supports

package
v0.0.0-...-ae94dc8 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2019 License: LGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// key定义
	CODE string = "code"
	MSG  string = "msg"
	DATA string = "data"

	// msg define
	Success                  = "恭喜, 成功"
	OptionSuccess     string = "恭喜, 操作成功"
	OptionFailur      string = "抱歉, 操作失败"
	ParseParamsFailur string = "解析参数失败"

	RegisteSuccess     string = "恭喜, 注册用户成功"
	RegisteFailur      string = "注册失败"
	LoginSuccess       string = "恭喜, 登录成功"
	LoginFailur        string = "登录失败"
	DeleteUsersSuccess string = "删除用户成功"
	DeleteUsersFailur  string = "删除用户错误"

	DeleteRolesSuccess string = "删除角色成功"
	DeleteRolesFailur  string = "删除角色错误"

	UsernameFailur             string = "用户名错误"
	PasswordFailur             string = "密码错误"
	TokenCreateFailur          string = "生成token错误"
	TokenExactFailur           string = "token不存在或header设置不正确"
	TokenExpire                string = "回话已过期"
	TokenParseFailur           string = "token解析错误"
	TokenParseFailurAndEmpty   string = "解析错误,token为空"
	TokenParseFailurAndInvalid string = "解析错误,token无效"
	NotFound                   string = "您请求的url不存在"
	PermissionsLess            string = "权限不足"

	RoleCreateFailur  string = "创建角色失败"
	RoleCreateSuccess string = "创建角色成功"
)

Variables

This section is empty.

Functions

func Error

func Error(ctx iris.Context, status int, msg string, data interface{})

common error define

func Ok

func Ok(ctx iris.Context, msg string, data interface{})

func Ok_

func Ok_(ctx iris.Context, msg string)

200 define

func Unauthorized

func Unauthorized(ctx iris.Context, msg string, data interface{})

401 error define

Types

type GroupDefine

type GroupDefine struct {
	Uid int64    `json:"uid"`
	Sub []string `json:"sub"`
}

用户所属角色组

type Pagination

type Pagination struct {
	PageNumber int //当前看的是第几页
	PageSize   int //每页显示多少条数据

	// 用于分页设置的参数
	Start int
	Limit int

	SortName  string //用于指定的排序
	SortOrder string // desc或asc

	// 时间范围
	StartDate string
	EndDate   string

	Uid int64 // 公用的特殊参数
}

bootstraptable 分页参数

func NewPagination

func NewPagination(ctx iris.Context) (*Pagination, error)

type RoleDefine

type RoleDefine struct {
	// 角色的标识等于casbin的sub,但角色需要加role_前缀
	Sub string `json:"sub"`
	// 对应casbin model的定义
	Obj      string `json:"obj"`
	Act      string `json:"act"`
	Suf      string `json:"suf"`
	RoleName string `json:"roleName"`
}

前端请求的结构体

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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