1 Star 0 Fork 0

Cruvie Kang/kk_go_kit

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
orm_role.go 571 Bytes
一键复制 编辑 原始数据 按行查看 历史
cruvie 提交于 2024-10-26 00:05 +08:00 . check
package kk_rbac_models
import (
"errors"
"gitee.com/cruvie/kk_go_kit/kk_models"
"github.com/lib/pq"
)
// Role 角色及其拥有的权限
type Role struct {
kk_models.BaseModel
Name string `gorm:"column:name;type:varchar(500);not null;uniqueIndex;comment:'角色名称'"`
ApiIds pq.StringArray `gorm:"column:api_ids;type:varchar(500)[];not null;comment:'拥有的api权限id'"`
}
func (x *Role) TableName() string {
return "kk_rbac_role"
}
func (x *Role) CheckFields() error {
if x.Name == "" {
return errors.New("name is empty")
}
return nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cruvie/kk_go_kit.git
git@gitee.com:cruvie/kk_go_kit.git
cruvie
kk_go_kit
kk_go_kit
v0.1.2

搜索帮助