import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ArDeviceVO, ArDeviceForm, ArDeviceQuery } from '@/api/inspection/device/types';

/**
 * 查询AR设备列表
 * @param query
 * @returns {*}
 */
export const listArDevice = (query?: ArDeviceQuery): AxiosPromise<ArDeviceVO[]> => {
  return request({
    url: '/inspection/device/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询AR设备详细
 * @param id
 */
export const getArDevice = (id: string | number): AxiosPromise<ArDeviceVO> => {
  return request({
    url: '/inspection/device/' + id,
    method: 'get'
  });
};

/**
 * 新增AR设备
 * @param data
 */
export const addArDevice = (data: ArDeviceForm) => {
  return request({
    url: '/inspection/device',
    method: 'post',
    data: data
  });
};

/**
 * 修改AR设备
 * @param data
 */
export const updateArDevice = (data: ArDeviceForm) => {
  return request({
    url: '/inspection/device',
    method: 'put',
    data: data
  });
};

/**
 * 删除AR设备
 * @param id
 */
export const delArDevice = (id: string | number | Array<string | number>) => {
  return request({
    url: '/inspection/device/' + id,
    method: 'delete'
  });
};
