添加文档注释,方便生成技术文档
This commit is contained in:
+26
-5
@@ -6,29 +6,50 @@ import type { ApiResponse } from '@/types/ApiResponse'
|
||||
import type { XianHiddenDangerSpots } from '@/types/base/XianHiddenDangerSpots'
|
||||
import type { XianRiskSpots } from '@/types/base/XianRiskSpots'
|
||||
|
||||
/**
|
||||
* API接口统一导出对象
|
||||
*/
|
||||
export const $api = {
|
||||
|
||||
// 加密模块
|
||||
crypto: {
|
||||
// 获取sm2公钥
|
||||
/**
|
||||
* 获取SM2公钥
|
||||
* @returns SM2公钥响应
|
||||
*/
|
||||
getSm2PublicKey: () => getSm2PublicKey(),
|
||||
},
|
||||
|
||||
// 隐患点信息
|
||||
hiddenDangerSpots: {
|
||||
// 获取所有基础隐患点
|
||||
/**
|
||||
* 获取所有基础隐患点
|
||||
* @param disasterType - 灾害类型
|
||||
* @returns 隐患点数据数组
|
||||
*/
|
||||
getBasePoins: (disasterType: DisasterType): Promise<ApiResponse<XianHiddenDangerSpots[]>> => getHiddenDangerBasePoints(disasterType),
|
||||
|
||||
// 根据id获取隐患点详情
|
||||
/**
|
||||
* 根据id获取隐患点详情
|
||||
* @param id - 隐患点id
|
||||
* @returns 隐患点详情
|
||||
*/
|
||||
getPointDetailById: (id: number): Promise<ApiResponse<XianHiddenDangerSpots>> => getHiddenDangerPointDetailById(id),
|
||||
},
|
||||
|
||||
// 风险点信息
|
||||
riskSpots: {
|
||||
// 获取所有基础风险点
|
||||
/**
|
||||
* 获取所有基础风险点
|
||||
* @returns 风险点数据数组
|
||||
*/
|
||||
getBasePoins: (): Promise<ApiResponse<XianRiskSpots[]>> => getRiskBasePoints(),
|
||||
|
||||
// 根据id获取风险点详情
|
||||
/**
|
||||
* 根据id获取风险点详情
|
||||
* @param id - 风险点id
|
||||
* @returns 风险点详情
|
||||
*/
|
||||
getPointDetailById: (id: number): Promise<ApiResponse<XianRiskSpots>> => getRiskPointDetailById(id),
|
||||
},
|
||||
}
|
||||
|
||||
+2
-2
@@ -3,8 +3,8 @@ import type { ApiResponse } from '@/types/ApiResponse'
|
||||
import httpInstance from '@/utils/request/http'
|
||||
|
||||
/**
|
||||
* 获取sm2加密公钥
|
||||
* @returns
|
||||
* 获取SM2加密公钥
|
||||
* @returns SM2公钥响应
|
||||
*/
|
||||
export const getSm2PublicKey = (): Promise<ApiResponse<Sm2PublicKeyResponse>> => {
|
||||
return httpInstance.get('/crypto/sm2/public-key')
|
||||
|
||||
@@ -4,9 +4,9 @@ import type { DisasterType } from "@/types/common/DisasterType"
|
||||
import httpInstance from "@/utils/request/http"
|
||||
|
||||
/**
|
||||
* 获取隐患点数据
|
||||
* @param disasterType 灾害类型
|
||||
* @returns 隐患点数据
|
||||
* 获取隐患点基础数据
|
||||
* @param disasterType - 灾害类型
|
||||
* @returns 隐患点数据数组
|
||||
*/
|
||||
export const getBasePoins = (disasterType: DisasterType): Promise<ApiResponse<XianHiddenDangerSpots[]>> => {
|
||||
return httpInstance.get('/hidden-danger-spots/base-points', {
|
||||
@@ -18,7 +18,7 @@ export const getBasePoins = (disasterType: DisasterType): Promise<ApiResponse<Xi
|
||||
|
||||
/**
|
||||
* 根据id获取隐患点详情
|
||||
* @param id 隐患点id
|
||||
* @param id - 隐患点id
|
||||
* @returns 隐患点详情
|
||||
*/
|
||||
export const getPointDetailById = (id: number): Promise<ApiResponse<XianHiddenDangerSpots>> => {
|
||||
|
||||
@@ -3,8 +3,8 @@ import type { XianRiskSpots } from "@/types/base/XianRiskSpots"
|
||||
import httpInstance from "@/utils/request/http"
|
||||
|
||||
/**
|
||||
* 获取风险点数据
|
||||
* @returns 风险点数据
|
||||
* 获取风险点基础数据
|
||||
* @returns 风险点数据数组
|
||||
*/
|
||||
export const getBasePoins = (): Promise<ApiResponse<XianRiskSpots[]>> => {
|
||||
return httpInstance.get('/risk-spots/base-points')
|
||||
@@ -12,7 +12,7 @@ export const getBasePoins = (): Promise<ApiResponse<XianRiskSpots[]>> => {
|
||||
|
||||
/**
|
||||
* 根据id获取风险点详情
|
||||
* @param id 风险点id
|
||||
* @param id - 风险点id
|
||||
* @returns 风险点详情
|
||||
*/
|
||||
export const getPointDetailById = (id: number): Promise<ApiResponse<XianRiskSpots>> => {
|
||||
|
||||
Reference in New Issue
Block a user