Files
ndm-web-client/src/apis/request/biz/log/ndm-snmp-log.ts
2025-11-22 01:46:16 +08:00

15 lines
679 B
TypeScript

import { ndmClient, userClient, type NdmSnmpLogPageQuery, type NdmSnmpLogResultVO, type PageParams, type PageResult } from '@/apis';
export const pageSnmpLogApi = async (pageQuery: PageParams<NdmSnmpLogPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmSnmpLog/page`;
const resp = await client.post<PageResult<NdmSnmpLogResultVO>>(endpoint, pageQuery, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};