import request from '@/utils/request'

export function loadNowDataByUserid() {
	return request({
		url: 'api/loadNowDataByUserid',
		method: 'get',
	})
}

export function sItem(data) {
	return request({
		url: 'api/sItem',
		method: 'get',
		params: data,
	})
}

export function sWarnmsgByUserid(data) {
	return request({
		url: 'api/sWarnmsgByUserid',
		method: 'get',
		params: data,
	})
}

// 设备
export function sDeviceByUseridNotdevType(data) {
	return request({
		url: 'api/sDeviceByUseridNotdevType',
		method: 'get',
		params: data,
	})
}

// 控制器
export function sDeviceByUseridAnddevType(data) {
	return request({
		url: 'api/sDeviceByUseridAnddevType',
		method: 'get',
		params: data,
	})
}

export function getData(deviceid, item, starttime, endtime, params) {
	return request({
		url: 'api/getData',
		method: 'post',
		data: {
			deviceid,
			item,
			starttime,
			endtime,
		},
		params,
	})
}

export function getWarnmsgCountByUserid() {
	return request({
		url: 'api/getWarnmsgCountByUserid',
		method: 'get',
	})
}
