| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680 |
- // API 响应类型 - 基础响应(无数据)
- export interface BaseResponse {
- success: boolean
- errCode?: string
- errMessage?: string
- }
- // API 响应类型 - 单个数据响应
- export interface IBaseResponse<T> {
- data?: T
- success: boolean
- errCode?: string
- errMessage?: string
- }
- // API 响应类型 - 分页列表响应
- export interface IResponse<T> {
- success: boolean
- errCode?: string
- errMessage?: string
- data: {
- total: string
- list: T[]
- }
- }
- // 兼容旧代码 - ApiResponse 别名
- export type ApiResponse<T = any> = IResponse<T>
- // 分页参数(旧版,兼容)
- export interface PageParams {
- pageNum: number
- pageSize: number
- }
- // 分页响应(旧版,兼容)
- export interface PageResult<T = any> {
- total: number
- rows: T[]
- }
- // 分页请求参数(新版)
- export interface PageRequest {
- page?: number
- size?: number
- keyword?: string
- enabled?: boolean | null
- sortBy?: string
- sortDir?: 'ASC' | 'DESC'
- }
- // 分页响应(新版)
- export interface PageResponse<T> {
- list: T[]
- page: number
- size: number
- total: number
- totalPages: number
- hasNext: boolean
- hasPrevious: boolean
- }
- // 带分页的 API 响应
- export interface IPageResponse<T> {
- success: boolean
- errCode?: string
- errMessage?: string
- data: PageResponse<T>
- }
- // 列表 API 响应(数组形式)
- export interface IListResponse<T> {
- success: boolean
- errCode?: string
- errMessage?: string
- data: T[]
- }
- // 登录参数
- export interface LoginParams {
- username: string
- password: string
- }
- // 登录响应
- export interface LoginResponse {
- token: string
- tokenType: string
- expiresIn: number
- refreshToken?: string
- admin: AdminInfo
- }
- // 管理员信息
- export interface AdminInfo {
- id: number
- username: string
- nickname: string
- role: string
- lastLoginAt?: string
- }
- // 用户信息 (兼容旧代码)
- export interface UserInfo {
- id: number
- username: string
- nickname: string
- role: string
- lastLoginAt?: string
- }
- // 通道信息 (Controller 用)
- export interface ChannelDTO {
- channelId: string
- name: string
- rtspUrl: string
- defaultView: boolean
- status: 'ONLINE' | 'OFFLINE'
- cameraId: string
- }
- // 摄像头信息 (Controller 用)
- export interface CameraDTO {
- cameraId: string
- name: string
- machineId: string
- status: 'ONLINE' | 'OFFLINE'
- capability: 'switch_only' | 'ptz_enabled'
- ptzSupported: boolean
- channels: ChannelDTO[]
- }
- // 通道详情 (Admin 用)
- export interface ChannelInfoDTO {
- id: number
- channelId: string
- name: string
- rtspUrl: string
- defaultView: boolean
- status: 'ONLINE' | 'OFFLINE'
- }
- // 摄像头详情 (Admin 用)
- export interface CameraInfoDTO {
- id: number
- cameraId: string
- name: string
- ip: string
- port: number
- username: string
- brand: string
- capability: 'switch_only' | 'ptz_enabled'
- status: 'ONLINE' | 'OFFLINE'
- lssId?: string
- model?: string
- rtspUrl?: string
- channelNo?: string
- remark?: string
- machineId?: string
- machineName?: string
- enabled: boolean
- channels?: ChannelInfoDTO[]
- configParams?: string
- runParams?: string
- createdAt: string
- updatedAt: string
- }
- // 添加摄像头请求
- export interface CameraAddRequest {
- cameraId: string
- name: string
- ip: string
- port?: number
- username?: string
- password?: string
- brand?: string
- capability?: 'switch_only' | 'ptz_enabled'
- machineId?: string
- lssId?: string
- model?: string
- rtspUrl?: string
- channelNo?: string
- remark?: string
- channels?: ChannelAddRequest[]
- }
- // 添加通道请求
- export interface ChannelAddRequest {
- channelId: string
- name: string
- rtspUrl?: string
- defaultView?: boolean
- }
- // 更新摄像头请求
- export interface CameraUpdateRequest {
- id: number
- name?: string
- ip?: string
- port?: number
- username?: string
- password?: string
- brand?: string
- capability?: 'switch_only' | 'ptz_enabled'
- machineId?: string
- lssId?: string
- model?: string
- rtspUrl?: string
- channelNo?: string
- remark?: string
- enabled?: boolean
- configParams?: string
- runParams?: string
- channels?: ChannelUpdateRequest[]
- }
- // 更新通道请求
- export interface ChannelUpdateRequest {
- id?: number
- channelId?: string
- name?: string
- rtspUrl?: string
- defaultView?: boolean
- }
- // 切换通道请求
- export interface SwitchChannelRequest {
- machineId: string
- channelId: string
- }
- // 机器信息
- export interface MachineDTO {
- id: number
- machineId: string
- name: string
- location: string
- description: string
- enabled: boolean
- cameraCount: number
- createdAt: string
- updatedAt: string
- }
- // 添加机器请求
- export interface MachineAddRequest {
- machineId: string
- name: string
- location?: string
- description?: string
- }
- // 更新机器请求
- export interface MachineUpdateRequest {
- id: number
- name?: string
- location?: string
- description?: string
- enabled?: boolean
- }
- // 仪表盘统计
- export interface DashboardStatsDTO {
- machineTotal: number
- machineEnabled: number
- cameraTotal: number
- cameraOnline: number
- cameraOffline: number
- channelTotal: number
- }
- // 修改密码请求
- export interface ChangePasswordRequest {
- oldPassword: string
- newPassword: string
- }
- // PTZ 动作类型
- export type PTZAction =
- | 'up'
- | 'down'
- | 'left'
- | 'right'
- | 'zoom_in'
- | 'zoom_out'
- | 'stop'
- | 'UP'
- | 'DOWN'
- | 'LEFT'
- | 'RIGHT'
- | 'ZOOM_IN'
- | 'ZOOM_OUT'
- | 'STOP'
- // PTZ 直接控制请求 (pan/tilt/zoom 方式)
- export interface PTZControlRequest {
- pan?: number // 水平移动速度 -100 ~ 100
- tilt?: number // 垂直移动速度 -100 ~ 100
- zoom?: number // 缩放速度 -100 ~ 100
- channel?: number // 通道号(可选)
- }
- // Admin PTZ 控制请求
- export interface AdminPTZRequest {
- id: number
- action: PTZAction
- speed?: number // 0.0 - 1.0
- }
- // 摄像头列表请求参数
- export interface CameraListRequest extends PageRequest {
- machineId?: string
- lssId?: string
- status?: 'ONLINE' | 'OFFLINE'
- enabled?: boolean
- }
- // 机器列表请求参数
- export interface MachineListRequest extends PageRequest {
- // 继承 PageRequest 的所有属性
- }
- // 兼容旧代码的类型别名
- export type CameraDevice = CameraInfoDTO
- export type CameraChannel = ChannelInfoDTO
- // 播放响应 (保留用于视频播放)
- export interface PlayResponse {
- streamId: string
- flv: string
- ws_flv?: string
- rtsp?: string
- rtmp?: string
- hls?: string
- rtc?: string
- mediaServerId?: string
- deviceId?: string
- channelId?: string
- }
- // 录像记录 (保留用于视频回放)
- export interface RecordItem {
- name?: string
- start: number
- end: number
- secrecy?: number
- type?: string
- }
- // ==================== LSS 节点相关类型 ====================
- // LSS 节点状态
- export type LssNodeStatus = 'hold' | 'active' | 'dead'
- // LSS 节点信息 (新 API)
- export interface LssNodeDTO {
- id: number
- lssId: string
- lssName: string
- machineId?: string
- address: string
- publicIp?: string
- maxTasks: number
- currentTasks: number
- status: LssNodeStatus
- heartbeat?: LssHeartbeatStatus
- heartbeatTime?: string
- ablyInfo?: string
- ffmpegVersion?: string
- systemInfo?: string
- enabled: boolean
- createdAt: string
- updatedAt: string
- }
- // LSS 节点列表请求参数
- export interface LssNodeListRequest extends PageRequest {
- status?: LssNodeStatus
- machineId?: string
- }
- // LSS 节点统计信息
- export interface LssNodeStatsDTO {
- total: number
- online: number
- offline: number
- busy: number
- maintenance: number
- }
- // 兼容旧代码 - LSS 心跳状态
- export type LssHeartbeatStatus = 'active' | 'hold' | 'dead'
- // 兼容旧代码 - LSS 信息 (旧 API)
- export interface LssDTO {
- id: number
- lssId: string
- name: string
- address: string
- publicIp?: string
- heartbeat?: LssHeartbeatStatus
- heartbeatTime?: string
- ablyInfo?: string
- }
- // 兼容旧代码 - LSS 列表请求参数
- export interface LssListRequest extends PageRequest {
- heartbeat?: LssHeartbeatStatus
- }
- // ==================== StreamChannel 推流通道相关类型 (Cloudflare Stream) ====================
- // 推流模式
- export type StreamChannelMode = 'WHIP' | 'RTMPS' | 'SRT'
- // 推流通道信息 (StreamChannelInfoDTO)
- export interface StreamChannelDTO {
- id: number
- channelId: string
- name: string
- accountId?: string
- liveInputId?: string
- customerSubdomain?: string
- mode?: StreamChannelMode
- whipUrl?: string
- rtmpsUrl?: string
- hlsPlaybackUrl?: string
- whepPlaybackUrl?: string
- recordingEnabled?: boolean
- enabled: boolean
- createdAt: string
- updatedAt: string
- }
- // 推流通道列表请求参数
- export interface StreamChannelListRequest extends PageRequest {
- // 继承 PageRequest 的所有属性 (page, size, keyword, enabled, sortBy, sortDir)
- }
- // 创建推流通道请求
- export interface StreamChannelAddRequest {
- channelId: string
- name: string
- accountId?: string
- apiToken?: string
- liveInputId: string
- streamKey?: string
- customerSubdomain: string
- mode?: StreamChannelMode
- recordingEnabled?: boolean
- }
- // 更新推流通道请求
- export interface StreamChannelUpdateRequest {
- id: number
- name?: string
- accountId?: string
- apiToken?: string
- liveInputId?: string
- streamKey?: string
- customerSubdomain?: string
- mode?: StreamChannelMode
- recordingEnabled?: boolean
- enabled?: boolean
- }
- // ==================== LiveStream 推流管理相关类型 ====================
- // LiveStream 状态
- export type LiveStreamStatus = 'IDLE' | 'STREAMING' | 'STOPPED' | 'ERROR'
- // LiveStream 信息 (LiveStreamInfoDTO)
- export interface LiveStreamDTO {
- id: number
- streamSn: string
- name: string
- lssId?: string
- cameraId?: string
- channelId?: number
- pushMethod?: string
- commandTemplate?: string
- timeoutSeconds?: number
- status: LiveStreamStatus
- enabled: boolean
- remark?: string
- createdAt: string
- updatedAt: string
- taskStreamSn?: string
- playbackUrl?: string
- }
- // LiveStream 列表请求参数
- export interface LiveStreamListRequest extends PageRequest {
- // 继承 PageRequest 的所有属性 (page, size, keyword, enabled, sortBy, sortDir)
- }
- // 创建 LiveStream 请求
- export interface LiveStreamAddRequest {
- name: string
- lssId: string
- cameraId?: string
- channelId?: number
- pushMethod?: string
- commandTemplate?: string
- timeoutSeconds?: number
- remark?: string
- }
- // 更新 LiveStream 请求
- export interface LiveStreamUpdateRequest {
- id: number
- name?: string
- lssId?: string
- cameraId?: string
- channelId?: number
- pushMethod?: string
- commandTemplate?: string
- timeoutSeconds?: number
- enabled?: boolean
- remark?: string
- }
- // ==================== 摄像头厂家相关类型 ====================
- // 摄像头厂家信息
- export interface CameraVendorDTO {
- id: number
- code: string
- name: string
- description?: string
- logoUrl?: string
- supportOnvif: boolean
- supportPtz: boolean
- supportIsapi: boolean
- supportGb28181: boolean
- supportAudio: boolean
- resolution?: string
- defaultPort?: number
- defaultRtspPort?: number
- rtspUrlTemplate?: string
- enabled: boolean
- sortOrder?: number
- createdAt: string
- updatedAt: string
- }
- // 摄像头厂家列表请求参数
- export interface CameraVendorListRequest extends PageRequest {
- // 继承 PageRequest 的所有属性
- }
- // 创建摄像头厂家请求
- export interface CameraVendorAddRequest {
- code: string
- name: string
- description?: string
- logoUrl?: string
- supportOnvif?: boolean
- supportPtz?: boolean
- supportIsapi?: boolean
- supportGb28181?: boolean
- supportAudio?: boolean
- resolution?: string
- defaultPort?: number
- defaultRtspPort?: number
- rtspUrlTemplate?: string
- enabled?: boolean
- sortOrder?: number
- }
- // 更新摄像头厂家请求
- export interface CameraVendorUpdateRequest {
- id: number
- code: string
- name: string
- description?: string
- logoUrl?: string
- supportOnvif?: boolean
- supportPtz?: boolean
- supportIsapi?: boolean
- supportGb28181?: boolean
- supportAudio?: boolean
- resolution?: string
- defaultPort?: number
- defaultRtspPort?: number
- rtspUrlTemplate?: string
- enabled?: boolean
- sortOrder?: number
- }
- // ==================== 推流服务相关类型 (Stream Push) ====================
- // 本地视频推流 DTO
- export interface LocalVideoStreamDTO {
- streamName: string
- sourceType: 'local_video' | 'rtsp_camera'
- sourcePath: string
- rtspUrl?: string
- loop: boolean
- streamTaskId?: string
- playbackUrl?: string
- status: string
- }
- // 启动本地视频推流请求
- export interface StartLocalStreamRequest {
- streamName?: string
- videoPath?: string
- loop?: boolean
- targetChannelId?: string
- }
- // 推流任务状态
- export type StreamTaskStatus = 'IDLE' | 'STARTING' | 'STREAMING' | 'STOPPED' | 'ERROR'
- // 推流任务 DTO
- export interface StreamTaskDTO {
- streamSn: string
- name: string
- lssId: string
- cameraId: string
- sourceRtspUrl: string
- profile: 'low_latency' | 'standard' | 'file_loop'
- whipUrl: string
- playbackUrl: string
- status: StreamTaskStatus
- statusDescription?: string
- errorMessage?: string
- retryCount: number
- remark?: string
- createdAt: string
- startedAt?: string
- stoppedAt?: string
- }
- // 启动推流任务请求
- export interface StartStreamTaskRequest {
- name?: string
- lssId?: string
- cameraId: string
- sourceRtspUrl?: string
- profile?: 'low_latency' | 'standard' | 'file_loop'
- whipUrl?: string
- playbackUrl?: string
- remark?: string
- }
- // 停止推流任务请求
- export interface StopStreamTaskRequest {
- taskId?: string
- lssId?: string
- }
- // 切换推流源请求
- export interface SwitchStreamSourceRequest {
- streamSn: string
- newCameraId: string
- newRtspUrl: string
- }
- // 推流通道信息 DTO (推流服务用)
- export interface StreamPushChannelDTO {
- channelId: string
- name: string
- mode: 'WHIP' | 'RTMPS'
- hlsPlaybackUrl?: string
- recordingEnabled: boolean
- }
- // 播放信息 DTO
- export interface PlaybackInfoDTO {
- streamSn: string
- name: string
- status: StreamTaskStatus
- whepUrl?: string
- hlsUrl?: string
- iframeCode?: string
- isLive: boolean
- }
|