import type { DisasterType } from '@/types/common/DisasterType.ts' import { getSm2PublicKey } from './crypto' import { getBasePoins as getHiddenDangerBasePoints, getPointDetailById as getHiddenDangerPointDetailById} from './hidden-danger-spots' import { getBasePoins as getRiskBasePoints, getPointDetailById as getRiskPointDetailById} from './risk-spots' import { getBasePoins as getHospitalsBasePoints, getPointDetailById as getHospitalsPointDetailById} from './hospitals' import { getBasePoints as getDangerousSourceBasePoints, getPointDetailById as getDangerousSourcePointDetailById} from './dangerous-source' import { getBasePoints as getEmergencyShelterBasePoints, getPointDetailById as getEmergencyShelterPointDetailById} from './emergency-shelter' import { getBasePoints as getFirefighterBasePoints, getPointDetailById as getFirefighterPointDetailById} from './firefighter' import type { ApiResponse } from '@/types/ApiResponse' import type { XianHiddenDangerSpots } from '@/types/base/XianHiddenDangerSpots' import type { XianRiskSpots } from '@/types/base/XianRiskSpots' import type { XianHospitals } from '@/types/base/XianHospitals' import type { XianDangerousSource } from '@/types/base/XianDangerousSource' import type { XianEmergencyShelter } from '@/types/base/XianEmergencyShelter' import type { XianFirefighter } from '@/types/base/XianFirefighter' /** * API接口统一导出对象 */ export const $api = { // 加密模块 crypto: { /** * 获取SM2公钥 * @returns SM2公钥响应 */ getSm2PublicKey: () => getSm2PublicKey(), }, // 隐患点信息 hiddenDangerSpots: { /** * 获取所有基础隐患点 * @param disasterType - 灾害类型 * @returns 隐患点数据数组 */ getBasePoins: (disasterType: DisasterType): Promise> => getHiddenDangerBasePoints(disasterType), /** * 根据id获取隐患点详情 * @param id - 隐患点id * @returns 隐患点详情 */ getPointDetailById: (id: number): Promise> => getHiddenDangerPointDetailById(id), }, // 风险点信息 riskSpots: { /** * 获取所有基础风险点 * @returns 风险点数据数组 */ getBasePoins: (): Promise> => getRiskBasePoints(), /** * 根据id获取风险点详情 * @param id - 风险点id * @returns 风险点详情 */ getPointDetailById: (id: number): Promise> => getRiskPointDetailById(id), }, // 医院信息 hospitals: { /** * 获取所有基础医院 * @returns 医院数据数组 */ getBasePoins: (): Promise> => getHospitalsBasePoints(), /** * 根据id获取医院详情 * @param id - 医院id * @returns 医院详情 */ getPointDetailById: (id: number): Promise> => getHospitalsPointDetailById(id), }, // 危险源信息 dangerousSource: { /** * 获取所有基础危险源 * @returns 危险源数据数组 */ getBasePoints: (): Promise> => getDangerousSourceBasePoints(), /** * 根据id获取危险源详情 * @param id - 危险源id * @returns 危险源详情 */ getPointDetailById: (id: number): Promise> => getDangerousSourcePointDetailById(id), }, // 避难所信息 emergencyShelter: { /** * 获取所有基础避难所 * @returns 避难所数据数组 */ getBasePoints: (): Promise> => getEmergencyShelterBasePoints(), /** * 根据id获取避难所详情 * @param id - 避难所id * @returns 避难所详情 */ getPointDetailById: (id: number): Promise> => getEmergencyShelterPointDetailById(id), }, // 消防站信息 firefighter: { /** * 获取所有基础消防站 * @returns 消防站数据数组 */ getBasePoints: (): Promise> => getFirefighterBasePoints(), /** * 根据id获取消防站详情 * @param id - 消防站id * @returns 消防站详情 */ getPointDetailById: (id: number): Promise> => getFirefighterPointDetailById(id), }, }