隐患点

This commit is contained in:
wzy-warehouse
2026-04-11 10:09:40 +08:00
parent de01e88642
commit e17a73537c
29 changed files with 573 additions and 25 deletions
+13
View File
@@ -1,4 +1,8 @@
import type { DisasterType } from '@/types/common/DisasterType'
import { getSm2PublicKey } from './crypto'
import { getBasePoins, getPointDetailById } from './hidden-danger-spots'
import type { ApiResponse } from '@/types/ApiResponse'
import type { XianHiddenDangerSpots } from '@/types/base/XianHiddenDangerSpots'
export const $api = {
@@ -7,4 +11,13 @@ export const $api = {
// 获取sm2公钥
getSm2PublicKey: () => getSm2PublicKey(),
},
// 隐患点信息
hiddenDangerSpots: {
// 获取所有基础隐患点
getBasePoins: (disasterType: DisasterType): Promise<ApiResponse<XianHiddenDangerSpots[]>> => getBasePoins(disasterType),
// 根据id获取隐患点详情
getPointDetailById: (id: number): Promise<ApiResponse<XianHiddenDangerSpots>> => getPointDetailById(id),
},
}
+2 -2
View File
@@ -1,11 +1,11 @@
import type { Sm2PublicKeyResponse } from '@/types/crypto/Sm2PublicKeyResponse'
import type { Response } from '@/types/Response'
import type { ApiResponse } from '@/types/ApiResponse'
import httpInstance from '@/utils/request/http'
/**
* 获取sm2加密公钥
* @returns
*/
export const getSm2PublicKey = (): Promise<Response<Sm2PublicKeyResponse>> => {
export const getSm2PublicKey = (): Promise<ApiResponse<Sm2PublicKeyResponse>> => {
return httpInstance.get('/crypto/sm2/public-key')
}
+26
View File
@@ -0,0 +1,26 @@
import type { ApiResponse } from "@/types/ApiResponse"
import type { XianHiddenDangerSpots } from "@/types/base/XianHiddenDangerSpots"
import type { DisasterType } from "@/types/common/DisasterType"
import httpInstance from "@/utils/request/http"
/**
* 获取隐藏危险点数据
* @param disasterType 灾害类型
* @returns 隐患点数据
*/
export const getBasePoins = (disasterType: DisasterType): Promise<ApiResponse<XianHiddenDangerSpots[]>> => {
return httpInstance.get('/hidden-danger-spots/base-points', {
params: {
disasterType
}
})
}
/**
* 根据id获取隐患点详情
* @param id 隐藏危险点id
* @returns 隐患点详情
*/
export const getPointDetailById = (id: number): Promise<ApiResponse<XianHiddenDangerSpots>> => {
return httpInstance.get(`/hidden-danger-spots/point-detail/${id}`)
}