refactor: reorganize files
This commit is contained in:
2
src/apis/domain/biz/index.ts
Normal file
2
src/apis/domain/biz/index.ts
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export * from './diag';
|
||||||
|
export * from './station';
|
||||||
3
src/apis/domain/index.ts
Normal file
3
src/apis/domain/index.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export * from './biz';
|
||||||
|
export * from './user';
|
||||||
|
export * from './version';
|
||||||
1
src/apis/domain/version/index.ts
Normal file
1
src/apis/domain/version/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export * from './version-info';
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from './diag';
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
export * from './device';
|
|
||||||
export * from './station';
|
|
||||||
export * from './version';
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
export * from './clients';
|
export * from './client';
|
||||||
export * from './domains';
|
export * from './domain';
|
||||||
export * from './models';
|
export * from './model';
|
||||||
export * from './requests';
|
export * from './request';
|
||||||
|
|||||||
16
src/apis/model/biz/entity/index.ts
Normal file
16
src/apis/model/biz/entity/index.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import type { NdmSecurityBox, NdmSwitch } from './other';
|
||||||
|
import type { NdmNvr } from './storage';
|
||||||
|
import type { NdmCamera, NdmDecoder, NdmKeyboard, NdmMediaServer, NdmVideoServer } from './video';
|
||||||
|
|
||||||
|
export type NdmDeviceVO = NdmCamera | NdmDecoder | NdmKeyboard | NdmMediaServer | NdmNvr | NdmSecurityBox | NdmSwitch | NdmVideoServer;
|
||||||
|
|
||||||
|
export type NdmDeviceResultVO = Partial<NdmDeviceVO>;
|
||||||
|
|
||||||
|
export type NdmServerVO = NdmMediaServer | NdmVideoServer;
|
||||||
|
|
||||||
|
export type NdmServerResultVO = Partial<NdmServerVO>;
|
||||||
|
|
||||||
|
export * from './log';
|
||||||
|
export * from './other';
|
||||||
|
export * from './storage';
|
||||||
|
export * from './video';
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
export * from './ndm-call-log';
|
export * from './ndm-call-log';
|
||||||
export * from './ndm-device-alarm-log';
|
export * from './ndm-device-alarm-log';
|
||||||
export * from './ndm-icmp-log';
|
export * from './ndm-icmp-log';
|
||||||
|
export * from './ndm-record-check';
|
||||||
export * from './ndm-snmp-log';
|
export * from './ndm-snmp-log';
|
||||||
export * from './ndm-vimp-log';
|
export * from './ndm-vimp-log';
|
||||||
17
src/apis/model/biz/entity/log/ndm-call-log.ts
Normal file
17
src/apis/model/biz/entity/log/ndm-call-log.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import type { BaseModel, ReduceForPageQuery, ReduceForSaveVO, ReduceForUpdateVO } from '@/apis';
|
||||||
|
|
||||||
|
export interface NdmCallLog extends BaseModel {
|
||||||
|
sourceGbId: string;
|
||||||
|
targetGbId: string;
|
||||||
|
method: string;
|
||||||
|
messageType: string;
|
||||||
|
cmdType: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type NdmCallLogResultVO = Partial<NdmCallLog>;
|
||||||
|
|
||||||
|
export type NdmCallLogSaveVO = Partial<Omit<NdmCallLog, ReduceForSaveVO>>;
|
||||||
|
|
||||||
|
export type NdmCallLogUpdateVO = Partial<Omit<NdmCallLog, ReduceForUpdateVO>>;
|
||||||
|
|
||||||
|
export type NdmCallLogPageQuery = Partial<Omit<NdmCallLog, ReduceForPageQuery>>;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../../base';
|
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
|
||||||
|
|
||||||
export interface NdmDeviceAlarmLogVO extends BaseModel {
|
export interface NdmDeviceAlarmLog extends BaseModel {
|
||||||
alarmNo: string;
|
alarmNo: string;
|
||||||
alarmDate: string;
|
alarmDate: string;
|
||||||
faultLocation: string;
|
faultLocation: string;
|
||||||
@@ -18,10 +18,10 @@ export interface NdmDeviceAlarmLogVO extends BaseModel {
|
|||||||
stationCode: string;
|
stationCode: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type NdmDeviceAlarmLogResultVO = Partial<NdmDeviceAlarmLogVO>;
|
export type NdmDeviceAlarmLogResultVO = Partial<NdmDeviceAlarmLog>;
|
||||||
|
|
||||||
export type NdmDeviceAlarmLogSaveVO = Partial<Omit<NdmDeviceAlarmLogVO, ReduceForSaveVO>>;
|
export type NdmDeviceAlarmLogSaveVO = Partial<Omit<NdmDeviceAlarmLog, ReduceForSaveVO>>;
|
||||||
|
|
||||||
export type NdmDeviceAlarmLogUpdateVO = Partial<Omit<NdmDeviceAlarmLogVO, ReduceForUpdateVO>>;
|
export type NdmDeviceAlarmLogUpdateVO = Partial<Omit<NdmDeviceAlarmLog, ReduceForUpdateVO>>;
|
||||||
|
|
||||||
export type NdmDeviceAlarmLogPageQuery = Partial<Omit<NdmDeviceAlarmLogVO, ReduceForPageQuery>>;
|
export type NdmDeviceAlarmLogPageQuery = Partial<Omit<NdmDeviceAlarmLog, ReduceForPageQuery>>;
|
||||||
16
src/apis/model/biz/entity/log/ndm-icmp-log.ts
Normal file
16
src/apis/model/biz/entity/log/ndm-icmp-log.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
|
||||||
|
|
||||||
|
export interface NdmIcmpLog extends BaseModel {
|
||||||
|
deviceId: string;
|
||||||
|
name: string;
|
||||||
|
ipAddress: string;
|
||||||
|
deviceStatus: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type NdmIcmpLogResultVO = Partial<NdmIcmpLog>;
|
||||||
|
|
||||||
|
export type NdmIcmpLogSaveVO = Partial<Omit<NdmIcmpLog, ReduceForSaveVO>>;
|
||||||
|
|
||||||
|
export type NdmIcmpLogUpdateVO = Partial<Omit<NdmIcmpLog, ReduceForUpdateVO>>;
|
||||||
|
|
||||||
|
export type NdmIcmpLogPageQuery = Partial<Omit<NdmIcmpLog, ReduceForPageQuery>>;
|
||||||
8
src/apis/model/biz/entity/log/ndm-record-check.ts
Normal file
8
src/apis/model/biz/entity/log/ndm-record-check.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
export interface NdmRecordCheck {
|
||||||
|
gbCode: string;
|
||||||
|
parentGbCode: string;
|
||||||
|
name: string;
|
||||||
|
ipAddress: string;
|
||||||
|
diagInfo: string;
|
||||||
|
checkDate: string;
|
||||||
|
}
|
||||||
17
src/apis/model/biz/entity/log/ndm-snmp-log.ts
Normal file
17
src/apis/model/biz/entity/log/ndm-snmp-log.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
|
||||||
|
|
||||||
|
export interface NdmSnmpLog extends BaseModel {
|
||||||
|
deviceId: string;
|
||||||
|
name: string;
|
||||||
|
ipAddress: string;
|
||||||
|
diagInfo: string;
|
||||||
|
deviceType: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type NdmSnmpLogResultVO = Partial<NdmSnmpLog>;
|
||||||
|
|
||||||
|
export type NdmSnmpLogSaveVO = Partial<Omit<NdmSnmpLog, ReduceForSaveVO>>;
|
||||||
|
|
||||||
|
export type NdmSnmpLogUpdateVO = Partial<Omit<NdmSnmpLog, ReduceForUpdateVO>>;
|
||||||
|
|
||||||
|
export type NdmSnmpLogPageQuery = Partial<Omit<NdmSnmpLog, ReduceForPageQuery>>;
|
||||||
25
src/apis/model/biz/entity/log/ndm-vimp-log.ts
Normal file
25
src/apis/model/biz/entity/log/ndm-vimp-log.ts
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
|
||||||
|
|
||||||
|
export interface NdmVimpLog extends BaseModel {
|
||||||
|
requestIp: string;
|
||||||
|
description: string;
|
||||||
|
classPath: string;
|
||||||
|
methodName: string;
|
||||||
|
startTime: string;
|
||||||
|
endTime: string;
|
||||||
|
consumedTime: string;
|
||||||
|
params: string;
|
||||||
|
result: string;
|
||||||
|
httpMethod: string;
|
||||||
|
userId: string;
|
||||||
|
logType: number;
|
||||||
|
targetCode: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type NdmVimpLogResultVO = Partial<NdmVimpLog>;
|
||||||
|
|
||||||
|
export type NdmVimpLogSaveVO = Partial<Omit<NdmVimpLog, ReduceForSaveVO>>;
|
||||||
|
|
||||||
|
export type NdmVimpLogUpdateVO = Partial<Omit<NdmVimpLog, ReduceForUpdateVO>>;
|
||||||
|
|
||||||
|
export type NdmVimpLogPageQuery = Partial<Omit<NdmVimpLog, ReduceForPageQuery>>;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../../base';
|
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
|
||||||
|
|
||||||
export interface NdmSecurityBoxVO extends BaseModel {
|
export interface NdmSecurityBox extends BaseModel {
|
||||||
deviceId: string;
|
deviceId: string;
|
||||||
name: string;
|
name: string;
|
||||||
manufacturer: string;
|
manufacturer: string;
|
||||||
@@ -25,10 +25,10 @@ export interface NdmSecurityBoxVO extends BaseModel {
|
|||||||
snmpEnabled: boolean;
|
snmpEnabled: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type NdmSecurityBoxResultVO = Partial<NdmSecurityBoxVO>;
|
export type NdmSecurityBoxResultVO = Partial<NdmSecurityBox>;
|
||||||
|
|
||||||
export type NdmSecurityBoxSaveVO = Partial<Omit<NdmSecurityBoxVO, ReduceForSaveVO>>;
|
export type NdmSecurityBoxSaveVO = Partial<Omit<NdmSecurityBox, ReduceForSaveVO>>;
|
||||||
|
|
||||||
export type NdmSecurityBoxUpdateVO = Partial<Omit<NdmSecurityBoxVO, ReduceForUpdateVO>>;
|
export type NdmSecurityBoxUpdateVO = Partial<Omit<NdmSecurityBox, ReduceForUpdateVO>>;
|
||||||
|
|
||||||
export type NdmSecurityBoxPageQuery = Partial<Omit<NdmSecurityBoxVO, ReduceForPageQuery>>;
|
export type NdmSecurityBoxPageQuery = Partial<Omit<NdmSecurityBox, ReduceForPageQuery>>;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../../base';
|
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
|
||||||
|
|
||||||
export interface NdmSwitchVO extends BaseModel {
|
export interface NdmSwitch extends BaseModel {
|
||||||
deviceId: string;
|
deviceId: string;
|
||||||
name: string;
|
name: string;
|
||||||
manufacturer: string;
|
manufacturer: string;
|
||||||
@@ -25,10 +25,10 @@ export interface NdmSwitchVO extends BaseModel {
|
|||||||
snmpEnabled: boolean;
|
snmpEnabled: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type NdmSwitchResultVO = Partial<NdmSwitchVO>;
|
export type NdmSwitchResultVO = Partial<NdmSwitch>;
|
||||||
|
|
||||||
export type NdmSwitchSaveVO = Partial<Omit<NdmSwitchVO, ReduceForSaveVO>>;
|
export type NdmSwitchSaveVO = Partial<Omit<NdmSwitch, ReduceForSaveVO>>;
|
||||||
|
|
||||||
export type NdmSwitchUpdateVO = Partial<Omit<NdmSwitchVO, ReduceForUpdateVO>>;
|
export type NdmSwitchUpdateVO = Partial<Omit<NdmSwitch, ReduceForUpdateVO>>;
|
||||||
|
|
||||||
export type NdmSwitchPageQuery = Partial<Omit<NdmSwitchVO, ReduceForPageQuery>>;
|
export type NdmSwitchPageQuery = Partial<Omit<NdmSwitch, ReduceForPageQuery>>;
|
||||||
45
src/apis/model/biz/entity/storage/ndm-nvr.ts
Normal file
45
src/apis/model/biz/entity/storage/ndm-nvr.ts
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
|
||||||
|
|
||||||
|
export interface NdmNvr extends BaseModel {
|
||||||
|
deviceId: string;
|
||||||
|
name: string;
|
||||||
|
manufacturer: string;
|
||||||
|
state: boolean;
|
||||||
|
model: string;
|
||||||
|
ipAddress: string;
|
||||||
|
manageUrl: string;
|
||||||
|
manageUsername: string;
|
||||||
|
managePassword: string;
|
||||||
|
gbCode: string;
|
||||||
|
gbPort: number;
|
||||||
|
gbDomain: string;
|
||||||
|
gb28181Enabled: boolean;
|
||||||
|
onvifPort: number;
|
||||||
|
onvifUsername: string;
|
||||||
|
onvifPassword: string;
|
||||||
|
onvifMajorIndex: number;
|
||||||
|
onvifMinorIndex: number;
|
||||||
|
diagFlag: string;
|
||||||
|
diagParam: string;
|
||||||
|
diagFormat: string;
|
||||||
|
lastDiagInfo: string;
|
||||||
|
lastDiagTime: string;
|
||||||
|
icmpEnabled: boolean;
|
||||||
|
description: string;
|
||||||
|
deviceStatus: string;
|
||||||
|
deviceType: string;
|
||||||
|
community: string;
|
||||||
|
frontendConfig: string;
|
||||||
|
linkDescription: string;
|
||||||
|
snmpEnabled: boolean;
|
||||||
|
recordCheckEnabled: boolean;
|
||||||
|
clusterList: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type NdmNvrResultVO = Partial<NdmNvr>;
|
||||||
|
|
||||||
|
export type NdmNvrSaveVO = Partial<Omit<NdmNvr, ReduceForSaveVO>>;
|
||||||
|
|
||||||
|
export type NdmNvrUpdateVO = Partial<Omit<NdmNvr, ReduceForUpdateVO>>;
|
||||||
|
|
||||||
|
export type NdmNvrPageQuery = Partial<Omit<NdmNvr, ReduceForPageQuery>>;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../../base';
|
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
|
||||||
|
|
||||||
export interface NdmCameraVO extends BaseModel {
|
export interface NdmCamera extends BaseModel {
|
||||||
deviceId: string;
|
deviceId: string;
|
||||||
name: string;
|
name: string;
|
||||||
manufacturer: string;
|
manufacturer: string;
|
||||||
@@ -35,10 +35,10 @@ export interface NdmCameraVO extends BaseModel {
|
|||||||
snmpEnabled: boolean;
|
snmpEnabled: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type NdmCameraResultVO = Partial<NdmCameraVO>;
|
export type NdmCameraResultVO = Partial<NdmCamera>;
|
||||||
|
|
||||||
export type NdmCameraSaveVO = Partial<Omit<NdmCameraVO, ReduceForSaveVO>>;
|
export type NdmCameraSaveVO = Partial<Omit<NdmCamera, ReduceForSaveVO>>;
|
||||||
|
|
||||||
export type NdmCameraUpdateVO = Partial<Omit<NdmCameraVO, ReduceForUpdateVO>>;
|
export type NdmCameraUpdateVO = Partial<Omit<NdmCamera, ReduceForUpdateVO>>;
|
||||||
|
|
||||||
export type NdmCameraPageQuery = Partial<Omit<NdmCameraVO, ReduceForPageQuery>>;
|
export type NdmCameraPageQuery = Partial<Omit<NdmCamera, ReduceForPageQuery>>;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../../base';
|
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
|
||||||
|
|
||||||
export interface NdmDecoderVO extends BaseModel {
|
export interface NdmDecoder extends BaseModel {
|
||||||
deviceId: string;
|
deviceId: string;
|
||||||
name: string;
|
name: string;
|
||||||
manufacturer: string;
|
manufacturer: string;
|
||||||
@@ -32,10 +32,10 @@ export interface NdmDecoderVO extends BaseModel {
|
|||||||
snmpEnabled: boolean;
|
snmpEnabled: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type NdmDecoderResultVO = Partial<NdmDecoderVO>;
|
export type NdmDecoderResultVO = Partial<NdmDecoder>;
|
||||||
|
|
||||||
export type NdmDecoderSaveVO = Partial<Omit<NdmDecoderVO, ReduceForSaveVO>>;
|
export type NdmDecoderSaveVO = Partial<Omit<NdmDecoder, ReduceForSaveVO>>;
|
||||||
|
|
||||||
export type NdmDecoderUpdateVO = Partial<Omit<NdmDecoderVO, ReduceForUpdateVO>>;
|
export type NdmDecoderUpdateVO = Partial<Omit<NdmDecoder, ReduceForUpdateVO>>;
|
||||||
|
|
||||||
export type NdmDecoderPageQuery = Partial<Omit<NdmDecoderVO, ReduceForPageQuery>>;
|
export type NdmDecoderPageQuery = Partial<Omit<NdmDecoder, ReduceForPageQuery>>;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../../base';
|
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
|
||||||
|
|
||||||
export interface NdmKeyboardVO extends BaseModel {
|
export interface NdmKeyboard extends BaseModel {
|
||||||
deviceId: string;
|
deviceId: string;
|
||||||
name: string;
|
name: string;
|
||||||
manufacturer: string;
|
manufacturer: string;
|
||||||
@@ -25,10 +25,10 @@ export interface NdmKeyboardVO extends BaseModel {
|
|||||||
snmpEnabled: boolean;
|
snmpEnabled: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type NdmKeyboardResultVO = Partial<NdmKeyboardVO>;
|
export type NdmKeyboardResultVO = Partial<NdmKeyboard>;
|
||||||
|
|
||||||
export type NdmKeyboardSaveVO = Partial<Omit<NdmKeyboardVO, ReduceForSaveVO>>;
|
export type NdmKeyboardSaveVO = Partial<Omit<NdmKeyboard, ReduceForSaveVO>>;
|
||||||
|
|
||||||
export type NdmKeyboardUpdateVO = Partial<Omit<NdmKeyboardVO, ReduceForUpdateVO>>;
|
export type NdmKeyboardUpdateVO = Partial<Omit<NdmKeyboard, ReduceForUpdateVO>>;
|
||||||
|
|
||||||
export type NdmKeyboardPageQuery = Partial<Omit<NdmKeyboardVO, ReduceForPageQuery>>;
|
export type NdmKeyboardPageQuery = Partial<Omit<NdmKeyboard, ReduceForPageQuery>>;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../../base';
|
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
|
||||||
|
|
||||||
export interface NdmMediaServerVO extends BaseModel {
|
export interface NdmMediaServer extends BaseModel {
|
||||||
deviceId: string;
|
deviceId: string;
|
||||||
name: string;
|
name: string;
|
||||||
manufacturer: string;
|
manufacturer: string;
|
||||||
@@ -29,10 +29,10 @@ export interface NdmMediaServerVO extends BaseModel {
|
|||||||
snmpEnabled: boolean;
|
snmpEnabled: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type NdmMediaServerResultVO = Partial<NdmMediaServerVO>;
|
export type NdmMediaServerResultVO = Partial<NdmMediaServer>;
|
||||||
|
|
||||||
export type NdmMediaServerSaveVO = Partial<Omit<NdmMediaServerVO, ReduceForSaveVO>>;
|
export type NdmMediaServerSaveVO = Partial<Omit<NdmMediaServer, ReduceForSaveVO>>;
|
||||||
|
|
||||||
export type NdmMediaServerUpdateVO = Partial<Omit<NdmMediaServerVO, ReduceForUpdateVO>>;
|
export type NdmMediaServerUpdateVO = Partial<Omit<NdmMediaServer, ReduceForUpdateVO>>;
|
||||||
|
|
||||||
export type NdmMediaServerPageQuery = Partial<Omit<NdmMediaServerVO, ReduceForPageQuery>>;
|
export type NdmMediaServerPageQuery = Partial<Omit<NdmMediaServer, ReduceForPageQuery>>;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../../base';
|
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
|
||||||
|
|
||||||
export interface NdmVideoServerVO extends BaseModel {
|
export interface NdmVideoServer extends BaseModel {
|
||||||
deviceId: string;
|
deviceId: string;
|
||||||
name: string;
|
name: string;
|
||||||
manufacturer: string;
|
manufacturer: string;
|
||||||
@@ -29,10 +29,10 @@ export interface NdmVideoServerVO extends BaseModel {
|
|||||||
snmpEnabled: boolean;
|
snmpEnabled: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type NdmVideoServerResultVO = Partial<NdmVideoServerVO>;
|
export type NdmVideoServerResultVO = Partial<NdmVideoServer>;
|
||||||
|
|
||||||
export type NdmVideoServerSaveVO = Partial<Omit<NdmVideoServerVO, ReduceForSaveVO>>;
|
export type NdmVideoServerSaveVO = Partial<Omit<NdmVideoServer, ReduceForSaveVO>>;
|
||||||
|
|
||||||
export type NdmVideoServerUpdateVO = Partial<Omit<NdmVideoServerVO, ReduceForUpdateVO>>;
|
export type NdmVideoServerUpdateVO = Partial<Omit<NdmVideoServer, ReduceForUpdateVO>>;
|
||||||
|
|
||||||
export type NdmVideoServerPageQuery = Partial<Omit<NdmVideoServerVO, ReduceForPageQuery>>;
|
export type NdmVideoServerPageQuery = Partial<Omit<NdmVideoServer, ReduceForPageQuery>>;
|
||||||
4
src/apis/model/biz/index.ts
Normal file
4
src/apis/model/biz/index.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export * from './entity';
|
||||||
|
export * from './nvr';
|
||||||
|
export * from './verify';
|
||||||
|
export * from './vimp';
|
||||||
15
src/apis/model/biz/nvr/client-channel.ts
Normal file
15
src/apis/model/biz/nvr/client-channel.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
export interface ClientChannel {
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
manufacture: string;
|
||||||
|
model: string;
|
||||||
|
owner: string;
|
||||||
|
civilCode: string;
|
||||||
|
block: string;
|
||||||
|
address: string;
|
||||||
|
parental: number;
|
||||||
|
parentId: string;
|
||||||
|
status: number;
|
||||||
|
longitude: number;
|
||||||
|
latitude: number;
|
||||||
|
}
|
||||||
3
src/apis/model/biz/nvr/index.ts
Normal file
3
src/apis/model/biz/nvr/index.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export * from './client-channel';
|
||||||
|
export * from './record-info';
|
||||||
|
export * from './record-item';
|
||||||
12
src/apis/model/biz/nvr/record-info.ts
Normal file
12
src/apis/model/biz/nvr/record-info.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import type { RecordItem } from './record-item';
|
||||||
|
|
||||||
|
export interface RecordInfo {
|
||||||
|
deviceId: string;
|
||||||
|
channelId: string;
|
||||||
|
sn: string;
|
||||||
|
name: string;
|
||||||
|
sumNum: number;
|
||||||
|
count: number;
|
||||||
|
lastTime: number;
|
||||||
|
recordList: RecordItem[];
|
||||||
|
}
|
||||||
4
src/apis/model/biz/nvr/record-item.ts
Normal file
4
src/apis/model/biz/nvr/record-item.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export interface RecordItem {
|
||||||
|
startTime: string;
|
||||||
|
endTime: string;
|
||||||
|
}
|
||||||
1
src/apis/model/biz/verify/index.ts
Normal file
1
src/apis/model/biz/verify/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export * from './verify-server';
|
||||||
7
src/apis/model/biz/verify/verify-server.ts
Normal file
7
src/apis/model/biz/verify/verify-server.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export interface VerifyServer {
|
||||||
|
name: string;
|
||||||
|
ipAddress: string;
|
||||||
|
stationCode: string;
|
||||||
|
verifyUrl: string;
|
||||||
|
onlineState: boolean;
|
||||||
|
}
|
||||||
3
src/apis/model/index.ts
Normal file
3
src/apis/model/index.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export * from './base';
|
||||||
|
export * from './biz';
|
||||||
|
export * from './system';
|
||||||
17
src/apis/model/system/def-parameter.ts
Normal file
17
src/apis/model/system/def-parameter.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
|
||||||
|
|
||||||
|
export interface DefParameter extends BaseModel {
|
||||||
|
key: string;
|
||||||
|
value: string;
|
||||||
|
name: string;
|
||||||
|
remarks: string;
|
||||||
|
paramType: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type DefParameterResultVO = Partial<DefParameter>;
|
||||||
|
|
||||||
|
export type DefParameterSaveVO = Partial<Omit<DefParameter, ReduceForSaveVO>>;
|
||||||
|
|
||||||
|
export type DefParameterUpdateVO = Partial<Omit<DefParameter, ReduceForUpdateVO>>;
|
||||||
|
|
||||||
|
export type DefParameterPageQuery = Partial<Omit<DefParameter, ReduceForPageQuery>>;
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
import type { NdmSecurityBoxVO } from './other/ndm-security-box';
|
|
||||||
import type { NdmSwitchVO } from './other/ndm-switch';
|
|
||||||
import type { NdmNvrVO } from './storage/ndm-nvr';
|
|
||||||
import type { NdmCameraVO } from './video/ndm-camera';
|
|
||||||
import type { NdmDecoderVO } from './video/ndm-decoder';
|
|
||||||
import type { NdmKeyboardVO } from './video/ndm-keyboard';
|
|
||||||
import type { NdmMediaServerVO } from './video/ndm-media-server';
|
|
||||||
import type { NdmVideoServerVO } from './video/ndm-video-server';
|
|
||||||
|
|
||||||
export * from './log';
|
|
||||||
export * from './other';
|
|
||||||
export * from './storage';
|
|
||||||
export * from './video';
|
|
||||||
|
|
||||||
export type NdmDeviceVO = NdmSecurityBoxVO | NdmSwitchVO | NdmNvrVO | NdmCameraVO | NdmDecoderVO | NdmKeyboardVO | NdmMediaServerVO | NdmVideoServerVO;
|
|
||||||
export type NdmDeviceResultVO = Partial<NdmDeviceVO>;
|
|
||||||
export type NdmServerVO = NdmMediaServerVO | NdmVideoServerVO;
|
|
||||||
export type NdmServerResultVO = Partial<NdmServerVO>;
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
import type { BaseModel, ReduceForPageQuery, ReduceForSaveVO, ReduceForUpdateVO } from '../../base';
|
|
||||||
|
|
||||||
export interface NdmCallLogVO extends BaseModel {
|
|
||||||
sourceGbId: string;
|
|
||||||
targetGbId: string;
|
|
||||||
method: string;
|
|
||||||
messageType: string;
|
|
||||||
cmdType: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type NdmCallLogResultVO = Partial<NdmCallLogVO>;
|
|
||||||
|
|
||||||
export type NdmCallLogSaveVO = Partial<Omit<NdmCallLogVO, ReduceForSaveVO>>;
|
|
||||||
|
|
||||||
export type NdmCallLogUpdateVO = Partial<Omit<NdmCallLogVO, ReduceForUpdateVO>>;
|
|
||||||
|
|
||||||
export type NdmCallLogPageQuery = Partial<Omit<NdmCallLogVO, ReduceForPageQuery>>;
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../../base';
|
|
||||||
|
|
||||||
export interface NdmIcmpLogVO extends BaseModel {
|
|
||||||
deviceId: string;
|
|
||||||
name: string;
|
|
||||||
ipAddress: string;
|
|
||||||
deviceStatus: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type NdmIcmpLogResultVO = Partial<NdmIcmpLogVO>;
|
|
||||||
|
|
||||||
export type NdmIcmpLogSaveVO = Partial<Omit<NdmIcmpLogVO, ReduceForSaveVO>>;
|
|
||||||
|
|
||||||
export type NdmIcmpLogUpdateVO = Partial<Omit<NdmIcmpLogVO, ReduceForUpdateVO>>;
|
|
||||||
|
|
||||||
export type NdmIcmpLogPageQuery = Partial<Omit<NdmIcmpLogVO, ReduceForPageQuery>>;
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../../base';
|
|
||||||
|
|
||||||
export interface NdmSnmpLogVO extends BaseModel {
|
|
||||||
deviceId: string;
|
|
||||||
name: string;
|
|
||||||
ipAddress: string;
|
|
||||||
diagInfo: string;
|
|
||||||
deviceType: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type NdmSnmpLogResultVO = Partial<NdmSnmpLogVO>;
|
|
||||||
|
|
||||||
export type NdmSnmpLogSaveVO = Partial<Omit<NdmSnmpLogVO, ReduceForSaveVO>>;
|
|
||||||
|
|
||||||
export type NdmSnmpLogUpdateVO = Partial<Omit<NdmSnmpLogVO, ReduceForUpdateVO>>;
|
|
||||||
|
|
||||||
export type NdmSnmpLogPageQuery = Partial<Omit<NdmSnmpLogVO, ReduceForPageQuery>>;
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../../base';
|
|
||||||
|
|
||||||
export interface NdmVimpLogVO extends BaseModel {
|
|
||||||
requestIp: string;
|
|
||||||
description: string;
|
|
||||||
classPath: string;
|
|
||||||
methodName: string;
|
|
||||||
startTime: string;
|
|
||||||
endTime: string;
|
|
||||||
consumedTime: string;
|
|
||||||
params: string;
|
|
||||||
result: string;
|
|
||||||
httpMethod: string;
|
|
||||||
userId: string;
|
|
||||||
logType: number;
|
|
||||||
targetCode: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type NdmVimpLogResultVO = Partial<NdmVimpLogVO>;
|
|
||||||
|
|
||||||
export type NdmVimpLogSaveVO = Partial<Omit<NdmVimpLogVO, ReduceForSaveVO>>;
|
|
||||||
|
|
||||||
export type NdmVimpLogUpdateVO = Partial<Omit<NdmVimpLogVO, ReduceForUpdateVO>>;
|
|
||||||
|
|
||||||
export type NdmVimpLogPageQuery = Partial<Omit<NdmVimpLogVO, ReduceForPageQuery>>;
|
|
||||||
@@ -1,133 +0,0 @@
|
|||||||
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../../base';
|
|
||||||
|
|
||||||
export interface NdmNvrVO extends BaseModel {
|
|
||||||
deviceId: string;
|
|
||||||
name: string;
|
|
||||||
manufacturer: string;
|
|
||||||
state: boolean;
|
|
||||||
model: string;
|
|
||||||
ipAddress: string;
|
|
||||||
manageUrl: string;
|
|
||||||
manageUsername: string;
|
|
||||||
managePassword: string;
|
|
||||||
gbCode: string;
|
|
||||||
gbPort: number;
|
|
||||||
gbDomain: string;
|
|
||||||
gb28181Enabled: boolean;
|
|
||||||
onvifPort: number;
|
|
||||||
onvifUsername: string;
|
|
||||||
onvifPassword: string;
|
|
||||||
onvifMajorIndex: number;
|
|
||||||
onvifMinorIndex: number;
|
|
||||||
diagFlag: string;
|
|
||||||
diagParam: string;
|
|
||||||
diagFormat: string;
|
|
||||||
lastDiagInfo: string;
|
|
||||||
lastDiagTime: string;
|
|
||||||
icmpEnabled: boolean;
|
|
||||||
description: string;
|
|
||||||
deviceStatus: string;
|
|
||||||
deviceType: string;
|
|
||||||
community: string;
|
|
||||||
frontendConfig: string;
|
|
||||||
linkDescription: string;
|
|
||||||
snmpEnabled: boolean;
|
|
||||||
recordCheckEnabled: boolean;
|
|
||||||
clusterList: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type NdmNvrResultVO = Partial<NdmNvrVO>;
|
|
||||||
|
|
||||||
export type NdmNvrSaveVO = Partial<Omit<NdmNvrVO, ReduceForSaveVO>>;
|
|
||||||
|
|
||||||
export type NdmNvrUpdateVO = Partial<Omit<NdmNvrVO, ReduceForUpdateVO>>;
|
|
||||||
|
|
||||||
export type NdmNvrPageQuery = Partial<Omit<NdmNvrVO, ReduceForPageQuery>>;
|
|
||||||
|
|
||||||
export interface RecordSum {
|
|
||||||
code: string;
|
|
||||||
recordList: NdmRecordCheck[];
|
|
||||||
channel: ClientChannel;
|
|
||||||
availableRecordList: UnixRecordItem[];
|
|
||||||
unavailableRecordList: UnixRecordItem[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface NdmRecordCheck extends BaseModel {
|
|
||||||
gbCode: string;
|
|
||||||
parentGbCode: string;
|
|
||||||
name: string;
|
|
||||||
ipAddress: string;
|
|
||||||
diagInfo: string; // RecordInfo
|
|
||||||
checkDate: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ClientChannel {
|
|
||||||
code: string;
|
|
||||||
name: string;
|
|
||||||
manufacture: string;
|
|
||||||
model: string;
|
|
||||||
owner: string;
|
|
||||||
civilCode: string;
|
|
||||||
block: string;
|
|
||||||
address: string;
|
|
||||||
parental: number;
|
|
||||||
parentId: string;
|
|
||||||
status: number;
|
|
||||||
longitude: number;
|
|
||||||
latitude: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RecordInfo {
|
|
||||||
deviceId: string;
|
|
||||||
channelId: string;
|
|
||||||
sn: string;
|
|
||||||
name: string;
|
|
||||||
sumNum: number;
|
|
||||||
count: number;
|
|
||||||
lastTime: number;
|
|
||||||
recordList: RecordItem[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RecordItem {
|
|
||||||
startTime: string;
|
|
||||||
endTime: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface UnixRecordItem {
|
|
||||||
startTime: number;
|
|
||||||
endTime: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface QueryGbRecordBody {
|
|
||||||
code: string;
|
|
||||||
start: string;
|
|
||||||
end: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface QueryGbDeviceBody {
|
|
||||||
code: string;
|
|
||||||
time: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface QueryRecordCheckBody {
|
|
||||||
parentId: string;
|
|
||||||
start: string;
|
|
||||||
end: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface QueryReloadCheckBody {
|
|
||||||
code: string;
|
|
||||||
name: string;
|
|
||||||
manufacture: string;
|
|
||||||
model: string;
|
|
||||||
owner: string;
|
|
||||||
civilCode: string;
|
|
||||||
block: string;
|
|
||||||
address: string;
|
|
||||||
parental: number;
|
|
||||||
parentId: string;
|
|
||||||
status: number;
|
|
||||||
longitude: number;
|
|
||||||
latitude: number;
|
|
||||||
dayOffset: number;
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
export * from './base';
|
|
||||||
export * from './device';
|
|
||||||
export * from './system';
|
|
||||||
export * from './user';
|
|
||||||
export * from './vimp';
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../base';
|
|
||||||
|
|
||||||
export interface DefParameterVO extends BaseModel {
|
|
||||||
key: string;
|
|
||||||
value: string;
|
|
||||||
name: string;
|
|
||||||
remarks: string;
|
|
||||||
paramType: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type DefParameterResultVO = Partial<DefParameterVO>;
|
|
||||||
|
|
||||||
export type DefParameterSaveVO = Partial<Omit<DefParameterVO, ReduceForSaveVO>>;
|
|
||||||
|
|
||||||
export type DefParameterUpdateVO = Partial<Omit<DefParameterVO, ReduceForUpdateVO>>;
|
|
||||||
|
|
||||||
export type DefParameterPageQuery = Partial<Omit<DefParameterVO, ReduceForPageQuery>>;
|
|
||||||
39
src/apis/request/biz/composed/detail-device.ts
Normal file
39
src/apis/request/biz/composed/detail-device.ts
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
import { detailCameraApi, detailDevoderApi, detailKeyboardAPi, detailMediaServerApi, detailNvr, detailSecurityBoxApi, detailSwitchApi, detailVideoServerApi, type NdmDeviceResultVO } from '@/apis';
|
||||||
|
import { DeviceType, tryGetDeviceTypeVal } from '@/enums';
|
||||||
|
|
||||||
|
export const detailDeviceApi = async (device: NdmDeviceResultVO, options?: { stationCode?: string; signal?: AbortSignal }): Promise<NdmDeviceResultVO | undefined> => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const { id, deviceType: deviceTypeCode } = device;
|
||||||
|
if (!id || !deviceTypeCode) {
|
||||||
|
throw new Error('未知的设备');
|
||||||
|
}
|
||||||
|
const deviceTypeVal = tryGetDeviceTypeVal(deviceTypeCode);
|
||||||
|
if (!deviceTypeVal) {
|
||||||
|
throw new Error('未知的设备类型');
|
||||||
|
}
|
||||||
|
if (deviceTypeVal === DeviceType.Camera) {
|
||||||
|
return await detailCameraApi(id, { stationCode, signal });
|
||||||
|
}
|
||||||
|
if (deviceTypeVal === DeviceType.Decoder) {
|
||||||
|
return await detailDevoderApi(id, { stationCode, signal });
|
||||||
|
}
|
||||||
|
if (deviceTypeVal === DeviceType.Keyboard) {
|
||||||
|
return await detailKeyboardAPi(id, { stationCode, signal });
|
||||||
|
}
|
||||||
|
if (deviceTypeVal === DeviceType.MediaServer) {
|
||||||
|
return await detailMediaServerApi(id, { stationCode, signal });
|
||||||
|
}
|
||||||
|
if (deviceTypeVal === DeviceType.Nvr) {
|
||||||
|
return await detailNvr(id, { stationCode, signal });
|
||||||
|
}
|
||||||
|
if (deviceTypeVal === DeviceType.SecurityBox) {
|
||||||
|
return await detailSecurityBoxApi(id, { stationCode, signal });
|
||||||
|
}
|
||||||
|
if (deviceTypeVal === DeviceType.Switch) {
|
||||||
|
return await detailSwitchApi(id, { stationCode, signal });
|
||||||
|
}
|
||||||
|
if (deviceTypeVal === DeviceType.VideoServer) {
|
||||||
|
return await detailVideoServerApi(id, { stationCode, signal });
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
};
|
||||||
2
src/apis/request/biz/composed/index.ts
Normal file
2
src/apis/request/biz/composed/index.ts
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export * from './detail-device';
|
||||||
|
export * from './probe-device';
|
||||||
35
src/apis/request/biz/composed/probe-device.ts
Normal file
35
src/apis/request/biz/composed/probe-device.ts
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import { probeDecoderApi, probeMediaServerApi, probeNvrApi, probeSecurityBoxApi, probeSwitchApi, probeVideoServerApi, type NdmDeviceResultVO } from '@/apis';
|
||||||
|
import { DeviceType, tryGetDeviceTypeVal } from '@/enums';
|
||||||
|
|
||||||
|
export const probeDeviceApi = async (device: NdmDeviceResultVO, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const deviceType = tryGetDeviceTypeVal(device.deviceType);
|
||||||
|
const deviceDbId = device.id;
|
||||||
|
if (!deviceType || !deviceDbId) {
|
||||||
|
throw new Error('未知的设备');
|
||||||
|
}
|
||||||
|
if (deviceType === DeviceType.Decoder) {
|
||||||
|
await probeDecoderApi([deviceDbId], { stationCode, signal });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (deviceType === DeviceType.MediaServer) {
|
||||||
|
await probeMediaServerApi([deviceDbId], { stationCode, signal });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (deviceType === DeviceType.Nvr) {
|
||||||
|
await probeNvrApi([deviceDbId], { stationCode, signal });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (deviceType === DeviceType.SecurityBox) {
|
||||||
|
await probeSecurityBoxApi([deviceDbId], { stationCode, signal });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (deviceType === DeviceType.Switch) {
|
||||||
|
await probeSwitchApi([deviceDbId], { stationCode, signal });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (deviceType === DeviceType.VideoServer) {
|
||||||
|
await probeVideoServerApi([deviceDbId], { stationCode, signal });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
};
|
||||||
13
src/apis/request/biz/constant/reset-monitor-shedule.ts
Normal file
13
src/apis/request/biz/constant/reset-monitor-shedule.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { ndmClient, userClient } from '@/apis';
|
||||||
|
|
||||||
|
export const resetMonitorScheduleApi = async (options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmConstant/anyTenant/resetMonitorSchedule`;
|
||||||
|
const resp = await client.get<void>(endpoint, { signal });
|
||||||
|
const [err] = resp;
|
||||||
|
if (err) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
};
|
||||||
12
src/apis/request/biz/icmp/batch-verify.ts
Normal file
12
src/apis/request/biz/icmp/batch-verify.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import { userClient, type VerifyServer } from '@/apis';
|
||||||
|
|
||||||
|
export const batchVerifyApi = async (options?: { signal?: AbortSignal }) => {
|
||||||
|
const { signal } = options ?? {};
|
||||||
|
const endpoint = '/api/ndm/ndmKeepAlive/batchVerify';
|
||||||
|
const resp = await userClient.post<VerifyServer[]>(endpoint, {}, { retRaw: true, timeout: 5000, signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
3
src/apis/request/biz/icmp/index.ts
Normal file
3
src/apis/request/biz/icmp/index.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export * from './batch-verify';
|
||||||
|
export * from './ndm-icmp-export';
|
||||||
|
export * from './verify';
|
||||||
@@ -1,13 +1,15 @@
|
|||||||
import { ndmClient } from '@/apis';
|
import { userClient } from '@/apis';
|
||||||
|
|
||||||
export const ndmExportDevices = async (status?: string) => {
|
export const exportIcmpApi = async (status?: string, options?: { signal?: AbortSignal }) => {
|
||||||
|
const { signal } = options ?? {};
|
||||||
const endpoint = '/api/ndm/ndmIcmpExport/exportByTemplate';
|
const endpoint = '/api/ndm/ndmIcmpExport/exportByTemplate';
|
||||||
const body = new URLSearchParams();
|
const body = new URLSearchParams();
|
||||||
body.append('status', status ?? '');
|
body.append('status', status ?? '');
|
||||||
const resp = await ndmClient.post<Blob>(endpoint, body, {
|
const resp = await userClient.post<Blob>(endpoint, body, {
|
||||||
responseType: 'blob',
|
responseType: 'blob',
|
||||||
retRaw: true,
|
retRaw: true,
|
||||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||||
|
signal,
|
||||||
});
|
});
|
||||||
const [err, data] = resp;
|
const [err, data] = resp;
|
||||||
if (err || !data) {
|
if (err || !data) {
|
||||||
13
src/apis/request/biz/icmp/verify.ts
Normal file
13
src/apis/request/biz/icmp/verify.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { ndmClient, userClient } from '@/apis';
|
||||||
|
|
||||||
|
export const verifyApi = async (options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmKeepAlive/verify`;
|
||||||
|
const resp = await client.post<void>(endpoint, {}, { timeout: 5000, signal });
|
||||||
|
const [err] = resp;
|
||||||
|
if (err) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
};
|
||||||
27
src/apis/request/biz/log/ndm-call-log.ts
Normal file
27
src/apis/request/biz/log/ndm-call-log.ts
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import { ndmClient, userClient, type NdmCallLogPageQuery, type NdmCallLogResultVO, type PageParams, type PageResult } from '@/apis';
|
||||||
|
|
||||||
|
export const pageCallLogApi = async (pageQuery: PageParams<NdmCallLogPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmCallLog/page`;
|
||||||
|
const resp = await client.post<PageResult<NdmCallLogResultVO>>(endpoint, pageQuery, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const exportCallLogApi = async (pageQuery: PageParams<NdmCallLogPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmCallLog/defaultExportByTemplate`;
|
||||||
|
const resp = await client.post<Blob>(endpoint, pageQuery, { responseType: 'blob', retRaw: true, signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
40
src/apis/request/biz/log/ndm-device-alarm-log.ts
Normal file
40
src/apis/request/biz/log/ndm-device-alarm-log.ts
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
import { ndmClient, userClient, type NdmDeviceAlarmLogPageQuery, type NdmDeviceAlarmLogResultVO, type NdmDeviceAlarmLogUpdateVO, type PageParams, type PageResult } from '@/apis';
|
||||||
|
|
||||||
|
export const pageDeviceAlarmLogApi = async (pageQuery: PageParams<NdmDeviceAlarmLogPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmDeviceAlarmLog/page`;
|
||||||
|
const resp = await client.post<PageResult<NdmDeviceAlarmLogResultVO>>(endpoint, pageQuery, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const updateDeviceAlarmLogApi = async (updateVO: NdmDeviceAlarmLogUpdateVO, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmDeviceAlarmLog`;
|
||||||
|
const resp = await client.put<NdmDeviceAlarmLogResultVO>(endpoint, updateVO, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const exportDeviceAlarmLogApi = async (pageQuery: PageParams<NdmDeviceAlarmLogPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmDeviceAlarmLog/defaultExportByTemplate`;
|
||||||
|
const resp = await client.post<BlobPart>(endpoint, pageQuery, { responseType: 'blob', retRaw: true, signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
14
src/apis/request/biz/log/ndm-icmp-log.ts
Normal file
14
src/apis/request/biz/log/ndm-icmp-log.ts
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import { ndmClient, userClient, type NdmIcmpLogPageQuery, type NdmIcmpLogResultVO, type PageParams, type PageResult } from '@/apis';
|
||||||
|
|
||||||
|
export const pageIcmpLogApi = async (pageQuery: PageParams<NdmIcmpLogPageQuery>, options?: { stationCode: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmIcmpLog/page`;
|
||||||
|
const resp = await client.post<PageResult<NdmIcmpLogResultVO>>(endpoint, pageQuery, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
14
src/apis/request/biz/log/ndm-snmp-log.ts
Normal file
14
src/apis/request/biz/log/ndm-snmp-log.ts
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
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;
|
||||||
|
};
|
||||||
27
src/apis/request/biz/log/ndm-vimp-log.ts
Normal file
27
src/apis/request/biz/log/ndm-vimp-log.ts
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import { ndmClient, userClient, type NdmVimpLogPageQuery, type NdmVimpLogResultVO, type PageParams, type PageResult } from '@/apis';
|
||||||
|
|
||||||
|
export const pageVimpLogApi = async (pageQuery: PageParams<NdmVimpLogPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmVimpLog/page`;
|
||||||
|
const resp = await client.post<PageResult<NdmVimpLogResultVO>>(endpoint, pageQuery, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const exportVimpLogApi = async (pageQuery: PageParams<NdmVimpLogPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmVimpLog/defaultExportByTemplate`;
|
||||||
|
const resp = await client.post<Blob>(endpoint, pageQuery, { responseType: 'blob', retRaw: true, signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
78
src/apis/request/biz/other/ndm-security-box.ts
Normal file
78
src/apis/request/biz/other/ndm-security-box.ts
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
import { ndmClient, userClient, type NdmSecurityBoxPageQuery, type NdmSecurityBoxResultVO, type NdmSecurityBoxUpdateVO, type PageParams, type PageResult } from '@/apis';
|
||||||
|
|
||||||
|
export const pageSecurityBoxApi = async (pageQuery: PageParams<NdmSecurityBoxPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmSecurityBox/page`;
|
||||||
|
const resp = await client.post<PageResult<NdmSecurityBoxResultVO>>(endpoint, pageQuery, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const detailSecurityBoxApi = async (id: string, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmSecurityBox/detail`;
|
||||||
|
const resp = await client.get<NdmSecurityBoxResultVO>(endpoint, { params: { id }, signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const updateSecurityBoxApi = async (updateVO: NdmSecurityBoxUpdateVO, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmSecurityBox`;
|
||||||
|
const resp = await client.put<NdmSecurityBoxResultVO>(endpoint, updateVO, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const probeSecurityBoxApi = async (ids: string[], options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmSecurityBox/probeByIds`;
|
||||||
|
const resp = await client.post<void>(endpoint, ids, { signal });
|
||||||
|
const [err] = resp;
|
||||||
|
if (err) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const turnCircuitStatusApi = async (ipAddress: string, circuitIndex: number, status: number, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmSecurityBox/turnStatus`;
|
||||||
|
const resp = await client.post<boolean>(endpoint, { community: 'public', ipAddress, circuit: `${circuitIndex}`, status }, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const rebootSecurityBoxApi = async (ipAddress: string, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmSecurityBox/reboot`;
|
||||||
|
const resp = await client.post<boolean>(endpoint, { community: 'public', ipAddress }, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
52
src/apis/request/biz/other/ndm-switch.ts
Normal file
52
src/apis/request/biz/other/ndm-switch.ts
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
import { ndmClient, userClient, type NdmSwitchPageQuery, type NdmSwitchResultVO, type NdmSwitchUpdateVO, type PageParams, type PageResult } from '@/apis';
|
||||||
|
|
||||||
|
export const pageSwitchApi = async (pageQuery: PageParams<NdmSwitchPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmSwitch/page`;
|
||||||
|
const resp = await client.post<PageResult<NdmSwitchResultVO>>(endpoint, pageQuery, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const detailSwitchApi = async (id: string, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmSwitch/detail`;
|
||||||
|
const resp = await client.get<NdmSwitchResultVO>(endpoint, { params: { id }, signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const updateSwitchApi = async (updateVO: NdmSwitchUpdateVO, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmSwitch`;
|
||||||
|
const resp = await client.put<NdmSwitchResultVO>(endpoint, updateVO, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const probeSwitchApi = async (ids: string[], options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmSwitch/probeByIds`;
|
||||||
|
const resp = await client.post<void>(endpoint, ids, { signal });
|
||||||
|
const [err] = resp;
|
||||||
|
if (err) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
};
|
||||||
110
src/apis/request/biz/storage/ndm-nvr.ts
Normal file
110
src/apis/request/biz/storage/ndm-nvr.ts
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
import { ndmClient, userClient, type ClientChannel, type NdmNvrPageQuery, type NdmNvrResultVO, type NdmNvrUpdateVO, type NdmRecordCheck, type PageParams, type PageResult } from '@/apis';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
|
export const pageNvrApi = async (pageQuery: PageParams<NdmNvrPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const cient = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmNvr/page`;
|
||||||
|
const resp = await cient.post<PageResult<NdmNvrResultVO>>(endpoint, pageQuery, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const detailNvr = async (id: string, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const cient = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmNvr/detail`;
|
||||||
|
const resp = await cient.get<NdmNvrResultVO>(endpoint, { params: { id }, signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const updateNvr = async (updateVO: NdmNvrUpdateVO, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmNvr`;
|
||||||
|
const resp = await client.put<NdmNvrResultVO>(endpoint, updateVO, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const probeNvrApi = async (ids: string[], options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmNvr/probeByIds`;
|
||||||
|
const resp = await client.post<void>(endpoint, ids, { signal });
|
||||||
|
const [err] = resp;
|
||||||
|
if (err) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getChannelListApi = async (ndmNvr: NdmNvrResultVO, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmRecordCheck/getChannelList`;
|
||||||
|
const resp = await client.post<ClientChannel[]>(endpoint, { code: ndmNvr.gbCode, time: '' }, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getRecordCheckApi = async (ndmNvr: NdmNvrResultVO, lastDays: number, gbCodeList: string[], options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmRecordCheck/getRecordCheckByParentId`;
|
||||||
|
const endDateTime = dayjs();
|
||||||
|
const startDateTime = endDateTime.subtract(lastDays, 'day');
|
||||||
|
const start = startDateTime.format('YYYY-MM-DD');
|
||||||
|
const end = endDateTime.format('YYYY-MM-DD');
|
||||||
|
const parentId = ndmNvr.gbCode;
|
||||||
|
const resp = await client.post<NdmRecordCheck[]>(endpoint, { start, end, parentId, gbCodeList }, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const reloadRecordCheckApi = async (channel: ClientChannel, dayOffset: number, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmRecordCheck/reloadRecordCheckByGbId`;
|
||||||
|
const resp = await client.post<boolean>(endpoint, { ...channel, dayOffset }, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const reloadAllRecordCheckApi = async (dayOffset: number, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmRecordCheck/reloadAllRecordCheck`;
|
||||||
|
const resp = await client.post<boolean>(endpoint, dayOffset, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
51
src/apis/request/biz/video/ndm-camera.ts
Normal file
51
src/apis/request/biz/video/ndm-camera.ts
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import { ndmClient, userClient, type NdmCameraPageQuery, type NdmCameraResultVO, type NdmCameraUpdateVO, type PageParams, type PageResult, type SnapResult } from '@/apis';
|
||||||
|
|
||||||
|
export const pageCameraApi = async (pageQuery: PageParams<NdmCameraPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmCamera/page`;
|
||||||
|
const resp = await client.post<PageResult<NdmCameraResultVO>>(endpoint, pageQuery, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const detailCameraApi = async (id: string, optioins?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = optioins ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmCamera/detail`;
|
||||||
|
const resp = await client.get<NdmCameraResultVO>(endpoint, { params: { id }, signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const updateCameraApi = async (updateVO: NdmCameraUpdateVO, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmCamera`;
|
||||||
|
const resp = await client.put<NdmCameraResultVO>(endpoint, updateVO, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getCameraSnapApi = async (deviceId: string, options?: { signal?: AbortSignal }) => {
|
||||||
|
const { signal } = options ?? {};
|
||||||
|
const endpoint = '/api/ndm/ndmCamera/getSnapByDeviceId';
|
||||||
|
const resp = await ndmClient.get<SnapResult>(endpoint, { params: { deviceId }, signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
52
src/apis/request/biz/video/ndm-decoder.ts
Normal file
52
src/apis/request/biz/video/ndm-decoder.ts
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
import { ndmClient, userClient, type NdmDecoderPageQuery, type NdmDecoderResultVO, type NdmDecoderUpdateVO, type PageParams, type PageResult } from '@/apis';
|
||||||
|
|
||||||
|
export const pageDecoderApi = async (pageQuery: PageParams<NdmDecoderPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmDecoder/page`;
|
||||||
|
const resp = await client.post<PageResult<NdmDecoderResultVO>>(endpoint, pageQuery, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const detailDevoderApi = async (id: string, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmDecoder/detail`;
|
||||||
|
const resp = await client.get<NdmDecoderResultVO>(endpoint, { params: { id }, signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const updateDecoderApi = async (updateVO: NdmDecoderUpdateVO, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmDecoder`;
|
||||||
|
const resp = await client.put<NdmDecoderResultVO>(endpoint, updateVO, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const probeDecoderApi = async (ids: string[], options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmDecoder/probeByIds`;
|
||||||
|
const resp = await client.post<void>(endpoint, ids, { signal });
|
||||||
|
const [err] = resp;
|
||||||
|
if (err) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
};
|
||||||
40
src/apis/request/biz/video/ndm-keyboard.ts
Normal file
40
src/apis/request/biz/video/ndm-keyboard.ts
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
import { ndmClient, userClient, type NdmKeyboardPageQuery, type NdmKeyboardResultVO, type NdmKeyboardUpdateVO, type PageParams, type PageResult } from '@/apis';
|
||||||
|
|
||||||
|
export const pageKeyboardApi = async (pageQuery: PageParams<NdmKeyboardPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmKeyboard/page`;
|
||||||
|
const resp = await client.post<PageResult<NdmKeyboardResultVO>>(endpoint, pageQuery, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const detailKeyboardAPi = async (id: string, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmKeyboard/detail`;
|
||||||
|
const resp = await client.get<NdmKeyboardResultVO>(endpoint, { params: { id }, signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const updateKeyboardApi = async (updateVO: NdmKeyboardUpdateVO, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmKeyboard`;
|
||||||
|
const resp = await client.put<NdmKeyboardResultVO>(endpoint, updateVO, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
52
src/apis/request/biz/video/ndm-media-server.ts
Normal file
52
src/apis/request/biz/video/ndm-media-server.ts
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
import { ndmClient, userClient, type NdmMediaServerPageQuery, type NdmMediaServerResultVO, type NdmMediaServerUpdateVO, type PageParams, type PageResult } from '@/apis';
|
||||||
|
|
||||||
|
export const pageMediaServerApi = async (pageQuery: PageParams<NdmMediaServerPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmMediaServer/page`;
|
||||||
|
const resp = await client.post<PageResult<NdmMediaServerResultVO>>(endpoint, pageQuery, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const detailMediaServerApi = async (id: string, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmMediaServer/detail`;
|
||||||
|
const resp = await client.get<NdmMediaServerResultVO>(endpoint, { params: { id }, signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const updateMediaServerApi = async (updateVO: NdmMediaServerUpdateVO, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmMediaServer`;
|
||||||
|
const resp = await client.put<NdmMediaServerResultVO>(endpoint, updateVO, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const probeMediaServerApi = async (ids: string[], options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmMediaServer/probeByIds`;
|
||||||
|
const resp = await client.post<void>(endpoint, ids, { signal });
|
||||||
|
const [err] = resp;
|
||||||
|
if (err) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
};
|
||||||
52
src/apis/request/biz/video/ndm-video-server.ts
Normal file
52
src/apis/request/biz/video/ndm-video-server.ts
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
import { ndmClient, userClient, type NdmVideoServerPageQuery, type NdmVideoServerResultVO, type NdmVideoServerUpdateVO, type PageParams, type PageResult } from '@/apis';
|
||||||
|
|
||||||
|
export const pageVideoServerApi = async (pageQuery: PageParams<NdmVideoServerPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmVideoServer/page`;
|
||||||
|
const resp = await client.post<PageResult<NdmVideoServerResultVO>>(endpoint, pageQuery, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const detailVideoServerApi = async (id: string, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmVideoServer/detail`;
|
||||||
|
const resp = await client.get<NdmVideoServerResultVO>(endpoint, { params: { id }, signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const updateVideoServerApi = async (updateVO: NdmVideoServerUpdateVO, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmVideoServer`;
|
||||||
|
const resp = await client.put<NdmVideoServerResultVO>(endpoint, updateVO, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const probeVideoServerApi = async (ids: string[], options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/ndm/ndmVideoServer/probeByIds`;
|
||||||
|
const resp = await client.post<void>(endpoint, ids, { signal });
|
||||||
|
const [err] = resp;
|
||||||
|
if (err) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
};
|
||||||
2
src/apis/request/index.ts
Normal file
2
src/apis/request/index.ts
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export * from './biz';
|
||||||
|
export * from './system';
|
||||||
28
src/apis/request/system/def-parameter.ts
Normal file
28
src/apis/request/system/def-parameter.ts
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import { ndmClient, userClient, type DefParameterPageQuery, type DefParameterResultVO, type DefParameterUpdateVO, type PageParams, type PageResult } from '@/apis';
|
||||||
|
import type { Result } from '@/axios';
|
||||||
|
|
||||||
|
export const pageDefParameterApi = async (pageQuery: PageParams<DefParameterPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/system/defParameter/page`;
|
||||||
|
const resp = await client.post<PageResult<DefParameterResultVO>>(endpoint, pageQuery, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const updateDefParameterApi = async (updateVO: DefParameterUpdateVO, options?: { stationCode?: string; signal?: AbortSignal }) => {
|
||||||
|
const { stationCode, signal } = options ?? {};
|
||||||
|
const client = stationCode ? ndmClient : userClient;
|
||||||
|
const prefix = stationCode ? `/${stationCode}` : '';
|
||||||
|
const endpoint = `${prefix}/api/system/defParameter`;
|
||||||
|
const resp = await client.put<Result<DefParameterResultVO>>(endpoint, { ...updateVO }, { signal });
|
||||||
|
const [err, data] = resp;
|
||||||
|
if (err || !data) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
import {
|
|
||||||
getNdmDecoderDetail,
|
|
||||||
getNdmKeyboardDetail,
|
|
||||||
getNdmMediaServerDetail,
|
|
||||||
getNdmNvrDetail,
|
|
||||||
getNdmSecurityBoxDetail,
|
|
||||||
getNdmSwitchDetail,
|
|
||||||
getNdmVideoServerDetail,
|
|
||||||
type NdmDeviceResultVO,
|
|
||||||
} from '@/apis';
|
|
||||||
import { DeviceType } from '@/enums';
|
|
||||||
|
|
||||||
export const getDeviceDetailApi = async (stationCode: string, id?: string, deviceType?: string): Promise<NdmDeviceResultVO | undefined> => {
|
|
||||||
if (!id || !deviceType) {
|
|
||||||
throw new Error('未知的设备');
|
|
||||||
}
|
|
||||||
if (deviceType === DeviceType.Camera) {
|
|
||||||
return await getNdmVideoServerDetail(stationCode, id);
|
|
||||||
}
|
|
||||||
if (deviceType === DeviceType.Decoder) {
|
|
||||||
return await getNdmDecoderDetail(stationCode, id);
|
|
||||||
}
|
|
||||||
if (deviceType === DeviceType.Keyboard) {
|
|
||||||
return await getNdmKeyboardDetail(stationCode, id);
|
|
||||||
}
|
|
||||||
if (deviceType === DeviceType.MediaServer) {
|
|
||||||
return await getNdmMediaServerDetail(stationCode, id);
|
|
||||||
}
|
|
||||||
if (deviceType === DeviceType.Nvr) {
|
|
||||||
return await getNdmNvrDetail(stationCode, id);
|
|
||||||
}
|
|
||||||
if (deviceType === DeviceType.SecurityBox) {
|
|
||||||
return await getNdmSecurityBoxDetail(stationCode, id);
|
|
||||||
}
|
|
||||||
if (deviceType === DeviceType.Switch) {
|
|
||||||
return await getNdmSwitchDetail(stationCode, id);
|
|
||||||
}
|
|
||||||
if (deviceType === DeviceType.VideoServer) {
|
|
||||||
return await getNdmVideoServerDetail(stationCode, id);
|
|
||||||
}
|
|
||||||
return undefined;
|
|
||||||
};
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
export * from './get-device-detail';
|
|
||||||
export * from './probe-device';
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
import { probeNdmDecoderByIds, probeNdmMediaServerByIds, probeNdmNvrByIds, probeNdmSecurityBoxByIds, probeNdmSwitchByIds, probeNdmVideoServerByIds, type NdmDeviceResultVO } from '@/apis';
|
|
||||||
import { DeviceType, tryGetDeviceTypeVal } from '@/enums';
|
|
||||||
|
|
||||||
export const probeDeviceApi = async (stationCode: string, device: NdmDeviceResultVO) => {
|
|
||||||
const deviceType = tryGetDeviceTypeVal(device.deviceType);
|
|
||||||
const deviceDbId = device.id;
|
|
||||||
if (!deviceType || !deviceDbId) {
|
|
||||||
throw new Error('未知的设备');
|
|
||||||
}
|
|
||||||
if (deviceType === DeviceType.Decoder) {
|
|
||||||
await probeNdmDecoderByIds(stationCode, [deviceDbId]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (deviceType === DeviceType.Nvr) {
|
|
||||||
await probeNdmNvrByIds(stationCode, [deviceDbId]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (deviceType === DeviceType.SecurityBox) {
|
|
||||||
await probeNdmSecurityBoxByIds(stationCode, [deviceDbId]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (deviceType === DeviceType.MediaServer) {
|
|
||||||
await probeNdmMediaServerByIds(stationCode, [deviceDbId]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (deviceType === DeviceType.Switch) {
|
|
||||||
await probeNdmSwitchByIds(stationCode, [deviceDbId]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (deviceType === DeviceType.VideoServer) {
|
|
||||||
await probeNdmVideoServerByIds(stationCode, [deviceDbId]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user