package model import ( "gorm.io/gorm" ) // Role 角色模型 type Role struct { gorm.Model BaseModel `gorm:"embedded"` RoleName string `gorm:"column:role_name;not null;size:50;comment:角色名称" json:"role_name"` RoleDesc string `gorm:"column:role_desc;size:255;comment:角色描述" json:"role_desc"` RoleType int `gorm:"column:role_type;not null;index;comment:角色类型 1=平台角色 2=客户角色" json:"role_type"` Status int `gorm:"column:status;not null;default:1;comment:状态 0=禁用 1=启用" json:"status"` } // TableName 指定表名 func (Role) TableName() string { return "tb_role" }