消防站
This commit is contained in:
@@ -5,12 +5,14 @@ import { getBasePoins as getRiskBasePoints, getPointDetailById as getRiskPointDe
|
||||
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接口统一导出对象
|
||||
@@ -106,4 +108,20 @@ export const $api = {
|
||||
*/
|
||||
getPointDetailById: (id: number): Promise<ApiResponse<XianEmergencyShelter>> => getEmergencyShelterPointDetailById(id),
|
||||
},
|
||||
|
||||
// 消防站信息
|
||||
firefighter: {
|
||||
/**
|
||||
* 获取所有基础消防站
|
||||
* @returns 消防站数据数组
|
||||
*/
|
||||
getBasePoints: (): Promise<ApiResponse<XianFirefighter[]>> => getFirefighterBasePoints(),
|
||||
|
||||
/**
|
||||
* 根据id获取消防站详情
|
||||
* @param id - 消防站id
|
||||
* @returns 消防站详情
|
||||
*/
|
||||
getPointDetailById: (id: number): Promise<ApiResponse<XianFirefighter>> => getFirefighterPointDetailById(id),
|
||||
},
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import type { ApiResponse } from "@/types/ApiResponse"
|
||||
import type { XianFirefighter } from "@/types/base/XianFirefighter"
|
||||
import httpInstance from "@/utils/request/http"
|
||||
|
||||
/**
|
||||
* 获取消防站基础数据
|
||||
* @returns 消防站数据数组
|
||||
*/
|
||||
export const getBasePoints = (): Promise<ApiResponse<XianFirefighter[]>> => {
|
||||
return httpInstance.get('/firefighter/base-points')
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id获取消防站详情
|
||||
* @param id - 消防站id
|
||||
* @returns 消防站详情
|
||||
*/
|
||||
export const getPointDetailById = (id: number): Promise<ApiResponse<XianFirefighter>> => {
|
||||
return httpInstance.get(`/firefighter/point-detail/${id}`)
|
||||
}
|
||||
Reference in New Issue
Block a user