package model import ( "gorm.io/gorm" ) // RolePermission 角色-权限关联模型 type RolePermission struct { gorm.Model BaseModel RoleID uint `gorm:"not null;index;uniqueIndex:idx_role_permission_unique,where:deleted_at IS NULL" json:"role_id"` PermID uint `gorm:"not null;index;uniqueIndex:idx_role_permission_unique,where:deleted_at IS NULL" json:"perm_id"` Status int `gorm:"not null;default:1" json:"status"` } // TableName 指定表名 func (RolePermission) TableName() string { return "tb_role_permission" }