2026-04-14 08:08:01 +08:00
|
|
|
import type { DisasterType } from '@/types/common/DisasterType.ts'
|
2026-04-07 20:01:06 +08:00
|
|
|
import { getSm2PublicKey } from './crypto'
|
2026-04-11 18:58:43 +08:00
|
|
|
import { getBasePoins as getHiddenDangerBasePoints, getPointDetailById as getHiddenDangerPointDetailById} from './hidden-danger-spots'
|
|
|
|
|
import { getBasePoins as getRiskBasePoints, getPointDetailById as getRiskPointDetailById} from './risk-spots'
|
2026-04-18 16:40:04 +08:00
|
|
|
import { getBasePoins as getHospitalsBasePoints, getPointDetailById as getHospitalsPointDetailById} from './hospitals'
|
2026-04-18 19:03:06 +08:00
|
|
|
import { getBasePoints as getDangerousSourceBasePoints, getPointDetailById as getDangerousSourcePointDetailById} from './dangerous-source'
|
2026-04-11 10:09:40 +08:00
|
|
|
import type { ApiResponse } from '@/types/ApiResponse'
|
|
|
|
|
import type { XianHiddenDangerSpots } from '@/types/base/XianHiddenDangerSpots'
|
2026-04-11 18:58:43 +08:00
|
|
|
import type { XianRiskSpots } from '@/types/base/XianRiskSpots'
|
2026-04-18 16:40:04 +08:00
|
|
|
import type { XianHospitals } from '@/types/base/XianHospitals'
|
2026-04-18 19:03:06 +08:00
|
|
|
import type { XianDangerousSource } from '@/types/base/XianDangerousSource'
|
2026-04-07 20:01:06 +08:00
|
|
|
|
2026-04-13 22:28:56 +08:00
|
|
|
/**
|
|
|
|
|
* API接口统一导出对象
|
|
|
|
|
*/
|
2026-04-07 20:01:06 +08:00
|
|
|
export const $api = {
|
|
|
|
|
|
|
|
|
|
// 加密模块
|
|
|
|
|
crypto: {
|
2026-04-13 22:28:56 +08:00
|
|
|
/**
|
|
|
|
|
* 获取SM2公钥
|
|
|
|
|
* @returns SM2公钥响应
|
|
|
|
|
*/
|
2026-04-07 20:01:06 +08:00
|
|
|
getSm2PublicKey: () => getSm2PublicKey(),
|
|
|
|
|
},
|
2026-04-11 10:09:40 +08:00
|
|
|
|
|
|
|
|
// 隐患点信息
|
|
|
|
|
hiddenDangerSpots: {
|
2026-04-13 22:28:56 +08:00
|
|
|
/**
|
|
|
|
|
* 获取所有基础隐患点
|
|
|
|
|
* @param disasterType - 灾害类型
|
|
|
|
|
* @returns 隐患点数据数组
|
|
|
|
|
*/
|
2026-04-11 18:58:43 +08:00
|
|
|
getBasePoins: (disasterType: DisasterType): Promise<ApiResponse<XianHiddenDangerSpots[]>> => getHiddenDangerBasePoints(disasterType),
|
2026-04-11 10:09:40 +08:00
|
|
|
|
2026-04-13 22:28:56 +08:00
|
|
|
/**
|
|
|
|
|
* 根据id获取隐患点详情
|
|
|
|
|
* @param id - 隐患点id
|
|
|
|
|
* @returns 隐患点详情
|
|
|
|
|
*/
|
2026-04-11 18:58:43 +08:00
|
|
|
getPointDetailById: (id: number): Promise<ApiResponse<XianHiddenDangerSpots>> => getHiddenDangerPointDetailById(id),
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 风险点信息
|
|
|
|
|
riskSpots: {
|
2026-04-13 22:28:56 +08:00
|
|
|
/**
|
|
|
|
|
* 获取所有基础风险点
|
|
|
|
|
* @returns 风险点数据数组
|
|
|
|
|
*/
|
2026-04-11 18:58:43 +08:00
|
|
|
getBasePoins: (): Promise<ApiResponse<XianRiskSpots[]>> => getRiskBasePoints(),
|
|
|
|
|
|
2026-04-13 22:28:56 +08:00
|
|
|
/**
|
|
|
|
|
* 根据id获取风险点详情
|
|
|
|
|
* @param id - 风险点id
|
|
|
|
|
* @returns 风险点详情
|
|
|
|
|
*/
|
2026-04-11 18:58:43 +08:00
|
|
|
getPointDetailById: (id: number): Promise<ApiResponse<XianRiskSpots>> => getRiskPointDetailById(id),
|
2026-04-11 10:09:40 +08:00
|
|
|
},
|
2026-04-18 16:40:04 +08:00
|
|
|
|
|
|
|
|
// 医院信息
|
|
|
|
|
hospitals: {
|
|
|
|
|
/**
|
|
|
|
|
* 获取所有基础医院
|
|
|
|
|
* @returns 医院数据数组
|
|
|
|
|
*/
|
|
|
|
|
getBasePoins: (): Promise<ApiResponse<XianHospitals[]>> => getHospitalsBasePoints(),
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据id获取医院详情
|
|
|
|
|
* @param id - 医院id
|
|
|
|
|
* @returns 医院详情
|
|
|
|
|
*/
|
|
|
|
|
getPointDetailById: (id: number): Promise<ApiResponse<XianHospitals>> => getHospitalsPointDetailById(id),
|
|
|
|
|
},
|
2026-04-18 19:03:06 +08:00
|
|
|
|
|
|
|
|
// 危险源信息
|
|
|
|
|
dangerousSource: {
|
|
|
|
|
/**
|
|
|
|
|
* 获取所有基础危险源
|
|
|
|
|
* @returns 危险源数据数组
|
|
|
|
|
*/
|
|
|
|
|
getBasePoints: (): Promise<ApiResponse<XianDangerousSource[]>> => getDangerousSourceBasePoints(),
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据id获取危险源详情
|
|
|
|
|
* @param id - 危险源id
|
|
|
|
|
* @returns 危险源详情
|
|
|
|
|
*/
|
|
|
|
|
getPointDetailById: (id: number): Promise<ApiResponse<XianDangerousSource>> => getDangerousSourcePointDetailById(id),
|
|
|
|
|
},
|
2026-04-07 20:01:06 +08:00
|
|
|
}
|