2026-07-27 00:18:42 +08:00
|
|
|
|
package models
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
|
|
"git.apinb.com/bsm-sdk/core/database"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
2026-07-28 13:35:59 +08:00
|
|
|
|
// PlatformRoleMenu 对应 platform_role_menu,记录角色拥有的菜单权限。
|
|
|
|
|
|
type PlatformRoleMenu struct {
|
2026-07-27 00:18:42 +08:00
|
|
|
|
ID uint64 `gorm:"column:id;primaryKey;autoIncrement" json:"id"` // 数据库自增主键
|
|
|
|
|
|
PlatformRoleID uint64 `gorm:"column:platform_role_id;not null;uniqueIndex:uk_platform_role_menu" json:"platform_role_id"` // 角色自增主键
|
|
|
|
|
|
PlatformMenuID uint64 `gorm:"column:platform_menu_id;not null;uniqueIndex:uk_platform_role_menu" json:"platform_menu_id"` // 菜单自增主键
|
|
|
|
|
|
CreatedAt time.Time `gorm:"column:created_at;type:timestamptz;not null" json:"created_at"` // 创建时间
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-07-28 13:35:59 +08:00
|
|
|
|
func init() { database.AppendMigrate(&PlatformRoleMenu{}) }
|
2026-07-27 00:18:42 +08:00
|
|
|
|
|
|
|
|
|
|
// TableName 返回与模型、文件名一致的单数数据表名。
|
2026-07-28 13:35:59 +08:00
|
|
|
|
func (table *PlatformRoleMenu) TableName() string { return "platform_role_menu" }
|