diff --git a/src/apis/clients/index.ts b/src/apis/client/index.ts similarity index 100% rename from src/apis/clients/index.ts rename to src/apis/client/index.ts diff --git a/src/apis/clients/ndm-client.ts b/src/apis/client/ndm-client.ts similarity index 100% rename from src/apis/clients/ndm-client.ts rename to src/apis/client/ndm-client.ts diff --git a/src/apis/clients/user-client.ts b/src/apis/client/user-client.ts similarity index 100% rename from src/apis/clients/user-client.ts rename to src/apis/client/user-client.ts diff --git a/src/apis/domains/device/diag/index.ts b/src/apis/domain/biz/diag/index.ts similarity index 100% rename from src/apis/domains/device/diag/index.ts rename to src/apis/domain/biz/diag/index.ts diff --git a/src/apis/domains/device/diag/ndm-camera-diag-info.ts b/src/apis/domain/biz/diag/ndm-camera-diag-info.ts similarity index 100% rename from src/apis/domains/device/diag/ndm-camera-diag-info.ts rename to src/apis/domain/biz/diag/ndm-camera-diag-info.ts diff --git a/src/apis/domains/device/diag/ndm-decoder-diag-info.ts b/src/apis/domain/biz/diag/ndm-decoder-diag-info.ts similarity index 100% rename from src/apis/domains/device/diag/ndm-decoder-diag-info.ts rename to src/apis/domain/biz/diag/ndm-decoder-diag-info.ts diff --git a/src/apis/domains/device/diag/ndm-nvr-diag-info.ts b/src/apis/domain/biz/diag/ndm-nvr-diag-info.ts similarity index 100% rename from src/apis/domains/device/diag/ndm-nvr-diag-info.ts rename to src/apis/domain/biz/diag/ndm-nvr-diag-info.ts diff --git a/src/apis/domains/device/diag/ndm-security-box-diag-info.ts b/src/apis/domain/biz/diag/ndm-security-box-diag-info.ts similarity index 100% rename from src/apis/domains/device/diag/ndm-security-box-diag-info.ts rename to src/apis/domain/biz/diag/ndm-security-box-diag-info.ts diff --git a/src/apis/domains/device/diag/ndm-server-diag-info.ts b/src/apis/domain/biz/diag/ndm-server-diag-info.ts similarity index 100% rename from src/apis/domains/device/diag/ndm-server-diag-info.ts rename to src/apis/domain/biz/diag/ndm-server-diag-info.ts diff --git a/src/apis/domains/device/diag/ndm-switch-diag-info.ts b/src/apis/domain/biz/diag/ndm-switch-diag-info.ts similarity index 100% rename from src/apis/domains/device/diag/ndm-switch-diag-info.ts rename to src/apis/domain/biz/diag/ndm-switch-diag-info.ts diff --git a/src/apis/domain/biz/index.ts b/src/apis/domain/biz/index.ts new file mode 100644 index 0000000..7952147 --- /dev/null +++ b/src/apis/domain/biz/index.ts @@ -0,0 +1,2 @@ +export * from './diag'; +export * from './station'; diff --git a/src/apis/domains/station/alarm.ts b/src/apis/domain/biz/station/alarm.ts similarity index 100% rename from src/apis/domains/station/alarm.ts rename to src/apis/domain/biz/station/alarm.ts diff --git a/src/apis/domains/station/device.ts b/src/apis/domain/biz/station/device.ts similarity index 100% rename from src/apis/domains/station/device.ts rename to src/apis/domain/biz/station/device.ts diff --git a/src/apis/domains/station/index.ts b/src/apis/domain/biz/station/index.ts similarity index 100% rename from src/apis/domains/station/index.ts rename to src/apis/domain/biz/station/index.ts diff --git a/src/apis/domains/station/station.ts b/src/apis/domain/biz/station/station.ts similarity index 100% rename from src/apis/domains/station/station.ts rename to src/apis/domain/biz/station/station.ts diff --git a/src/apis/domain/index.ts b/src/apis/domain/index.ts new file mode 100644 index 0000000..6007978 --- /dev/null +++ b/src/apis/domain/index.ts @@ -0,0 +1,3 @@ +export * from './biz'; +export * from './user'; +export * from './version'; diff --git a/src/apis/models/user/index.ts b/src/apis/domain/user/index.ts similarity index 100% rename from src/apis/models/user/index.ts rename to src/apis/domain/user/index.ts diff --git a/src/apis/models/user/login-params.ts b/src/apis/domain/user/login-params.ts similarity index 100% rename from src/apis/models/user/login-params.ts rename to src/apis/domain/user/login-params.ts diff --git a/src/apis/models/user/login-result.ts b/src/apis/domain/user/login-result.ts similarity index 100% rename from src/apis/models/user/login-result.ts rename to src/apis/domain/user/login-result.ts diff --git a/src/apis/domain/version/index.ts b/src/apis/domain/version/index.ts new file mode 100644 index 0000000..bab4781 --- /dev/null +++ b/src/apis/domain/version/index.ts @@ -0,0 +1 @@ +export * from './version-info'; diff --git a/src/apis/domains/version/index.ts b/src/apis/domain/version/version-info.ts similarity index 100% rename from src/apis/domains/version/index.ts rename to src/apis/domain/version/version-info.ts diff --git a/src/apis/domains/device/index.ts b/src/apis/domains/device/index.ts deleted file mode 100644 index b2d444c..0000000 --- a/src/apis/domains/device/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './diag'; diff --git a/src/apis/domains/index.ts b/src/apis/domains/index.ts deleted file mode 100644 index 817e2e3..0000000 --- a/src/apis/domains/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './device'; -export * from './station'; -export * from './version'; diff --git a/src/apis/index.ts b/src/apis/index.ts index 9fddcba..de109ef 100644 --- a/src/apis/index.ts +++ b/src/apis/index.ts @@ -1,4 +1,4 @@ -export * from './clients'; -export * from './domains'; -export * from './models'; -export * from './requests'; +export * from './client'; +export * from './domain'; +export * from './model'; +export * from './request'; diff --git a/src/apis/models/base/index.ts b/src/apis/model/base/index.ts similarity index 100% rename from src/apis/models/base/index.ts rename to src/apis/model/base/index.ts diff --git a/src/apis/models/base/model.ts b/src/apis/model/base/model.ts similarity index 100% rename from src/apis/models/base/model.ts rename to src/apis/model/base/model.ts diff --git a/src/apis/models/base/page.ts b/src/apis/model/base/page.ts similarity index 100% rename from src/apis/models/base/page.ts rename to src/apis/model/base/page.ts diff --git a/src/apis/models/base/reduce.ts b/src/apis/model/base/reduce.ts similarity index 100% rename from src/apis/models/base/reduce.ts rename to src/apis/model/base/reduce.ts diff --git a/src/apis/model/biz/entity/index.ts b/src/apis/model/biz/entity/index.ts new file mode 100644 index 0000000..7d8e163 --- /dev/null +++ b/src/apis/model/biz/entity/index.ts @@ -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; + +export type NdmServerVO = NdmMediaServer | NdmVideoServer; + +export type NdmServerResultVO = Partial; + +export * from './log'; +export * from './other'; +export * from './storage'; +export * from './video'; diff --git a/src/apis/requests/device/log/index.ts b/src/apis/model/biz/entity/log/index.ts similarity index 82% rename from src/apis/requests/device/log/index.ts rename to src/apis/model/biz/entity/log/index.ts index 578a4be..9868bd2 100644 --- a/src/apis/requests/device/log/index.ts +++ b/src/apis/model/biz/entity/log/index.ts @@ -1,5 +1,6 @@ export * from './ndm-call-log'; export * from './ndm-device-alarm-log'; export * from './ndm-icmp-log'; +export * from './ndm-record-check'; export * from './ndm-snmp-log'; export * from './ndm-vimp-log'; diff --git a/src/apis/model/biz/entity/log/ndm-call-log.ts b/src/apis/model/biz/entity/log/ndm-call-log.ts new file mode 100644 index 0000000..b12cd3c --- /dev/null +++ b/src/apis/model/biz/entity/log/ndm-call-log.ts @@ -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; + +export type NdmCallLogSaveVO = Partial>; + +export type NdmCallLogUpdateVO = Partial>; + +export type NdmCallLogPageQuery = Partial>; diff --git a/src/apis/models/device/log/ndm-device-alarm-log.ts b/src/apis/model/biz/entity/log/ndm-device-alarm-log.ts similarity index 78% rename from src/apis/models/device/log/ndm-device-alarm-log.ts rename to src/apis/model/biz/entity/log/ndm-device-alarm-log.ts index 776ba81..a96332d 100644 --- a/src/apis/models/device/log/ndm-device-alarm-log.ts +++ b/src/apis/model/biz/entity/log/ndm-device-alarm-log.ts @@ -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; alarmDate: string; faultLocation: string; @@ -18,10 +18,10 @@ export interface NdmDeviceAlarmLogVO extends BaseModel { stationCode: string; } -export type NdmDeviceAlarmLogResultVO = Partial; +export type NdmDeviceAlarmLogResultVO = Partial; -export type NdmDeviceAlarmLogSaveVO = Partial>; +export type NdmDeviceAlarmLogSaveVO = Partial>; -export type NdmDeviceAlarmLogUpdateVO = Partial>; +export type NdmDeviceAlarmLogUpdateVO = Partial>; -export type NdmDeviceAlarmLogPageQuery = Partial>; +export type NdmDeviceAlarmLogPageQuery = Partial>; diff --git a/src/apis/model/biz/entity/log/ndm-icmp-log.ts b/src/apis/model/biz/entity/log/ndm-icmp-log.ts new file mode 100644 index 0000000..bafdfc7 --- /dev/null +++ b/src/apis/model/biz/entity/log/ndm-icmp-log.ts @@ -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; + +export type NdmIcmpLogSaveVO = Partial>; + +export type NdmIcmpLogUpdateVO = Partial>; + +export type NdmIcmpLogPageQuery = Partial>; diff --git a/src/apis/model/biz/entity/log/ndm-record-check.ts b/src/apis/model/biz/entity/log/ndm-record-check.ts new file mode 100644 index 0000000..212fa03 --- /dev/null +++ b/src/apis/model/biz/entity/log/ndm-record-check.ts @@ -0,0 +1,8 @@ +export interface NdmRecordCheck { + gbCode: string; + parentGbCode: string; + name: string; + ipAddress: string; + diagInfo: string; + checkDate: string; +} diff --git a/src/apis/model/biz/entity/log/ndm-snmp-log.ts b/src/apis/model/biz/entity/log/ndm-snmp-log.ts new file mode 100644 index 0000000..6ef8d53 --- /dev/null +++ b/src/apis/model/biz/entity/log/ndm-snmp-log.ts @@ -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; + +export type NdmSnmpLogSaveVO = Partial>; + +export type NdmSnmpLogUpdateVO = Partial>; + +export type NdmSnmpLogPageQuery = Partial>; diff --git a/src/apis/model/biz/entity/log/ndm-vimp-log.ts b/src/apis/model/biz/entity/log/ndm-vimp-log.ts new file mode 100644 index 0000000..2650872 --- /dev/null +++ b/src/apis/model/biz/entity/log/ndm-vimp-log.ts @@ -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; + +export type NdmVimpLogSaveVO = Partial>; + +export type NdmVimpLogUpdateVO = Partial>; + +export type NdmVimpLogPageQuery = Partial>; diff --git a/src/apis/models/device/other/index.ts b/src/apis/model/biz/entity/other/index.ts similarity index 100% rename from src/apis/models/device/other/index.ts rename to src/apis/model/biz/entity/other/index.ts diff --git a/src/apis/models/device/other/ndm-security-box.ts b/src/apis/model/biz/entity/other/ndm-security-box.ts similarity index 70% rename from src/apis/models/device/other/ndm-security-box.ts rename to src/apis/model/biz/entity/other/ndm-security-box.ts index 231140d..262b0ef 100644 --- a/src/apis/models/device/other/ndm-security-box.ts +++ b/src/apis/model/biz/entity/other/ndm-security-box.ts @@ -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; name: string; manufacturer: string; @@ -25,10 +25,10 @@ export interface NdmSecurityBoxVO extends BaseModel { snmpEnabled: boolean; } -export type NdmSecurityBoxResultVO = Partial; +export type NdmSecurityBoxResultVO = Partial; -export type NdmSecurityBoxSaveVO = Partial>; +export type NdmSecurityBoxSaveVO = Partial>; -export type NdmSecurityBoxUpdateVO = Partial>; +export type NdmSecurityBoxUpdateVO = Partial>; -export type NdmSecurityBoxPageQuery = Partial>; +export type NdmSecurityBoxPageQuery = Partial>; diff --git a/src/apis/models/device/other/ndm-switch.ts b/src/apis/model/biz/entity/other/ndm-switch.ts similarity index 59% rename from src/apis/models/device/other/ndm-switch.ts rename to src/apis/model/biz/entity/other/ndm-switch.ts index b8aeaaa..ba501da 100644 --- a/src/apis/models/device/other/ndm-switch.ts +++ b/src/apis/model/biz/entity/other/ndm-switch.ts @@ -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; name: string; manufacturer: string; @@ -25,10 +25,10 @@ export interface NdmSwitchVO extends BaseModel { snmpEnabled: boolean; } -export type NdmSwitchResultVO = Partial; +export type NdmSwitchResultVO = Partial; -export type NdmSwitchSaveVO = Partial>; +export type NdmSwitchSaveVO = Partial>; -export type NdmSwitchUpdateVO = Partial>; +export type NdmSwitchUpdateVO = Partial>; -export type NdmSwitchPageQuery = Partial>; +export type NdmSwitchPageQuery = Partial>; diff --git a/src/apis/models/device/storage/index.ts b/src/apis/model/biz/entity/storage/index.ts similarity index 100% rename from src/apis/models/device/storage/index.ts rename to src/apis/model/biz/entity/storage/index.ts diff --git a/src/apis/model/biz/entity/storage/ndm-nvr.ts b/src/apis/model/biz/entity/storage/ndm-nvr.ts new file mode 100644 index 0000000..c175e2f --- /dev/null +++ b/src/apis/model/biz/entity/storage/ndm-nvr.ts @@ -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; + +export type NdmNvrSaveVO = Partial>; + +export type NdmNvrUpdateVO = Partial>; + +export type NdmNvrPageQuery = Partial>; diff --git a/src/apis/models/device/video/index.ts b/src/apis/model/biz/entity/video/index.ts similarity index 100% rename from src/apis/models/device/video/index.ts rename to src/apis/model/biz/entity/video/index.ts diff --git a/src/apis/models/device/video/ndm-camera.ts b/src/apis/model/biz/entity/video/ndm-camera.ts similarity index 67% rename from src/apis/models/device/video/ndm-camera.ts rename to src/apis/model/biz/entity/video/ndm-camera.ts index 74a18c4..f73ed3e 100644 --- a/src/apis/models/device/video/ndm-camera.ts +++ b/src/apis/model/biz/entity/video/ndm-camera.ts @@ -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; name: string; manufacturer: string; @@ -35,10 +35,10 @@ export interface NdmCameraVO extends BaseModel { snmpEnabled: boolean; } -export type NdmCameraResultVO = Partial; +export type NdmCameraResultVO = Partial; -export type NdmCameraSaveVO = Partial>; +export type NdmCameraSaveVO = Partial>; -export type NdmCameraUpdateVO = Partial>; +export type NdmCameraUpdateVO = Partial>; -export type NdmCameraPageQuery = Partial>; +export type NdmCameraPageQuery = Partial>; diff --git a/src/apis/models/device/video/ndm-decoder.ts b/src/apis/model/biz/entity/video/ndm-decoder.ts similarity index 65% rename from src/apis/models/device/video/ndm-decoder.ts rename to src/apis/model/biz/entity/video/ndm-decoder.ts index 03fd5b0..a732079 100644 --- a/src/apis/models/device/video/ndm-decoder.ts +++ b/src/apis/model/biz/entity/video/ndm-decoder.ts @@ -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; name: string; manufacturer: string; @@ -32,10 +32,10 @@ export interface NdmDecoderVO extends BaseModel { snmpEnabled: boolean; } -export type NdmDecoderResultVO = Partial; +export type NdmDecoderResultVO = Partial; -export type NdmDecoderSaveVO = Partial>; +export type NdmDecoderSaveVO = Partial>; -export type NdmDecoderUpdateVO = Partial>; +export type NdmDecoderUpdateVO = Partial>; -export type NdmDecoderPageQuery = Partial>; +export type NdmDecoderPageQuery = Partial>; diff --git a/src/apis/models/device/video/ndm-keyboard.ts b/src/apis/model/biz/entity/video/ndm-keyboard.ts similarity index 58% rename from src/apis/models/device/video/ndm-keyboard.ts rename to src/apis/model/biz/entity/video/ndm-keyboard.ts index 77306ef..f92d0bc 100644 --- a/src/apis/models/device/video/ndm-keyboard.ts +++ b/src/apis/model/biz/entity/video/ndm-keyboard.ts @@ -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; name: string; manufacturer: string; @@ -25,10 +25,10 @@ export interface NdmKeyboardVO extends BaseModel { snmpEnabled: boolean; } -export type NdmKeyboardResultVO = Partial; +export type NdmKeyboardResultVO = Partial; -export type NdmKeyboardSaveVO = Partial>; +export type NdmKeyboardSaveVO = Partial>; -export type NdmKeyboardUpdateVO = Partial>; +export type NdmKeyboardUpdateVO = Partial>; -export type NdmKeyboardPageQuery = Partial>; +export type NdmKeyboardPageQuery = Partial>; diff --git a/src/apis/models/device/video/ndm-media-server.ts b/src/apis/model/biz/entity/video/ndm-media-server.ts similarity index 72% rename from src/apis/models/device/video/ndm-media-server.ts rename to src/apis/model/biz/entity/video/ndm-media-server.ts index 80b7ac3..15b034d 100644 --- a/src/apis/models/device/video/ndm-media-server.ts +++ b/src/apis/model/biz/entity/video/ndm-media-server.ts @@ -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; name: string; manufacturer: string; @@ -29,10 +29,10 @@ export interface NdmMediaServerVO extends BaseModel { snmpEnabled: boolean; } -export type NdmMediaServerResultVO = Partial; +export type NdmMediaServerResultVO = Partial; -export type NdmMediaServerSaveVO = Partial>; +export type NdmMediaServerSaveVO = Partial>; -export type NdmMediaServerUpdateVO = Partial>; +export type NdmMediaServerUpdateVO = Partial>; -export type NdmMediaServerPageQuery = Partial>; +export type NdmMediaServerPageQuery = Partial>; diff --git a/src/apis/models/device/video/ndm-video-server.ts b/src/apis/model/biz/entity/video/ndm-video-server.ts similarity index 72% rename from src/apis/models/device/video/ndm-video-server.ts rename to src/apis/model/biz/entity/video/ndm-video-server.ts index db42685..e9a845f 100644 --- a/src/apis/models/device/video/ndm-video-server.ts +++ b/src/apis/model/biz/entity/video/ndm-video-server.ts @@ -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; name: string; manufacturer: string; @@ -29,10 +29,10 @@ export interface NdmVideoServerVO extends BaseModel { snmpEnabled: boolean; } -export type NdmVideoServerResultVO = Partial; +export type NdmVideoServerResultVO = Partial; -export type NdmVideoServerSaveVO = Partial>; +export type NdmVideoServerSaveVO = Partial>; -export type NdmVideoServerUpdateVO = Partial>; +export type NdmVideoServerUpdateVO = Partial>; -export type NdmVideoServerPageQuery = Partial>; +export type NdmVideoServerPageQuery = Partial>; diff --git a/src/apis/model/biz/index.ts b/src/apis/model/biz/index.ts new file mode 100644 index 0000000..c4454f2 --- /dev/null +++ b/src/apis/model/biz/index.ts @@ -0,0 +1,4 @@ +export * from './entity'; +export * from './nvr'; +export * from './verify'; +export * from './vimp'; diff --git a/src/apis/model/biz/nvr/client-channel.ts b/src/apis/model/biz/nvr/client-channel.ts new file mode 100644 index 0000000..5e6d60b --- /dev/null +++ b/src/apis/model/biz/nvr/client-channel.ts @@ -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; +} diff --git a/src/apis/model/biz/nvr/index.ts b/src/apis/model/biz/nvr/index.ts new file mode 100644 index 0000000..5db1448 --- /dev/null +++ b/src/apis/model/biz/nvr/index.ts @@ -0,0 +1,3 @@ +export * from './client-channel'; +export * from './record-info'; +export * from './record-item'; diff --git a/src/apis/model/biz/nvr/record-info.ts b/src/apis/model/biz/nvr/record-info.ts new file mode 100644 index 0000000..cd08684 --- /dev/null +++ b/src/apis/model/biz/nvr/record-info.ts @@ -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[]; +} diff --git a/src/apis/model/biz/nvr/record-item.ts b/src/apis/model/biz/nvr/record-item.ts new file mode 100644 index 0000000..5f3457f --- /dev/null +++ b/src/apis/model/biz/nvr/record-item.ts @@ -0,0 +1,4 @@ +export interface RecordItem { + startTime: string; + endTime: string; +} diff --git a/src/apis/model/biz/verify/index.ts b/src/apis/model/biz/verify/index.ts new file mode 100644 index 0000000..b74d8b9 --- /dev/null +++ b/src/apis/model/biz/verify/index.ts @@ -0,0 +1 @@ +export * from './verify-server'; diff --git a/src/apis/model/biz/verify/verify-server.ts b/src/apis/model/biz/verify/verify-server.ts new file mode 100644 index 0000000..6222675 --- /dev/null +++ b/src/apis/model/biz/verify/verify-server.ts @@ -0,0 +1,7 @@ +export interface VerifyServer { + name: string; + ipAddress: string; + stationCode: string; + verifyUrl: string; + onlineState: boolean; +} diff --git a/src/apis/models/vimp/index.ts b/src/apis/model/biz/vimp/index.ts similarity index 100% rename from src/apis/models/vimp/index.ts rename to src/apis/model/biz/vimp/index.ts diff --git a/src/apis/models/vimp/snap-result.ts b/src/apis/model/biz/vimp/snap-result.ts similarity index 100% rename from src/apis/models/vimp/snap-result.ts rename to src/apis/model/biz/vimp/snap-result.ts diff --git a/src/apis/model/index.ts b/src/apis/model/index.ts new file mode 100644 index 0000000..10cbc67 --- /dev/null +++ b/src/apis/model/index.ts @@ -0,0 +1,3 @@ +export * from './base'; +export * from './biz'; +export * from './system'; diff --git a/src/apis/model/system/def-parameter.ts b/src/apis/model/system/def-parameter.ts new file mode 100644 index 0000000..3d59505 --- /dev/null +++ b/src/apis/model/system/def-parameter.ts @@ -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; + +export type DefParameterSaveVO = Partial>; + +export type DefParameterUpdateVO = Partial>; + +export type DefParameterPageQuery = Partial>; diff --git a/src/apis/models/system/index.ts b/src/apis/model/system/index.ts similarity index 100% rename from src/apis/models/system/index.ts rename to src/apis/model/system/index.ts diff --git a/src/apis/models/device/index.ts b/src/apis/models/device/index.ts deleted file mode 100644 index dfc0967..0000000 --- a/src/apis/models/device/index.ts +++ /dev/null @@ -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; -export type NdmServerVO = NdmMediaServerVO | NdmVideoServerVO; -export type NdmServerResultVO = Partial; diff --git a/src/apis/models/device/log/ndm-call-log.ts b/src/apis/models/device/log/ndm-call-log.ts deleted file mode 100644 index 64a93d2..0000000 --- a/src/apis/models/device/log/ndm-call-log.ts +++ /dev/null @@ -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; - -export type NdmCallLogSaveVO = Partial>; - -export type NdmCallLogUpdateVO = Partial>; - -export type NdmCallLogPageQuery = Partial>; diff --git a/src/apis/models/device/log/ndm-icmp-log.ts b/src/apis/models/device/log/ndm-icmp-log.ts deleted file mode 100644 index 57e7dc3..0000000 --- a/src/apis/models/device/log/ndm-icmp-log.ts +++ /dev/null @@ -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; - -export type NdmIcmpLogSaveVO = Partial>; - -export type NdmIcmpLogUpdateVO = Partial>; - -export type NdmIcmpLogPageQuery = Partial>; diff --git a/src/apis/models/device/log/ndm-snmp-log.ts b/src/apis/models/device/log/ndm-snmp-log.ts deleted file mode 100644 index fd76825..0000000 --- a/src/apis/models/device/log/ndm-snmp-log.ts +++ /dev/null @@ -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; - -export type NdmSnmpLogSaveVO = Partial>; - -export type NdmSnmpLogUpdateVO = Partial>; - -export type NdmSnmpLogPageQuery = Partial>; diff --git a/src/apis/models/device/log/ndm-vimp-log.ts b/src/apis/models/device/log/ndm-vimp-log.ts deleted file mode 100644 index 539335c..0000000 --- a/src/apis/models/device/log/ndm-vimp-log.ts +++ /dev/null @@ -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; - -export type NdmVimpLogSaveVO = Partial>; - -export type NdmVimpLogUpdateVO = Partial>; - -export type NdmVimpLogPageQuery = Partial>; diff --git a/src/apis/models/device/storage/ndm-nvr.ts b/src/apis/models/device/storage/ndm-nvr.ts deleted file mode 100644 index b89f3c8..0000000 --- a/src/apis/models/device/storage/ndm-nvr.ts +++ /dev/null @@ -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; - -export type NdmNvrSaveVO = Partial>; - -export type NdmNvrUpdateVO = Partial>; - -export type NdmNvrPageQuery = Partial>; - -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; -} diff --git a/src/apis/models/index.ts b/src/apis/models/index.ts deleted file mode 100644 index 718b449..0000000 --- a/src/apis/models/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './base'; -export * from './device'; -export * from './system'; -export * from './user'; -export * from './vimp'; diff --git a/src/apis/models/system/def-parameter.ts b/src/apis/models/system/def-parameter.ts deleted file mode 100644 index 62afc7b..0000000 --- a/src/apis/models/system/def-parameter.ts +++ /dev/null @@ -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; - -export type DefParameterSaveVO = Partial>; - -export type DefParameterUpdateVO = Partial>; - -export type DefParameterPageQuery = Partial>; diff --git a/src/apis/request/biz/composed/detail-device.ts b/src/apis/request/biz/composed/detail-device.ts new file mode 100644 index 0000000..150e7d6 --- /dev/null +++ b/src/apis/request/biz/composed/detail-device.ts @@ -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 => { + 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; +}; diff --git a/src/apis/request/biz/composed/index.ts b/src/apis/request/biz/composed/index.ts new file mode 100644 index 0000000..ce99900 --- /dev/null +++ b/src/apis/request/biz/composed/index.ts @@ -0,0 +1,2 @@ +export * from './detail-device'; +export * from './probe-device'; diff --git a/src/apis/request/biz/composed/probe-device.ts b/src/apis/request/biz/composed/probe-device.ts new file mode 100644 index 0000000..c2059ed --- /dev/null +++ b/src/apis/request/biz/composed/probe-device.ts @@ -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; + } +}; diff --git a/src/apis/requests/device/constant/index.ts b/src/apis/request/biz/constant/index.ts similarity index 100% rename from src/apis/requests/device/constant/index.ts rename to src/apis/request/biz/constant/index.ts diff --git a/src/apis/request/biz/constant/reset-monitor-shedule.ts b/src/apis/request/biz/constant/reset-monitor-shedule.ts new file mode 100644 index 0000000..97ce131 --- /dev/null +++ b/src/apis/request/biz/constant/reset-monitor-shedule.ts @@ -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(endpoint, { signal }); + const [err] = resp; + if (err) { + throw err; + } +}; diff --git a/src/apis/request/biz/icmp/batch-verify.ts b/src/apis/request/biz/icmp/batch-verify.ts new file mode 100644 index 0000000..9da56a7 --- /dev/null +++ b/src/apis/request/biz/icmp/batch-verify.ts @@ -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(endpoint, {}, { retRaw: true, timeout: 5000, signal }); + const [err, data] = resp; + if (err || !data) { + throw err; + } + return data; +}; diff --git a/src/apis/request/biz/icmp/index.ts b/src/apis/request/biz/icmp/index.ts new file mode 100644 index 0000000..8c2847f --- /dev/null +++ b/src/apis/request/biz/icmp/index.ts @@ -0,0 +1,3 @@ +export * from './batch-verify'; +export * from './ndm-icmp-export'; +export * from './verify'; diff --git a/src/apis/requests/device/icmp/ndm-icmp-export.ts b/src/apis/request/biz/icmp/ndm-icmp-export.ts similarity index 59% rename from src/apis/requests/device/icmp/ndm-icmp-export.ts rename to src/apis/request/biz/icmp/ndm-icmp-export.ts index fcab827..cffcbf6 100644 --- a/src/apis/requests/device/icmp/ndm-icmp-export.ts +++ b/src/apis/request/biz/icmp/ndm-icmp-export.ts @@ -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 body = new URLSearchParams(); body.append('status', status ?? ''); - const resp = await ndmClient.post(endpoint, body, { + const resp = await userClient.post(endpoint, body, { responseType: 'blob', retRaw: true, headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + signal, }); const [err, data] = resp; if (err || !data) { diff --git a/src/apis/request/biz/icmp/verify.ts b/src/apis/request/biz/icmp/verify.ts new file mode 100644 index 0000000..1af57d2 --- /dev/null +++ b/src/apis/request/biz/icmp/verify.ts @@ -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(endpoint, {}, { timeout: 5000, signal }); + const [err] = resp; + if (err) { + throw err; + } +}; diff --git a/src/apis/requests/device/index.ts b/src/apis/request/biz/index.ts similarity index 100% rename from src/apis/requests/device/index.ts rename to src/apis/request/biz/index.ts diff --git a/src/apis/models/device/log/index.ts b/src/apis/request/biz/log/index.ts similarity index 100% rename from src/apis/models/device/log/index.ts rename to src/apis/request/biz/log/index.ts diff --git a/src/apis/request/biz/log/ndm-call-log.ts b/src/apis/request/biz/log/ndm-call-log.ts new file mode 100644 index 0000000..a215ed3 --- /dev/null +++ b/src/apis/request/biz/log/ndm-call-log.ts @@ -0,0 +1,27 @@ +import { ndmClient, userClient, type NdmCallLogPageQuery, type NdmCallLogResultVO, type PageParams, type PageResult } from '@/apis'; + +export const pageCallLogApi = async (pageQuery: PageParams, 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>(endpoint, pageQuery, { signal }); + const [err, data] = resp; + if (err || !data) { + throw err; + } + return data; +}; + +export const exportCallLogApi = async (pageQuery: PageParams, 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(endpoint, pageQuery, { responseType: 'blob', retRaw: true, signal }); + const [err, data] = resp; + if (err || !data) { + throw err; + } + return data; +}; diff --git a/src/apis/request/biz/log/ndm-device-alarm-log.ts b/src/apis/request/biz/log/ndm-device-alarm-log.ts new file mode 100644 index 0000000..d0334a1 --- /dev/null +++ b/src/apis/request/biz/log/ndm-device-alarm-log.ts @@ -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, 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>(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(endpoint, updateVO, { signal }); + const [err, data] = resp; + if (err || !data) { + throw err; + } + return data; +}; + +export const exportDeviceAlarmLogApi = async (pageQuery: PageParams, 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(endpoint, pageQuery, { responseType: 'blob', retRaw: true, signal }); + const [err, data] = resp; + if (err || !data) { + throw err; + } + return data; +}; diff --git a/src/apis/request/biz/log/ndm-icmp-log.ts b/src/apis/request/biz/log/ndm-icmp-log.ts new file mode 100644 index 0000000..8f1ab9d --- /dev/null +++ b/src/apis/request/biz/log/ndm-icmp-log.ts @@ -0,0 +1,14 @@ +import { ndmClient, userClient, type NdmIcmpLogPageQuery, type NdmIcmpLogResultVO, type PageParams, type PageResult } from '@/apis'; + +export const pageIcmpLogApi = async (pageQuery: PageParams, 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>(endpoint, pageQuery, { signal }); + const [err, data] = resp; + if (err || !data) { + throw err; + } + return data; +}; diff --git a/src/apis/request/biz/log/ndm-snmp-log.ts b/src/apis/request/biz/log/ndm-snmp-log.ts new file mode 100644 index 0000000..a71eacb --- /dev/null +++ b/src/apis/request/biz/log/ndm-snmp-log.ts @@ -0,0 +1,14 @@ +import { ndmClient, userClient, type NdmSnmpLogPageQuery, type NdmSnmpLogResultVO, type PageParams, type PageResult } from '@/apis'; + +export const pageSnmpLogApi = async (pageQuery: PageParams, 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>(endpoint, pageQuery, { signal }); + const [err, data] = resp; + if (err || !data) { + throw err; + } + return data; +}; diff --git a/src/apis/request/biz/log/ndm-vimp-log.ts b/src/apis/request/biz/log/ndm-vimp-log.ts new file mode 100644 index 0000000..d121516 --- /dev/null +++ b/src/apis/request/biz/log/ndm-vimp-log.ts @@ -0,0 +1,27 @@ +import { ndmClient, userClient, type NdmVimpLogPageQuery, type NdmVimpLogResultVO, type PageParams, type PageResult } from '@/apis'; + +export const pageVimpLogApi = async (pageQuery: PageParams, 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>(endpoint, pageQuery, { signal }); + const [err, data] = resp; + if (err || !data) { + throw err; + } + return data; +}; + +export const exportVimpLogApi = async (pageQuery: PageParams, 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(endpoint, pageQuery, { responseType: 'blob', retRaw: true, signal }); + const [err, data] = resp; + if (err || !data) { + throw err; + } + return data; +}; diff --git a/src/apis/requests/device/other/index.ts b/src/apis/request/biz/other/index.ts similarity index 100% rename from src/apis/requests/device/other/index.ts rename to src/apis/request/biz/other/index.ts diff --git a/src/apis/request/biz/other/ndm-security-box.ts b/src/apis/request/biz/other/ndm-security-box.ts new file mode 100644 index 0000000..f5265fa --- /dev/null +++ b/src/apis/request/biz/other/ndm-security-box.ts @@ -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, 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>(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(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(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(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(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(endpoint, { community: 'public', ipAddress }, { signal }); + const [err, data] = resp; + if (err || !data) { + throw err; + } + return data; +}; diff --git a/src/apis/request/biz/other/ndm-switch.ts b/src/apis/request/biz/other/ndm-switch.ts new file mode 100644 index 0000000..5edb5da --- /dev/null +++ b/src/apis/request/biz/other/ndm-switch.ts @@ -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, 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>(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(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(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(endpoint, ids, { signal }); + const [err] = resp; + if (err) { + throw err; + } +}; diff --git a/src/apis/requests/device/storage/index.ts b/src/apis/request/biz/storage/index.ts similarity index 100% rename from src/apis/requests/device/storage/index.ts rename to src/apis/request/biz/storage/index.ts diff --git a/src/apis/request/biz/storage/ndm-nvr.ts b/src/apis/request/biz/storage/ndm-nvr.ts new file mode 100644 index 0000000..b89fe62 --- /dev/null +++ b/src/apis/request/biz/storage/ndm-nvr.ts @@ -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, 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>(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(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(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(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(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(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(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(endpoint, dayOffset, { signal }); + const [err, data] = resp; + if (err || !data) { + throw err; + } + return data; +}; diff --git a/src/apis/requests/device/video/index.ts b/src/apis/request/biz/video/index.ts similarity index 100% rename from src/apis/requests/device/video/index.ts rename to src/apis/request/biz/video/index.ts diff --git a/src/apis/request/biz/video/ndm-camera.ts b/src/apis/request/biz/video/ndm-camera.ts new file mode 100644 index 0000000..60be7fa --- /dev/null +++ b/src/apis/request/biz/video/ndm-camera.ts @@ -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, 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>(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(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(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(endpoint, { params: { deviceId }, signal }); + const [err, data] = resp; + if (err || !data) { + throw err; + } + return data; +}; diff --git a/src/apis/request/biz/video/ndm-decoder.ts b/src/apis/request/biz/video/ndm-decoder.ts new file mode 100644 index 0000000..a7248d6 --- /dev/null +++ b/src/apis/request/biz/video/ndm-decoder.ts @@ -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, 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>(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(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(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(endpoint, ids, { signal }); + const [err] = resp; + if (err) { + throw err; + } +}; diff --git a/src/apis/request/biz/video/ndm-keyboard.ts b/src/apis/request/biz/video/ndm-keyboard.ts new file mode 100644 index 0000000..f7a23f5 --- /dev/null +++ b/src/apis/request/biz/video/ndm-keyboard.ts @@ -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, 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>(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(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(endpoint, updateVO, { signal }); + const [err, data] = resp; + if (err || !data) { + throw err; + } + return data; +}; diff --git a/src/apis/request/biz/video/ndm-media-server.ts b/src/apis/request/biz/video/ndm-media-server.ts new file mode 100644 index 0000000..909312b --- /dev/null +++ b/src/apis/request/biz/video/ndm-media-server.ts @@ -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, 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>(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(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(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(endpoint, ids, { signal }); + const [err] = resp; + if (err) { + throw err; + } +}; diff --git a/src/apis/request/biz/video/ndm-video-server.ts b/src/apis/request/biz/video/ndm-video-server.ts new file mode 100644 index 0000000..dc2adb2 --- /dev/null +++ b/src/apis/request/biz/video/ndm-video-server.ts @@ -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, 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>(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(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(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(endpoint, ids, { signal }); + const [err] = resp; + if (err) { + throw err; + } +}; diff --git a/src/apis/request/index.ts b/src/apis/request/index.ts new file mode 100644 index 0000000..ced1b3c --- /dev/null +++ b/src/apis/request/index.ts @@ -0,0 +1,2 @@ +export * from './biz'; +export * from './system'; diff --git a/src/apis/request/system/def-parameter.ts b/src/apis/request/system/def-parameter.ts new file mode 100644 index 0000000..e0a7963 --- /dev/null +++ b/src/apis/request/system/def-parameter.ts @@ -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, 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>(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>(endpoint, { ...updateVO }, { signal }); + const [err, data] = resp; + if (err || !data) { + throw err; + } + return data; +}; diff --git a/src/apis/requests/system/index.ts b/src/apis/request/system/index.ts similarity index 100% rename from src/apis/requests/system/index.ts rename to src/apis/request/system/index.ts diff --git a/src/apis/requests/device/composed/get-device-detail.ts b/src/apis/requests/device/composed/get-device-detail.ts deleted file mode 100644 index 746e92b..0000000 --- a/src/apis/requests/device/composed/get-device-detail.ts +++ /dev/null @@ -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 => { - 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; -}; diff --git a/src/apis/requests/device/composed/index.ts b/src/apis/requests/device/composed/index.ts deleted file mode 100644 index e29fa7d..0000000 --- a/src/apis/requests/device/composed/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './get-device-detail'; -export * from './probe-device'; diff --git a/src/apis/requests/device/composed/probe-device.ts b/src/apis/requests/device/composed/probe-device.ts deleted file mode 100644 index 9dc6ce2..0000000 --- a/src/apis/requests/device/composed/probe-device.ts +++ /dev/null @@ -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; - } -}; diff --git a/src/apis/requests/device/constant/reset-monitor-shedule.ts b/src/apis/requests/device/constant/reset-monitor-shedule.ts deleted file mode 100644 index 146fac3..0000000 --- a/src/apis/requests/device/constant/reset-monitor-shedule.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { ndmClient } from '@/apis'; - -export const resetMonitorSchedule = async (stationCode: string) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.get(`${prefix}/api/ndm/ndmConstant/anyTenant/resetMonitorSchedule`); - const [err] = resp; - if (err) { - throw err; - } -}; diff --git a/src/apis/requests/device/icmp/index.ts b/src/apis/requests/device/icmp/index.ts deleted file mode 100644 index 51917bd..0000000 --- a/src/apis/requests/device/icmp/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './ndm-icmp-export'; diff --git a/src/apis/requests/device/log/ndm-call-log.ts b/src/apis/requests/device/log/ndm-call-log.ts deleted file mode 100644 index f705ff9..0000000 --- a/src/apis/requests/device/log/ndm-call-log.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { ndmClient, type NdmCallLogPageQuery, type NdmCallLogResultVO, type PageParams, type PageResult } from '@/apis'; - -export const postNdmCallLogPage = async (stationCode: string, pageQuery: PageParams) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post>(`${prefix}/api/ndm/ndmCallLog/page`, pageQuery); - const [err, callLogData] = resp; - if (err || !callLogData) { - throw err; - } - return callLogData; -}; - -export const ndmCallLogDefaultExportByTemplate = async (stationCode: string, pageQuery: PageParams) => { - const endpoint = '/api/ndm/ndmCallLog/defaultExportByTemplate'; - if (!stationCode) { - throw new Error('请选择车站'); - } - const resp = await ndmClient.post(`/${stationCode}${endpoint}`, pageQuery, { responseType: 'blob', retRaw: true }); - const [err, data] = resp; - if (err || !data) { - throw err; - } - return data; -}; diff --git a/src/apis/requests/device/log/ndm-device-alarm-log.ts b/src/apis/requests/device/log/ndm-device-alarm-log.ts deleted file mode 100644 index ac959fc..0000000 --- a/src/apis/requests/device/log/ndm-device-alarm-log.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { ndmClient, userClient, type NdmDeviceAlarmLogPageQuery, type NdmDeviceAlarmLogResultVO, type NdmDeviceAlarmLogUpdateVO, type PageParams, type PageResult } from '@/apis'; - -export const postNdmDeviceAlarmLogPage = async (stationCode: string, pageQuery: PageParams, signal?: AbortSignal) => { - const endpoint = '/api/ndm/ndmDeviceAlarmLog/page'; - // 如果车站编码为空,则通过用户API客户端发送请求 - if (!stationCode) { - const resp = await userClient.post>(endpoint, pageQuery, { signal }); - const [err, alarmData] = resp; - if (err || !alarmData) { - throw err; - } - return alarmData; - } - // 如果车站编码不为空,则通过网管API客户端发送请求 - const resp = await ndmClient.post>(`/${stationCode}${endpoint}`, pageQuery, { signal }); - const [err, alarmData] = resp; - if (err || !alarmData) { - throw err; - } - return alarmData; -}; - -export const putNdmDeviceAlarmLog = async (stationCode: string, updateVO: NdmDeviceAlarmLogUpdateVO) => { - const endpoint = '/api/ndm/ndmDeviceAlarmLog'; - if (!stationCode) { - const resp = await userClient.put(endpoint, updateVO); - const [err, alarmData] = resp; - if (err || !alarmData) { - throw err; - } - return alarmData; - } - const resp = await ndmClient.put(`/${stationCode}${endpoint}`, updateVO); - const [err, alarmData] = resp; - if (err || !alarmData) { - throw err; - } - return alarmData; -}; - -export const ndmDeviceAlarmLogDefaultExportByTemplate = async (stationCode: string, pageQuery: PageParams) => { - const endpoint = '/api/ndm/ndmDeviceAlarmLog/defaultExportByTemplate'; - if (!stationCode) { - const resp = await userClient.post(`${endpoint}`, pageQuery, { responseType: 'blob', retRaw: true }); - const [err, data] = resp; - if (err || !data) { - throw err; - } - return data; - } - const resp = await ndmClient.post(`/${stationCode}${endpoint}`, pageQuery, { responseType: 'blob', retRaw: true }); - const [err, data] = resp; - if (err || !data) { - throw err; - } - return data; -}; diff --git a/src/apis/requests/device/log/ndm-icmp-log.ts b/src/apis/requests/device/log/ndm-icmp-log.ts deleted file mode 100644 index c6bfa4d..0000000 --- a/src/apis/requests/device/log/ndm-icmp-log.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ndmClient, type NdmIcmpLogPageQuery, type NdmIcmpLogResultVO, type PageParams, type PageResult } from '@/apis'; - -export const postIcmpLogPage = async (stationCode: string, pageQuery: PageParams) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post>(`${prefix}/api/ndm/ndmIcmpLog/page`, pageQuery); - const [err, icmpLogData] = resp; - if (err || !icmpLogData) { - throw err; - } - return icmpLogData; -}; diff --git a/src/apis/requests/device/log/ndm-snmp-log.ts b/src/apis/requests/device/log/ndm-snmp-log.ts deleted file mode 100644 index ae3cbbe..0000000 --- a/src/apis/requests/device/log/ndm-snmp-log.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ndmClient, type NdmSnmpLogPageQuery, type NdmSnmpLogResultVO, type PageParams, type PageResult } from '@/apis'; - -export const postSnmpLogPage = async (stationCode: string, pageQuery: PageParams) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post>(`${prefix}/api/ndm/ndmSnmpLog/page`, pageQuery); - const [err, snmpLogData] = resp; - if (err || !snmpLogData) { - throw err; - } - return snmpLogData; -}; diff --git a/src/apis/requests/device/log/ndm-vimp-log.ts b/src/apis/requests/device/log/ndm-vimp-log.ts deleted file mode 100644 index b841e6f..0000000 --- a/src/apis/requests/device/log/ndm-vimp-log.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { ndmClient, type NdmVimpLogPageQuery, type NdmVimpLogResultVO, type PageParams, type PageResult } from '@/apis'; - -export const postNdmVimpLogPage = async (stationCode: string, pageQuery: PageParams) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post>(`${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) => { - const endpoint = '/api/ndm/ndmVimpLog/defaultExportByTemplate'; - if (!stationCode) { - throw new Error('请选择车站'); - } - const resp = await ndmClient.post(`/${stationCode}${endpoint}`, pageQuery, { responseType: 'blob', retRaw: true }); - const [err, data] = resp; - if (err || !data) { - throw err; - } - return data; -}; diff --git a/src/apis/requests/device/other/ndm-security-box.ts b/src/apis/requests/device/other/ndm-security-box.ts deleted file mode 100644 index c1a75e0..0000000 --- a/src/apis/requests/device/other/ndm-security-box.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { ndmClient, type NdmSecurityBoxPageQuery, type NdmSecurityBoxResultVO, type NdmSecurityBoxUpdateVO, type PageParams, type PageResult } from '@/apis'; - -export const postNdmSecurityBoxPage = async (stationCode: string, pageQuery: PageParams, signal?: AbortSignal) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post>(`${prefix}/api/ndm/ndmSecurityBox/page`, pageQuery, { signal }); - const [err, ndmSecurityBox] = resp; - if (err || !ndmSecurityBox) { - throw err; - } - return ndmSecurityBox; -}; - -export const getNdmSecurityBoxDetail = async (stationCode: string, id: string) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.get(`${prefix}/api/ndm/ndmSecurityBox/detail`, { params: { id } }); - const [err, ndmSecurityBoxData] = resp; - if (err || !ndmSecurityBoxData) { - throw err; - } - return ndmSecurityBoxData; -}; - -export const putNdmSecurityBox = async (stationCode: string, updateVO: NdmSecurityBoxUpdateVO) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.put(`${prefix}/api/ndm/ndmSecurityBox`, updateVO); - const [err, ndmSecurityBox] = resp; - if (err || !ndmSecurityBox) { - throw err; - } - return await getNdmSecurityBoxDetail(stationCode, ndmSecurityBox.id ?? ''); -}; - -export const probeNdmSecurityBoxByIds = async (stationCode: string, ids: string[]) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post(`${prefix}/api/ndm/ndmSecurityBox/probeByIds`, ids); - const [err] = resp; - if (err) { - throw err; - } -}; - -export const turnStatus = async (stationCode: string, ipAddress: string, circuitIndex: number, status: number) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post(`${prefix}/api/ndm/ndmSecurityBox/turnStatus`, { - community: 'public', - ipAddress, - circuit: `${circuitIndex}`, - status, - }); - const [err, result] = resp; - if (err || !result) { - throw err; - } - return result; -}; - -export const rebootSecurityBox = async (stationCode: string, ipAddress: string) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post(`${prefix}/api/ndm/ndmSecurityBox/reboot`, { - community: 'public', - ipAddress, - }); - const [err, result] = resp; - if (err || !result) { - throw err; - } - return result; -}; diff --git a/src/apis/requests/device/other/ndm-switch.ts b/src/apis/requests/device/other/ndm-switch.ts deleted file mode 100644 index 045e4cf..0000000 --- a/src/apis/requests/device/other/ndm-switch.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { ndmClient, type NdmSwitchPageQuery, type NdmSwitchResultVO, type NdmSwitchUpdateVO, type PageParams, type PageResult } from '@/apis'; - -export const postNdmSwitchPage = async (stationCode: string, pageQuery: PageParams, signal?: AbortSignal) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post>(`${prefix}/api/ndm/ndmSwitch/page`, pageQuery, { signal }); - const [err, ndmSwitch] = resp; - if (err || !ndmSwitch) { - throw err; - } - return ndmSwitch; -}; - -export const getNdmSwitchDetail = async (stationCode: string, id: string) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.get(`${prefix}/api/ndm/ndmSwitch/detail`, { params: { id } }); - const [err, ndmSwitchData] = resp; - if (err || !ndmSwitchData) { - throw err; - } - return ndmSwitchData; -}; - -export const putNdmSwitch = async (stationCode: string, updateVO: NdmSwitchUpdateVO) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.put(`${prefix}/api/ndm/ndmSwitch`, updateVO); - const [err, ndmSwitch] = resp; - if (err || !ndmSwitch) { - throw err; - } - return await getNdmSwitchDetail(stationCode, ndmSwitch.id ?? ''); -}; - -export const probeNdmSwitchByIds = async (stationCode: string, ids: string[]) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post(`${prefix}/api/ndm/ndmSwitch/probeByIds`, ids); - const [err] = resp; - if (err) { - throw err; - } -}; diff --git a/src/apis/requests/device/storage/ndm-nvr.ts b/src/apis/requests/device/storage/ndm-nvr.ts deleted file mode 100644 index 104fb90..0000000 --- a/src/apis/requests/device/storage/ndm-nvr.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { ndmClient, type ClientChannel, type NdmNvrPageQuery, type NdmNvrResultVO, type NdmNvrUpdateVO, type NdmRecordCheck, type PageParams, type PageResult } from '@/apis'; -import dayjs from 'dayjs'; - -export const postNdmNvrPage = async (stationCode: string, pageQuery: PageParams, signal?: AbortSignal) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post>(`${prefix}/api/ndm/ndmNvr/page`, pageQuery, { signal }); - const [err, ndmNvr] = resp; - if (err || !ndmNvr) { - throw err; - } - return ndmNvr; -}; - -export const getNdmNvrDetail = async (stationCode: string, id: string) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.get(`${prefix}/api/ndm/ndmNvr/detail`, { params: { id } }); - const [err, ndmNvr] = resp; - if (err || !ndmNvr) { - throw err; - } - return ndmNvr; -}; - -export const putNdmNvr = async (stationCode: string, updateVO: NdmNvrUpdateVO) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.put(`${prefix}/api/ndm/ndmNvr`, updateVO); - const [err, ndmNvr] = resp; - if (err || !ndmNvr) { - throw err; - } - return await getNdmNvrDetail(stationCode, ndmNvr.id ?? ''); -}; - -export const probeNdmNvrByIds = async (stationCode: string, ids: string[]) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post(`${prefix}/api/ndm/ndmNvr/probeByIds`, ids); - const [err] = resp; - if (err) { - throw err; - } -}; - -export const getChannelList = async (stationCode: string, ndmNvr: NdmNvrResultVO) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post(`${prefix}/api/ndm/ndmRecordCheck/getChannelList`, { - code: ndmNvr.gbCode, - time: '', - }); - const [err, channelList] = resp; - if (err || !channelList) { - throw err; - } - return channelList; -}; - -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'); - const resp = await ndmClient.post(`${prefix}/api/ndm/ndmRecordCheck/getRecordCheckByParentId`, { - start: startDateTime.format('YYYY-MM-DD'), - end: endDateTime.format('YYYY-MM-DD'), - parentId: ndmNvr.gbCode, - gbCodeList, - }); - const [err, recordCheckList] = resp; - if (err || !recordCheckList) { - throw err; - } - return recordCheckList; -}; - -export const reloadRecordCheckByGbId = async (stationCode: string, channel: ClientChannel, dayOffset: number) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post(`${prefix}/api/ndm/ndmRecordCheck/reloadRecordCheckByGbId`, { - ...channel, - dayOffset, - }); - const [err, result] = resp; - if (err || !result) { - throw err; - } - return result; -}; - -export const reloadAllRecordCheck = async (stationCode: string, dayOffset: number) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post(`${prefix}/api/ndm/ndmRecordCheck/reloadAllRecordCheck`, dayOffset); - const [err, result] = resp; - if (err || !result) { - throw err; - } - return result; -}; diff --git a/src/apis/requests/device/video/ndm-camera.ts b/src/apis/requests/device/video/ndm-camera.ts deleted file mode 100644 index 2288818..0000000 --- a/src/apis/requests/device/video/ndm-camera.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { ndmClient, type NdmCameraPageQuery, type NdmCameraResultVO, type NdmCameraUpdateVO, type PageParams, type PageResult, type SnapResult } from '@/apis'; - -export const postNdmCameraPage = async (stationCode: string, pageQuery: PageParams, signal?: AbortSignal) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post>(`${prefix}/api/ndm/ndmCamera/page`, pageQuery, { signal }); - const [err, ndmCamera] = resp; - if (err || !ndmCamera) { - throw err; - } - return ndmCamera; -}; - -export const getNdmCameraDetail = async (stationCode: string, id: string) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.get(`${prefix}/api/ndm/ndmCamera/detail`, { params: { id } }); - const [err, ndmCamera] = resp; - if (err || !ndmCamera) { - throw err; - } - return ndmCamera; -}; - -export const putNdmCamera = async (stationCode: string, updateVO: NdmCameraUpdateVO) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.put(`${prefix}/api/ndm/ndmCamera`, updateVO); - const [err, ndmCamera] = resp; - if (err || !ndmCamera) { - throw err; - } - return await getNdmCameraDetail(stationCode, ndmCamera.id ?? ''); -}; - -export const getSnapByDeviceIdApi = async (deviceId: string) => { - const resp = await ndmClient.get(`/api/ndm/ndmCamera/getSnapByDeviceId`, { params: { deviceId } }); - const [err, snap] = resp; - if (err || !snap) { - throw err; - } - return snap; -}; diff --git a/src/apis/requests/device/video/ndm-decoder.ts b/src/apis/requests/device/video/ndm-decoder.ts deleted file mode 100644 index 3372491..0000000 --- a/src/apis/requests/device/video/ndm-decoder.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { ndmClient, type NdmDecoderPageQuery, type NdmDecoderResultVO, type NdmDecoderUpdateVO, type PageParams, type PageResult } from '@/apis'; - -export const postNdmDecoderPage = async (stationCode: string, pageQuery: PageParams, signal?: AbortSignal) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post>(`${prefix}/api/ndm/ndmDecoder/page`, pageQuery, { signal }); - const [err, ndmDecoder] = resp; - if (err || !ndmDecoder) { - throw err; - } - return ndmDecoder; -}; - -export const getNdmDecoderDetail = async (stationCode: string, id: string) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.get(`${prefix}/api/ndm/ndmDecoder/detail`, { params: { id } }); - const [err, ndmDecoder] = resp; - if (err || !ndmDecoder) { - throw err; - } - return ndmDecoder; -}; - -export const putNdmDecoder = async (stationCode: string, updateVO: NdmDecoderUpdateVO) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.put(`${prefix}/api/ndm/ndmDecoder`, updateVO); - const [err, ndmDecoder] = resp; - if (err || !ndmDecoder) { - throw err; - } - return await getNdmDecoderDetail(stationCode, ndmDecoder.id ?? ''); -}; - -export const probeNdmDecoderByIds = async (stationCode: string, ids: string[]) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post(`${prefix}/api/ndm/ndmDecoder/probeByIds`, ids); - const [err] = resp; - if (err) { - throw err; - } -}; diff --git a/src/apis/requests/device/video/ndm-keyboard.ts b/src/apis/requests/device/video/ndm-keyboard.ts deleted file mode 100644 index ce34d7e..0000000 --- a/src/apis/requests/device/video/ndm-keyboard.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { ndmClient, type NdmKeyboardPageQuery, type NdmKeyboardResultVO, type NdmKeyboardUpdateVO, type PageParams, type PageResult } from '@/apis'; - -export const postNdmKeyboardPage = async (stationCode: string, pageQuery: PageParams, signal?: AbortSignal) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post>(`${prefix}/api/ndm/ndmKeyboard/page`, pageQuery, { signal }); - const [err, ndmKeyboardData] = resp; - if (err || !ndmKeyboardData) { - throw err; - } - return ndmKeyboardData; -}; - -export const getNdmKeyboardDetail = async (stationCode: string, id: string) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.get(`${prefix}/api/ndm/ndmKeyboard/detail`, { params: { id } }); - const [err, ndmKeyboardData] = resp; - if (err || !ndmKeyboardData) { - throw err; - } - return ndmKeyboardData; -}; - -export const putNdmKeyboard = async (stationCode: string, updateVO: NdmKeyboardUpdateVO) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.put(`${prefix}/api/ndm/ndmKeyboard`, updateVO); - const [err, ndmKeyboard] = resp; - if (err || !ndmKeyboard) { - throw err; - } - return await getNdmKeyboardDetail(stationCode, ndmKeyboard.id ?? ''); -}; diff --git a/src/apis/requests/device/video/ndm-media-server.ts b/src/apis/requests/device/video/ndm-media-server.ts deleted file mode 100644 index ba602db..0000000 --- a/src/apis/requests/device/video/ndm-media-server.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { ndmClient, type NdmMediaServerPageQuery, type NdmMediaServerResultVO, type NdmMediaServerUpdateVO, type PageParams, type PageResult } from '@/apis'; - -export const postNdmMediaServerPage = async (stationCode: string, pageQuery: PageParams, signal?: AbortSignal) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post>(`${prefix}/api/ndm/ndmMediaServer/page`, pageQuery, { signal }); - const [err, ndmMediaServer] = resp; - if (err || !ndmMediaServer) { - throw err; - } - return ndmMediaServer; -}; - -export const getNdmMediaServerDetail = async (stationCode: string, id: string) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.get(`${prefix}/api/ndm/ndmMediaServer/detail`, { params: { id } }); - const [err, ndmMediaServer] = resp; - if (err || !ndmMediaServer) { - throw err; - } - return ndmMediaServer; -}; - -export const putNdmMediaServer = async (stationCode: string, updateVO: NdmMediaServerUpdateVO) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.put(`${prefix}/api/ndm/ndmMediaServer`, updateVO); - const [err, ndmMediaServer] = resp; - if (err || !ndmMediaServer) { - throw err; - } - return await getNdmMediaServerDetail(stationCode, ndmMediaServer.id ?? ''); -}; - -export const probeNdmMediaServerByIds = async (stationCode: string, ids: string[]) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post(`${prefix}/api/ndm/ndmMediaServer/probeByIds`, ids); - const [err] = resp; - if (err) { - throw err; - } -}; diff --git a/src/apis/requests/device/video/ndm-video-server.ts b/src/apis/requests/device/video/ndm-video-server.ts deleted file mode 100644 index dd52555..0000000 --- a/src/apis/requests/device/video/ndm-video-server.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { ndmClient, type NdmVideoServerPageQuery, type NdmVideoServerResultVO, type NdmVideoServerUpdateVO, type PageParams, type PageResult } from '@/apis'; - -export const postNdmVideoServerPage = async (stationCode: string, pageQuery: PageParams, signal?: AbortSignal) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post>(`${prefix}/api/ndm/ndmVideoServer/page`, pageQuery, { signal }); - const [err, ndmVideoServer] = resp; - if (err || !ndmVideoServer) { - throw err; - } - return ndmVideoServer; -}; - -export const getNdmVideoServerDetail = async (stationCode: string, id: string) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.get(`${prefix}/api/ndm/ndmVideoServer/detail`, { params: { id } }); - const [err, ndmVideoServer] = resp; - if (err || !ndmVideoServer) { - throw err; - } - return ndmVideoServer; -}; - -export const putNdmVideoServer = async (stationCode: string, updateVO: NdmVideoServerUpdateVO) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.put(`${prefix}/api/ndm/ndmVideoServer`, updateVO); - const [err, ndmVideoServer] = resp; - if (err || !ndmVideoServer) { - throw err; - } - return await getNdmVideoServerDetail(stationCode, ndmVideoServer.id ?? ''); -}; - -export const probeNdmVideoServerByIds = async (stationCode: string, ids: string[]) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post(`${prefix}/api/ndm/ndmVideoServer/probeByIds`, ids); - const [err] = resp; - if (err) { - throw err; - } -}; diff --git a/src/apis/requests/index.ts b/src/apis/requests/index.ts deleted file mode 100644 index 81b1dba..0000000 --- a/src/apis/requests/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './device'; -export * from './station'; -export * from './system'; diff --git a/src/apis/requests/station/index.ts b/src/apis/requests/station/index.ts deleted file mode 100644 index 0ef0890..0000000 --- a/src/apis/requests/station/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './ndm-verify'; diff --git a/src/apis/requests/station/ndm-verify.ts b/src/apis/requests/station/ndm-verify.ts deleted file mode 100644 index 8406539..0000000 --- a/src/apis/requests/station/ndm-verify.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { ndmClient } from '@/apis'; - -export const ndmVerify = async (stationCode: string, signal?: AbortSignal) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post(`${prefix}/api/ndm/ndmKeepAlive/verify`, {}, { timeout: 5000, signal }); - const [err] = resp; - if (err) { - throw err; - } -}; - -export interface BatchVerify { - name: string; - ipAddress: string; - stationCode: string; - verifyUrl: string; - onlineState: boolean; -} - -export const batchVerify = async (signal?: AbortSignal) => { - const resp = await ndmClient.post('/api/ndm/ndmKeepAlive/batchVerify', {}, { retRaw: true, timeout: 5000, signal }); - const [err, list] = resp; - if (err || !list) { - throw err; - } - return list; -}; diff --git a/src/apis/requests/system/def-parameter.ts b/src/apis/requests/system/def-parameter.ts deleted file mode 100644 index fd38b0f..0000000 --- a/src/apis/requests/system/def-parameter.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ndmClient, type DefParameterPageQuery, type DefParameterResultVO, type DefParameterUpdateVO, type PageParams, type PageResult } from '@/apis'; -import type { Result } from '@/axios'; - -export const postDefParameterPage = async (stationCode: string, pageQuery: PageParams) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.post>(`${prefix}/api/system/defParameter/page`, pageQuery); - const [err, defParameterData] = resp; - if (err || !defParameterData) { - throw err; - } - return defParameterData; -}; - -export const putDefParameter = async (stationCode: string, updateVO: DefParameterUpdateVO) => { - const prefix = stationCode ? `/${stationCode}` : ''; - const resp = await ndmClient.put>(`${prefix}/api/system/defParameter`, { ...updateVO }); - const [err, defParameterData] = resp; - if (err || !defParameterData) { - throw err; - } - return defParameterData; -}; diff --git a/src/components/device-page/device-card/__deprecated__/nvr-record-diag-card.old.vue b/src/components/device-page/device-card/__deprecated__/nvr-record-diag-card.old.vue index a147492..af26ac6 100644 --- a/src/components/device-page/device-card/__deprecated__/nvr-record-diag-card.old.vue +++ b/src/components/device-page/device-card/__deprecated__/nvr-record-diag-card.old.vue @@ -1,5 +1,5 @@ diff --git a/src/pages/dashboard-page.vue b/src/pages/dashboard-page.vue index 41c70c4..86b455d 100644 --- a/src/pages/dashboard-page.vue +++ b/src/pages/dashboard-page.vue @@ -1,5 +1,5 @@ + + + + diff --git a/src/pages/vimp-log-page.vue b/src/pages/vimp-log-page.vue index f25b2e6..82c8765 100644 --- a/src/pages/vimp-log-page.vue +++ b/src/pages/vimp-log-page.vue @@ -28,8 +28,8 @@ const vimpOperationTypeOptions: SelectOption[] = [