/*
 * @Author: chris
 * @Date: 2025-09-05 11:34:53
 * @LastEditors: chris
 * @LastEditTime: 2026-01-19 10:13:37
 */
import request from "@/utils/request";

// 查询设备数据列表
export function listDeviceData(query) {
  return request({
    url: "/business/device-data/list",
    method: "get",
    params: query,
  });
}

// 查询设备数据详细
export function getDeviceData(id) {
  return request({
    url: "/business/device-data/" + id,
    method: "get",
  });
}

// 查询设备数据统计分析数据
export function getDeviceDataAnalysis(params) {
  return request({
    url: "/business/device-data/analysis",
    method: "get",
    params,
  });
}

// 新增设备数据
export function addDeviceData(data) {
  return request({
    url: "/business/device-data",
    method: "post",
    data,
  });
}

// 修改设备数据
export function updateDeviceData(data) {
  return request({
    url: "/business/device-data",
    method: "put",
    data,
  });
}

// 删除设备数据
export function delDeviceData(id) {
  return request({
    url: "/business/device-data/" + id,
    method: "delete",
  });
}

// 导出设备数据
export function exportDeviceData(query) {
  return request({
    url: "/business/device-data/export",
    method: "post",
    params: query,
    responseType: "blob",
  });
}

// 导出虫情分析数据
export function exportPestAnalysis(params) {
  return request({
    url: "/business/device-data/insect/analysis/export",
    method: "post",
    params,
    responseType: "blob",
  });
}

// 导出虫情趋势数据
export function exportPestTrend(params) {
  return request({
    url: "/business/device-data/insect/trend/export",
    method: "post",
    params,
    responseType: "blob",
  });
}
