import request from '@/utils/request';
import axios from 'axios';


export function queryAllByUseridNoPage() {
  return request({
    url: 'api/queryAllByUseridNoPage',
    method: 'post',
    data: {
    }
  })
}

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

export function getByProjectId(id) {
	return request({
		url: 'api/getDeviceByProjectid/' + id,
		method: 'get'
	})
}

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

export function getDeviceDataById(id) {
	return request({
		url: 'api/loadNowDataByDeviceid/' + id,
		method: 'get'
	})
}

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


export function get24HoursData(id) {
	return request({
		url: 'api/loadCDataByDeviceid',
		method: 'post',
		data: {
			deviceid:id
		}
	})
}

export function getContrlorList(id) {
	return request({
		url: 'api/loadByDeviceid',
		method: 'post',
		data: {
			deviceid:id
		}
	})
}

export function getData2(data) {
	return request({
		url: 'api/getData2',
		method: 'post',
		data:data
	})
}

/* export function getWeather(params) {
	return axios.get('weather', {
		params: params
	})
} */

export function controlWay(data) {
  return request({
    url: 'api/controlWay',
    method: 'post',
    data
  })
}