Files
xian_vue_new/src/api/api.ts
T

35 lines
1.3 KiB
TypeScript
Raw Normal View History

2026-04-11 10:09:40 +08:00
import type { DisasterType } from '@/types/common/DisasterType'
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-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-07 20:01:06 +08:00
export const $api = {
// 加密模块
crypto: {
// 获取sm2公钥
getSm2PublicKey: () => getSm2PublicKey(),
},
2026-04-11 10:09:40 +08:00
// 隐患点信息
hiddenDangerSpots: {
// 获取所有基础隐患点
2026-04-11 18:58:43 +08:00
getBasePoins: (disasterType: DisasterType): Promise<ApiResponse<XianHiddenDangerSpots[]>> => getHiddenDangerBasePoints(disasterType),
2026-04-11 10:09:40 +08:00
// 根据id获取隐患点详情
2026-04-11 18:58:43 +08:00
getPointDetailById: (id: number): Promise<ApiResponse<XianHiddenDangerSpots>> => getHiddenDangerPointDetailById(id),
},
// 风险点信息
riskSpots: {
// 获取所有基础风险点
getBasePoins: (): Promise<ApiResponse<XianRiskSpots[]>> => getRiskBasePoints(),
// 根据id获取风险点详情
getPointDetailById: (id: number): Promise<ApiResponse<XianRiskSpots>> => getRiskPointDetailById(id),
2026-04-11 10:09:40 +08:00
},
2026-04-07 20:01:06 +08:00
}