Files
platforms/backend/api/internal/models/platform_role.go

18 lines
939 B
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 models
import "git.apinb.com/bsm-sdk/core/database"
// PlatformRole 对应 platform_role定义平台总后台的数据范围与菜单权限角色。
type PlatformRole struct {
Entity // 公共实体字段
RoleCode string `gorm:"column:role_code;type:varchar(64);not null;uniqueIndex" json:"role_code"` // 角色编码
Name string `gorm:"column:name;type:varchar(64);not null" json:"name"` // 角色名称
DataScope string `gorm:"column:data_scope;type:varchar(32);not null;default:'global'" json:"data_scope"` // 数据权限范围
IsSystem bool `gorm:"column:is_system;not null;default:false" json:"is_system"` // 是否系统内置角色
}
func init() { database.AppendMigrate(&PlatformRole{}) }
// TableName 返回与模型、文件名一致的单数数据表名。
func (table *PlatformRole) TableName() string { return "platform_role" }