package devices

import "server/global"

// 分辨率
type Resolution struct {
	ID    int    `gorm:"primarykey" json:"ID"`          //主键ID
	Price string `gorm:"type:varchar(64)" json:"price"` //分辨率
}

func (Resolution) TableName() string {
	return "screens_resolution"
}

// 屏幕尺寸
type ScreensSize struct {
	ID   int    `gorm:"primarykey" json:"ID"`         //主键ID
	Size string `gorm:"type:varchar(64)" json:"size"` //尺寸
}

func (ScreensSize) TableName() string {
	return "screens_screens_size"
}

func (r Resolution) GetResolution() ([]Resolution, error) {
	var resolution []Resolution
	err := global.GVA_DB.Model(&r).Find(&resolution).Error
	return resolution, err
}
func (s ScreensSize) GetScreensSize() ([]ScreensSize, error) {
	var sreensSize []ScreensSize
	err := global.GVA_DB.Model(&s).Find(&sreensSize).Error
	return sreensSize, err
}
