import { defHttp } from '/@/utils/http/axios';

enum Api {
  getProvinceAlarm = '/province/alarm/getProvinceAlarm',
  getProvinceAlarmHistory = '/province/alarm/getProvinceAlarmHistory',
  getProvinceAlarmNum = '/province/alarm/getProvinceAlarmNum',
  resolveAlarm = '/province/alarm/solveProvinceAlarm',
}
//根据预警类型查询不同等级数量
export const getProvinceAlarmNum = (params) =>
  defHttp.post(
    {
      url: Api.getProvinceAlarmNum,
      params,
    },
    { joinParamsToUrl: true }
  );
//查询预警历史数据
export const getProvinceAlarmHistory = (params) =>
  defHttp.post(
    {
      url: Api.getProvinceAlarmHistory,
      params: {
        alarmType: 'leakageAlarm',
        ...params,
      },
    },
    {
      joinParamsToUrl: true,
    }
  );
//查询预警数据
export const getProvinceAlarm = (params) =>
  defHttp.post(
    {
      url: Api.getProvinceAlarm,
      params: {
        alarmType: 'leakageAlarm',
        ...params,
      },
    },
    {
      joinParamsToUrl: true,
    }
  );
// 解决预警
export const resolveAlarm = (params) =>
  defHttp.post({
    url: Api.resolveAlarm,
    params,
  });
