refactor: apis
This commit is contained in:
@@ -4,5 +4,3 @@ export * from './diag-info/ndm-nvr-diag-info';
|
||||
export * from './diag-info/ndm-security-box-diag-info';
|
||||
export * from './diag-info/ndm-server-diag-info';
|
||||
export * from './diag-info/ndm-switch-diag-info';
|
||||
|
||||
export * from './device-id-type';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ndmClient } from '@/apis/client';
|
||||
import type { PageParams, NdmNvrPageQuery, PageResult, NdmNvrResultVO, NdmNvrUpdateVO, NdmNvrVO, ClientChannel, NdmRecordCheck } from '@/apis/models';
|
||||
import type { PageParams, NdmNvrPageQuery, PageResult, NdmNvrResultVO, NdmNvrUpdateVO, ClientChannel, NdmRecordCheck } from '@/apis/models';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
export const postNdmNvrPage = async (stationCode: string, pageQuery: PageParams<NdmNvrPageQuery>, signal?: AbortSignal) => {
|
||||
@@ -22,7 +22,7 @@ export const putNdmNvr = async (stationCode: string, updateVO: NdmNvrUpdateVO) =
|
||||
return ndmNvr;
|
||||
};
|
||||
|
||||
export const getChannelList = async (stationCode: string, ndmNvr: NdmNvrVO) => {
|
||||
export const getChannelList = async (stationCode: string, ndmNvr: NdmNvrResultVO) => {
|
||||
const prefix = stationCode ? `/${stationCode}` : '';
|
||||
const resp = await ndmClient.post<ClientChannel[]>(`${prefix}/api/ndm/ndmRecordCheck/getChannelList`, {
|
||||
code: ndmNvr.gbCode,
|
||||
@@ -35,7 +35,7 @@ export const getChannelList = async (stationCode: string, ndmNvr: NdmNvrVO) => {
|
||||
return channelList;
|
||||
};
|
||||
|
||||
export const getRecordCheckByParentId = async (stationCode: string, ndmNvr: NdmNvrVO, lastDays: number, gbCodeList: string[] = []) => {
|
||||
export const getRecordCheckByParentId = async (stationCode: string, ndmNvr: NdmNvrResultVO, lastDays: number, gbCodeList: string[] = []) => {
|
||||
const prefix = stationCode ? `/${stationCode}` : '';
|
||||
const endDateTime = dayjs();
|
||||
const startDateTime = endDateTime.subtract(lastDays, 'day');
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { ndmClient } from '@/apis/client';
|
||||
|
||||
export const ndmVerify = async (stationCode: string) => {
|
||||
export const ndmVerify = async (stationCode: string, signal?: AbortSignal) => {
|
||||
const prefix = stationCode ? `/${stationCode}` : '';
|
||||
const resp = await ndmClient.post<void>(`${prefix}/api/ndm/ndmKeepAlive/verify`, {}, { timeout: 5000 });
|
||||
const resp = await ndmClient.post<void>(`${prefix}/api/ndm/ndmKeepAlive/verify`, {}, { timeout: 5000, signal });
|
||||
const [err] = resp;
|
||||
if (err) {
|
||||
throw err;
|
||||
|
||||
Reference in New Issue
Block a user