package domain

import "time"

// UserRole 用户-角色关联
type UserRole struct {
	ID        int64     `gorm:"primaryKey;autoIncrement" json:"id"`
	UserID    int64     `gorm:"not null;index:idx_user_role;index:idx_user" json:"user_id"`
	RoleID    int64     `gorm:"not null;index:idx_user_role;index:idx_role" json:"role_id"`
	CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
}

// TableName 指定表名
func (UserRole) TableName() string {
	return "user_roles"
}
