package monitor

import (
	"github.com/gin-gonic/gin"
	"server/model/common/response"
	"server/utils"
	"strconv"
)

type MultiScreenApi struct{}

func (m MultiScreenApi) EditMultiScreen(c *gin.Context) {
	userid := utils.GetUserID(c)
	site, _ := strconv.Atoi(c.Query("site"))
	id, _ := strconv.Atoi(c.Query("id"))
	err := MultiScreenService.EditMultiScreen(userid, site, id)
	if err != nil {
		response.FailWithMessage("编辑失败", c)
		return
	}
	response.OkWithMessage("编辑成功", c)

}

func (m MultiScreenApi) MultiScreenList(c *gin.Context) {
	userid := utils.GetUserID(c)
	list, err := MultiScreenService.MultiScreenList(userid)
	if err != nil {
		response.FailWithMessage("获取失败", c)
		return
	}
	response.OkWithDetailed(gin.H{"list": list}, "获取成功", c)
}
