Documentation ¶
Index ¶
Constants ¶
View Source
const ( ERROR = 7 SUCCESS = 0 )
Variables ¶
View Source
var ( // Admin ErrorUserNoExist = errors.New(`用户不存在! err: record not found`) ErrorAdminDelete = errors.New(`用户名为admin, 不允许删除`) ErrorWrongPassword = errors.New(`密码错误`) ErrorEncryptedPassword = errors.New(`密码加密失败`) ErrorUsernameRegistered = errors.New(`用户名已注册`) // Jwt ErrorJwt2Redis = errors.New(`设置登录状态失败`) ErrorCreateToken = errors.New(`创建token失败`) ErrorInvalidateJwt = errors.New(`jwt作废失败`) // Authority ErrorUseAuthority = errors.New(`此角色有用户正在使用禁止删除`) ErrorHasSonAuthority = errors.New(`此角色存在子角色不允许删除`) ErrorSameAuthorityId = errors.New("已存在相同的角色id") // Dictionary ErrorSameType = errors.New("已存在数据,不允许创建") // Api ErrorSameApi = errors.New("已存在记录") // JsonWebToken TokenExpired = errors.New(`无法处理这个令牌! `) TokenInvalid = errors.New(`令牌已过期! `) TokenMalformed = errors.New(`这不是一个有效的令牌! `) TokenNotValidYet = errors.New(`令牌尚未激活! `) // Menu ErrorUpdateMenu = errors.New(`更新失败`) ErrorUpdateMenuName = errors.New(`存在相同name, 修改失败`) ErrorHasChildrenMenu = errors.New(`此菜单存在子菜单不可删除`) ErrorCreateParameters = errors.New(`创建menu的Parameters失败`) // Casbin ErrorAddPolicies = errors.New(`存在相同api, 添加失败, 请联系管理员`) )
View Source
var Message = map[Code]string{
ServerBusy: "服务器忙ing...",
SuccessStart: "成功码开始!",
SuccessAdd: "添加成功!",
SuccessFirst: "获取一条数据成功!",
SuccessCreated: "创建成功!",
SuccessUpdated: "更新成功!",
SuccessDeleted: "删除成功!",
SuccessGetList: "获取列表数据成功!",
SuccessOperation: "操作成功!",
SuccessBatchDeleted: "批量删除成功!",
SuccessAdminLogin: "登录成功!",
SuccessSetAuthority: "设置角色成功!",
SuccessSetAdminInfo: "更新用户信息成功!",
SuccessAdminRegister: "注册成功!",
SuccessChangePassword: "修改密码成功!",
SuccessCaptcha: "验证码获取成功!",
SuccessCopyAuthority: "复制角色成功!",
SuccessCreateAuthority: "创建角色成功!",
SuccessSetDataAuthority: "创建角色成功!",
SuccessJwtBlackList: "jwt作废成功!",
SuccessEnd: "成功码结束!",
ErrorStart: "失败码开始!",
ErrorAdd: "添加失败!",
ErrorFirst: "获取一条数据失败!",
ErrorCreated: "创建失败!",
ErrorUpdated: "更新失败!",
ErrorDeleted: "删除失败!",
ErrorGetList: "获取列表数据失败!",
ErrorOperation: "操作失败!",
ErrorBatchDeleted: "批量删除失败!",
ErrorAdminLogin: "登录失败!",
ErrorSetAuthority: "设置角色失败!",
ErrorSetAdminInfo: "更新用户信息失败!",
ErrorAdminRegister: "注册失败!",
ErrorChangePassword: "修改密码失败!",
ErrorCaptcha: "验证码获取失败!",
ErrorCopyAuthority: "复制角色失败!",
ErrorCreateAuthority: "创建角色失败!",
ErrorSetDataAuthority: "设置失败失败!",
ErrorJwtBlackList: "jwt作废失败!",
ErrorEnd: "失败码结束!",
AdminNotFind: "管理员用户不存在!",
}
Functions ¶
This section is empty.
Types ¶
type Code ¶
type Code int
const ( // 基础码 ServerBusy Code = iota // 成功 SuccessStart SuccessAdd SuccessFirst SuccessCreated SuccessDeleted SuccessUpdated SuccessGetList SuccessOperation SuccessBatchDeleted // admin SuccessAdminLogin SuccessSetAuthority SuccessSetAdminInfo SuccessAdminRegister SuccessChangePassword // captcha SuccessCaptcha // Authority SuccessCopyAuthority SuccessCreateAuthority SuccessSetDataAuthority // JwtBlackList SuccessJwtBlackList // BreakpointContinue SuccessFind SuccessFinish SuccessCreateChunk SuccessRemoveChunk // Uploader SuccessCheckFileMd5 SuccessMergeFileMd5 SuccessEnd //失败 ErrorStart ErrorAdd ErrorFirst ErrorCreated ErrorUpdated ErrorDeleted ErrorGetList ErrorOperation ErrorBatchDeleted // admin ErrorAdminLogin ErrorSetAuthority ErrorSetAdminInfo ErrorAdminRegister ErrorChangePassword // captcha ErrorCaptcha // Authority ErrorCopyAuthority ErrorCreateAuthority ErrorSetDataAuthority // JwtBlackList ErrorJwtBlackList // BreakpointContinue ErrorFind ErrorFinish ErrorFormFile ErrorCreateChunk ErrorRemoveChunk // Uploader ErrorCheckFileMd5 ErrorMergeFileMd5 ErrorEnd // 自定义码 AdminNotFind )
func (Code) Message ¶
@author: [SliverHorn](https://github.com/SliverHorn) @description: code 对应 massage
type PageResult ¶
type PolicyPath ¶
type PolicyPath struct {
Paths []request.CasbinInfo `json:"paths"`
}
Click to show internal directories.
Click to hide internal directories.