import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { BaseAlarmDetailVO, BaseAlarmDetailForm, BaseAlarmDetailQuery } from '@/api/dms/baseAlarmDetail/types';

/**
 * 查询报警详情信息列表
 * @param query
 * @returns {*}
 */

export const listBaseAlarmDetail = (query?: BaseAlarmDetailQuery): AxiosPromise<BaseAlarmDetailVO[]> => {
  return request({
    url: '/dms/baseAlarmDetail/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询报警详情信息详细
 * @param alarmDetailId
 */
export const getBaseAlarmDetail = (alarmDetailId: string | number): AxiosPromise<BaseAlarmDetailVO> => {
  return request({
    url: '/dms/baseAlarmDetail/' + alarmDetailId,
    method: 'get'
  });
};

/**
 * 新增报警详情信息
 * @param data
 */
export const addBaseAlarmDetail = (data: BaseAlarmDetailForm) => {
  return request({
    url: '/dms/baseAlarmDetail',
    method: 'post',
    data: data
  });
};

/**
 * 修改报警详情信息
 * @param data
 */
export const updateBaseAlarmDetail = (data: BaseAlarmDetailForm) => {
  return request({
    url: '/dms/baseAlarmDetail',
    method: 'put',
    data: data
  });
};

/**
 * 删除报警详情信息
 * @param alarmDetailId
 */
export const delBaseAlarmDetail = (alarmDetailId: string | number | Array<string | number>) => {
  return request({
    url: '/dms/baseAlarmDetail/' + alarmDetailId,
    method: 'delete'
  });
};


/**
 * 下拉框查询报警详情信息列表
 * @param query
 * @returns {*}
 */
export function getBaseAlarmDetailList (query) {
    return request({
        url: '/dms/baseAlarmDetail/getBaseAlarmDetailList',
        method: 'get',
        params: query
    });
};
