Files
PandaX/apps/system/entity/role.go
2023-09-15 15:13:39 +08:00

41 lines
1.6 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package entity
import (
"github.com/PandaXGO/PandaKit/casbin"
"github.com/PandaXGO/PandaKit/model"
)
const (
SELFDATASCOPE = "0"
ALLDATASCOPE = "1"
DIYDATASCOPE = "2"
ORGDATASCOPE = "3"
ORGALLDATASCOPE = "4"
)
type SysRole struct {
model.BaseModel
RoleId int64 `json:"roleId" gorm:"primary_key;AUTO_INCREMENT"`
RoleName string `json:"roleName" gorm:"type:varchar(128);comment:角色名称"`
Status string `json:"status" gorm:"type:varchar(1);comment:状态"`
RoleKey string `json:"roleKey" gorm:"type:varchar(128);comment:角色代码"`
RoleSort int64 `json:"roleSort" gorm:"type:int;comment:角色排序"`
DataScope string `json:"dataScope" gorm:"type:varchar(1);comment:数据范围0: 本人数据 1全部数据权限 2自定数据权限 3本组织数据权限 4本组织及以下数据权限"`
CreateBy string `json:"createBy" gorm:"type:varchar(128);comment:创建人"`
UpdateBy string `json:"updateBy" gorm:"type:varchar(128);comment:修改人"`
Remark string `json:"remark" gorm:"type:varchar(255);comment:备注"`
ApiIds []casbin.CasbinRule `json:"apiIds" gorm:"-"`
MenuIds []int64 `json:"menuIds" gorm:"-"`
OrganizationIds []int64 `json:"organizationIds" gorm:"-"`
Org string `json:"org" gorm:"column:org"`
}
type MenuIdList struct {
MenuId int64 `json:"menuId"`
}
type OrganizationIdList struct {
OrganizationId int64 `json:"organizationId"`
}