package devices

import (
	"server/dao"
	"server/model/devices"
)

type ScreensService struct{}

func (s ScreensService) AddScreens(screens dao.Screens) error {
	err := screens.AddScreens()
	return err
}

func (s ScreensService) DelScreens(id int) error {
	err := dao.Screens{}.DelScreens(id)
	return err
}

func (s ScreensService) UpdateScreens(screens dao.Screens) error {
	err := screens.UpdateScreens()
	return err
}
func (s ScreensService) GetScreensList(info devices.SearchInfo, userId uint) (list interface{}, total int64, err error) {
	limit := info.PageSize
	offset := info.PageSize * (info.Page - 1)

	screensList, t, err := dao.Screens{}.GetScreensList(limit, offset, int(info.ProjectId), info.Sn, userId)
	return screensList, t, err
}
