import request from '@/utils/request'
import { download } from '@/utils/request'
import defaultSettings from '@/settings'
// 查询维保列表
export function listIncinerator(query) {
    return request({
        url: '/incinerator/incinerator/list',
        method: 'get',
        params: query
    })
}

// 查询维保详细
export function getIncinerator(sensorId) {
    return request({
        url: '/incinerator/incinerator/' + sensorId,
        method: 'get'
    })
}

// 新增维保
export function addIncinerator(data) {
    return request({
        url: '/incinerator/incinerator',
        method: 'post',
        data: data
    })
}

// 修改维保
export function updateIncinerator(data) {
    return request({
        url: '/incinerator/incinerator',
        method: 'put',
        data: data
    })
}

// 删除维保
export function delIncinerator(sensorId) {
    return request({
        url: '/incinerator/incinerator/' + sensorId,
        method: 'delete'
    })
}

// 导出维保
export function downloadIncinerator(data) {
    download(
        '/incinerator/incinerator/export',
        data,
        `sensor_${new Date().getTime()}.xlsx`)
}
// 删除维保
export function getVideoUrl() {
	return request({
	    url: '/request_api',
	    method: 'post',
		isHead: true,
		headers: {
			"Authorization": "Bearer eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjQ1OWU3MWU2LTQ5NmQtNGY2ZS05MzkzLTk0MzlmOWNiNzA3MiJ9.iKjGOVozp-ArAQy5fCGJlglK7VOI9mJ9wi3eO6IY-tYi6AqymC1-e6IYtbShD2ZDZqF3ICHaa8VZigGaZqu4tg",
		},
	    data: {"msgid":new Date().getTime(),"sn":"230704002","event":"voiceLists"}
	})
  //   return request({
  //       url: 'http://121.37.6.200:8088/request',
  //       method: 'post',
		// isHead: true,
		// headers: {
		// 	"Authorization": "Bearer eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjQ1OWU3MWU2LTQ5NmQtNGY2ZS05MzkzLTk0MzlmOWNiNzA3MiJ9.iKjGOVozp-ArAQy5fCGJlglK7VOI9mJ9wi3eO6IY-tYi6AqymC1-e6IYtbShD2ZDZqF3ICHaa8VZigGaZqu4tg",
		// },
  //       data: {
		// 	"msgid": new Date().getTime(),
		// 	"sn": "230704002",
		// 	"event": "video",
		// 	"info":{
		// 		"cameraid": "001",
		// 		"type": "rtsp/rtmp"
		// 	},
		// }
  //   })
}