import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DmsBaseDeviceDebuggingVO, DmsBaseDeviceDebuggingForm, DmsBaseDeviceDebuggingQuery } from '@/api/dms/dmsBaseDeviceDebugging/types';

/**
 * 查询设备调试信息列表
 * @param query
 * @returns {*}
 */

export const listDmsBaseDeviceDebugging = (query?: DmsBaseDeviceDebuggingQuery): AxiosPromise<DmsBaseDeviceDebuggingVO[]> => {
  return request({
    url: '/dms/dmsBaseDeviceDebugging/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询设备调试信息详细
 * @param deviceDebuggingId
 */
export const getDmsBaseDeviceDebugging = (deviceDebuggingId: string | number): AxiosPromise<DmsBaseDeviceDebuggingVO> => {
  return request({
    url: '/dms/dmsBaseDeviceDebugging/' + deviceDebuggingId,
    method: 'get'
  });
};

/**
 * 新增设备调试信息
 * @param data
 */
export const addDmsBaseDeviceDebugging = (data: DmsBaseDeviceDebuggingForm) => {
  return request({
    url: '/dms/dmsBaseDeviceDebugging',
    method: 'post',
    data: data
  });
};

/**
 * 修改设备调试信息
 * @param data
 */
export const updateDmsBaseDeviceDebugging = (data: DmsBaseDeviceDebuggingForm) => {
  return request({
    url: '/dms/dmsBaseDeviceDebugging',
    method: 'put',
    data: data
  });
};

/**
 * 删除设备调试信息
 * @param deviceDebuggingId
 */
export const delDmsBaseDeviceDebugging = (deviceDebuggingId: string | number | Array<string | number>) => {
  return request({
    url: '/dms/dmsBaseDeviceDebugging/' + deviceDebuggingId,
    method: 'delete'
  });
};

/**
 * Get debugging count
 * @returns
 */
export const getDebuggingCount = (params: any): AxiosPromise<number> => {
  return request({
    url: '/dms/dmsBaseDeviceDebugging/count',
    method: 'get',
    params
  });
};


/**
 * 下拉框查询设备调试信息列表
 * @param query
 * @returns {*}
 */
export function getDmsBaseDeviceDebuggingList (query) {
    return request({
        url: '/dms/dmsBaseDeviceDebugging/getDmsBaseDeviceDebuggingList',
        method: 'get',
        params: query
    });
};
