import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DmsRealtimeStatusVO, DmsRealtimeStatusForm, DmsRealtimeStatusQuery } from '@/api/dms/DmsRealtimeStatus/types';

/**
 * 查询设备实时状态记录列表
 * @param query
 * @returns {*}
 */

export const listDmsRealtimeStatus = (query?: DmsRealtimeStatusQuery): AxiosPromise<DmsRealtimeStatusVO[]> => {
  return request({
    url: '/dms/DmsRealtimeStatus/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询设备实时状态记录详细
 * @param statusId
 */
export const getDmsRealtimeStatus = (statusId: string | number): AxiosPromise<DmsRealtimeStatusVO> => {
  return request({
    url: '/dms/DmsRealtimeStatus/' + statusId,
    method: 'get'
  });
};

/**
 * 新增设备实时状态记录
 * @param data
 */
export const addDmsRealtimeStatus = (data: DmsRealtimeStatusForm) => {
  return request({
    url: '/dms/DmsRealtimeStatus',
    method: 'post',
    data: data
  });
};

/**
 * 修改设备实时状态记录
 * @param data
 */
export const updateDmsRealtimeStatus = (data: DmsRealtimeStatusForm) => {
  return request({
    url: '/dms/DmsRealtimeStatus',
    method: 'put',
    data: data
  });
};

/**
 * 删除设备实时状态记录
 * @param statusId
 */
export const delDmsRealtimeStatus = (statusId: string | number | Array<string | number>) => {
  return request({
    url: '/dms/DmsRealtimeStatus/' + statusId,
    method: 'delete'
  });
};


/**
 * 下拉框查询设备实时状态记录列表
 * @param query
 * @returns {*}
 */
export function getDmsRealtimeStatusList (query) {
    return request({
        url: '/dms/DmsRealtimeStatus/getDmsRealtimeStatusList',
        method: 'get',
        params: query
    });
};
