15 lines
679 B
TypeScript
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;
|
|
};
|