chore: apis

This commit is contained in:
yangsy
2025-08-22 01:19:15 +08:00
parent a52899b052
commit 4ea5bfa515
5 changed files with 37 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
export * from './log/ndm-device-alarm-log';
export * from './log/ndm-icmp-log';
export * from './log/ndm-snmp-log';
export * from './log/ndm-vimp-log';
export * from './storage/ndm-nvr';

View File

@@ -21,7 +21,7 @@ export const postNdmDeviceAlarmLogPage = async (stationCode: string, pageQuery:
return alarmData;
};
export const defaultExportByTemplate = async (stationCode: string, pageQuery: PageParams<NdmDeviceAlarmLogPageQuery>) => {
export const ndmDeviceAlarmLogDefaultExportByTemplate = async (stationCode: string, pageQuery: PageParams<NdmDeviceAlarmLogPageQuery>) => {
const endpoint = '/api/ndm/ndmDeviceAlarmLog/defaultExportByTemplate';
if (!stationCode) {
const resp = await userClient.post<BlobPart>(`${endpoint}`, pageQuery, { responseType: 'blob', retRaw: true });

View File

@@ -4,5 +4,9 @@ import type { PageParams, NdmIcmpLogPageQuery, PageResult, NdmIcmpLogResultVO }
export const postIcmpLogPage = async (stationCode: string, pageQuery: PageParams<NdmIcmpLogPageQuery>) => {
const prefix = stationCode ? `/${stationCode}` : '';
const resp = await ndmClient.post<PageResult<NdmIcmpLogResultVO>>(`${prefix}/api/ndm/ndmIcmpLog/page`, pageQuery);
return resp;
const [err, icmpLogData] = resp;
if (err || !icmpLogData) {
throw err;
}
return icmpLogData;
};

View File

@@ -4,5 +4,9 @@ import type { PageParams, NdmSnmpLogPageQuery, PageResult, NdmSnmpLogResultVO }
export const postSnmpLogPage = async (stationCode: string, pageQuery: PageParams<NdmSnmpLogPageQuery>) => {
const prefix = stationCode ? `/${stationCode}` : '';
const resp = await ndmClient.post<PageResult<NdmSnmpLogResultVO>>(`${prefix}/api/ndm/ndmSnmpLog/page`, pageQuery);
return resp;
const [err, snmpLogData] = resp;
if (err || !snmpLogData) {
throw err;
}
return snmpLogData;
};

View File

@@ -0,0 +1,25 @@
import { ndmClient } from '@/apis/client';
import type { PageParams, NdmVimpLogPageQuery, PageResult, NdmVimpLogResultVO } from '@/apis/models';
export const postNdmVimpLogPage = async (stationCode: string, pageQuery: PageParams<NdmVimpLogPageQuery>) => {
const prefix = stationCode ? `/${stationCode}` : '';
const resp = await ndmClient.post<PageResult<NdmVimpLogResultVO>>(`${prefix}/api/ndm/ndmVimpLog/page`, pageQuery);
const [err, vimpLogData] = resp;
if (err || !vimpLogData) {
throw err;
}
return vimpLogData;
};
export const ndmVimpLogDefaultExportByTemplate = async (stationCode: string, pageQuery: PageParams<NdmVimpLogPageQuery>) => {
const endpoint = '/api/ndm/ndmVimpLog/defaultExportByTemplate';
if (!stationCode) {
throw new Error('请选择车站');
}
const resp = await ndmClient.post<Blob>(`/${stationCode}${endpoint}`, pageQuery, { responseType: 'blob', retRaw: true });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};