隐患点
This commit is contained in:
@@ -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
@@ -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')
|
||||
}
|
||||
|
||||
@@ -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}`)
|
||||
}
|
||||
Reference in New Issue
Block a user