2 Star 0 Fork 0

BOBO/创想视频核心服务

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
rbac.go 2.68 KB
一键复制 编辑 原始数据 按行查看 历史
zhouyp 提交于 2024-07-16 14:51 . init:初始化内框代码
package enums
type (
PermAssocType int
PermDisabled int
PermShow int
PermMenuType int
PermCustomUpdateColumns int
RoleStatus int
DepartStatus int
AdmCustomUpdateColumns int
AdminInviteStatus int
)
const (
PermAssocTypeRoles PermAssocType = iota
PermAssocTypeUser
)
const (
PermDisabledOk PermDisabled = iota
PermDisabledLock
)
const (
PermShowOk PermShow = iota
PermShowHide
)
const (
PermMenuTypeMain PermMenuType = iota
PermMenuTypeSub
PermMenuTypeAction
PermMenuTypeAuth
)
const (
PermUpdateColumnsShow PermCustomUpdateColumns = iota
PermUpdateColumnsDisabled
PermUpdateColumnsSort
)
const (
AdmUpdateColumnsStatus AdmCustomUpdateColumns = iota
AdmUpdateColumnsIsSuper
)
const (
RoleStatusOk RoleStatus = iota
RoleStatusLock
)
const (
DepartStatusOk DepartStatus = iota
DepartStatusDisabled
)
const (
AdminInviteStatusZero AdminInviteStatus = iota
AdminInviteStatusOne
AdminInviteStatusTwo
)
func (t PermAssocType) Fmt() string {
switch t {
case PermAssocTypeRoles:
return `角色关联`
case PermAssocTypeUser:
return `账户关联`
default:
return ``
}
}
func (d PermDisabled) Fmt() string {
switch d {
case PermDisabledOk:
return `正常`
case PermDisabledLock:
return `禁用`
default:
return ``
}
}
func (s PermShow) Fmt() string {
switch s {
case PermShowOk:
return `显示`
case PermShowHide:
return `隐藏`
default:
return ``
}
}
func (t PermMenuType) Fmt() string {
switch t {
case PermMenuTypeMain:
return `主菜单`
case PermMenuTypeSub:
return `子菜单`
case PermMenuTypeAction:
return `页面操作`
case PermMenuTypeAuth:
return `数据授权`
default:
return ``
}
}
func (c PermCustomUpdateColumns) Fmt() string {
switch c {
case PermUpdateColumnsShow:
return `is_show`
case PermUpdateColumnsDisabled:
return `is_disabled`
case PermUpdateColumnsSort:
return `sort`
default:
return ``
}
}
func (c AdmCustomUpdateColumns) Fmt() string {
switch c {
case AdmUpdateColumnsStatus:
return `manage_status`
case AdmUpdateColumnsIsSuper:
return `is_supper_manage`
default:
return ``
}
}
func (s RoleStatus) Fmt() string {
switch s {
case RoleStatusOk:
return `正常`
case RoleStatusLock:
return `锁定`
default:
return ``
}
}
func (s DepartStatus) Fmt() string {
switch s {
case DepartStatusOk:
return `正常`
case DepartStatusDisabled:
return `禁用`
default:
return ``
}
}
func (s AdminInviteStatus) Fmt() string {
switch s {
case AdminInviteStatusZero:
return `邀请中`
case AdminInviteStatusOne:
return `已注册`
case AdminInviteStatusTwo:
return `撤销邀请`
default:
return ``
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/bobo-rs/innovideo-services.git
git@gitee.com:bobo-rs/innovideo-services.git
bobo-rs
innovideo-services
创想视频核心服务
v1.0.16

搜索帮助