import { http } from '@/utils/http/axios';
import type {
  WarningInfoListResponse,
  DefenseNoticeListResponse,
  WarningInfoDetailResponse,
  DefenseNoticeDetailResponse,
} from '@/types/disaster-warning';
/**
 * 获取预警信息列表
 */
export function getWarningInfoList() {
  return http.request<WarningInfoListResponse[]>(
    {
      url: 'admin/warning/getWarningInfoList',
      method: 'get',
    },
    {
      ignoreTargetTenantId: true,
    },
  );
}
/**
 * 获取防御通知列表
 */
export function getDefenseNoticeList() {
  return http.request<DefenseNoticeListResponse[]>(
    {
      url: 'admin/warning/getDefenseNoticeList',
      method: 'get',
    },
    {
      ignoreTargetTenantId: true,
    },
  );
}

/**
 * 获取预警信息详情
 */
export function getWarningInfoDetail(id: number) {
  return http.request<WarningInfoDetailResponse>(
    {
      url: 'admin/warning/getWarningInfoDetail',
      method: 'get',
      params: {
        id,
      },
    },
    {
      ignoreTargetTenantId: true,
    },
  );
}
/**
 * 查看防御通知详情
 */
export function getDefenseNoticeDetail(id: number) {
  return http.request<DefenseNoticeDetailResponse>(
    {
      url: 'admin/warning/getDefenseNoticeDetail',
      method: 'get',
      params: {
        id,
      },
    },
    {
      ignoreTargetTenantId: true,
    },
  );
}
