/*
 * @Author: chris
 * @Date: 2025-09-05 11:34:53
 * @LastEditors: chris
 * @LastEditTime: 2026-01-21 09:58:07
 */
import request from "@/utils/request";

// 查询果园列表
export function listDevice(query) {
  return request({
    url: "/business/device/list",
    method: "get",
    params: query,
  });
}

// 查询果园详细
export function getDevice(id) {
  return request({
    url: "/business/device/" + id,
    method: "get",
  });
}

// 新增果园
export function addDevice(data) {
  return request({
    url: "/business/device",
    method: "post",
    data,
  });
}

// 修改果园
export function updateDevice(data) {
  return request({
    url: "/business/device",
    method: "put",
    data,
  });
}

// 删除果园
export function delDevice(id) {
  return request({
    url: "/business/device/" + id,
    method: "delete",
  });
}

// 导出果园数据
export function exportDevice(query) {
  return request({
    url: "/business/device/export",
    method: "post",
    params: query,
    responseType: "blob",
  });
}

// 摄像头操作
export function controlCamera(query) {
  return request({
    url: "/business/device/camera/operate",
    method: "get",
    params: query,
  });
}
