package domain

import "time"

// RolePermission 角色-权限关联
type RolePermission struct {
	ID           int64     `gorm:"primaryKey;autoIncrement" json:"id"`
	RoleID       int64     `gorm:"not null;index:idx_role_perm;index:idx_rp_role" json:"role_id"`
	PermissionID int64     `gorm:"not null;index:idx_role_perm;index:idx_rp_perm" json:"permission_id"`
	CreatedAt    time.Time `gorm:"autoCreateTime" json:"created_at"`
}

// TableName 指定表名
func (RolePermission) TableName() string {
	return "role_permissions"
}
