import { request } from '@umijs/max';

/**
 *
 * @param url 接口地址
 * @returns 城市风险 city-sjdz-base
 */
const IS_PROD = process.env.NODE_ENV === 'production' ? true : false;
export const reqBaseUrl = IS_PROD
  ? '/apis/city-sjdz-base'
  : '/apis/city-sjdz-base';
const urlProxyApis = (url: string) => {
  return `${reqBaseUrl}${url}`;
};

// 获取城市风险统计
export async function queryStatisticalRiskLevel(): Promise<any> {
  return request(
    urlProxyApis(`/safetyMonitoringObjectInfo/statisticalRiskLevel`),
  );
}

// 获取风险事件分页列表
export async function querySafetyRiskEventPage(
  params: any // page=1&count=10&parentTypeCode=dlql
): Promise<any> {
  return request(
    urlProxyApis(`/safetyRiskEventInfo/eventPage`),
    {
      params,
    },
  );
}