chore: apis
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
export * from './log/ndm-device-alarm-log';
|
export * from './log/ndm-device-alarm-log';
|
||||||
export * from './log/ndm-icmp-log';
|
export * from './log/ndm-icmp-log';
|
||||||
export * from './log/ndm-snmp-log';
|
export * from './log/ndm-snmp-log';
|
||||||
|
export * from './log/ndm-vimp-log';
|
||||||
|
|
||||||
export * from './storage/ndm-nvr';
|
export * from './storage/ndm-nvr';
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export const postNdmDeviceAlarmLogPage = async (stationCode: string, pageQuery:
|
|||||||
return alarmData;
|
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';
|
const endpoint = '/api/ndm/ndmDeviceAlarmLog/defaultExportByTemplate';
|
||||||
if (!stationCode) {
|
if (!stationCode) {
|
||||||
const resp = await userClient.post<BlobPart>(`${endpoint}`, pageQuery, { responseType: 'blob', retRaw: true });
|
const resp = await userClient.post<BlobPart>(`${endpoint}`, pageQuery, { responseType: 'blob', retRaw: true });
|
||||||
|
|||||||
@@ -4,5 +4,9 @@ import type { PageParams, NdmIcmpLogPageQuery, PageResult, NdmIcmpLogResultVO }
|
|||||||
export const postIcmpLogPage = async (stationCode: string, pageQuery: PageParams<NdmIcmpLogPageQuery>) => {
|
export const postIcmpLogPage = async (stationCode: string, pageQuery: PageParams<NdmIcmpLogPageQuery>) => {
|
||||||
const prefix = stationCode ? `/${stationCode}` : '';
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
const resp = await ndmClient.post<PageResult<NdmIcmpLogResultVO>>(`${prefix}/api/ndm/ndmIcmpLog/page`, pageQuery);
|
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;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,5 +4,9 @@ import type { PageParams, NdmSnmpLogPageQuery, PageResult, NdmSnmpLogResultVO }
|
|||||||
export const postSnmpLogPage = async (stationCode: string, pageQuery: PageParams<NdmSnmpLogPageQuery>) => {
|
export const postSnmpLogPage = async (stationCode: string, pageQuery: PageParams<NdmSnmpLogPageQuery>) => {
|
||||||
const prefix = stationCode ? `/${stationCode}` : '';
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
const resp = await ndmClient.post<PageResult<NdmSnmpLogResultVO>>(`${prefix}/api/ndm/ndmSnmpLog/page`, pageQuery);
|
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;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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;
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user