chore: 初始化仓库基线(AGENTS.md、git 规范、敏感文件排除)
This commit is contained in:
@@ -0,0 +1,186 @@
|
||||
// ============================================
|
||||
// 蚕房环境监控系统 - 类型定义
|
||||
// ============================================
|
||||
|
||||
export interface User {
|
||||
id: string;
|
||||
username: string;
|
||||
email: string;
|
||||
fullName?: string;
|
||||
role: string;
|
||||
}
|
||||
|
||||
export interface Room {
|
||||
id: string;
|
||||
name: string;
|
||||
code?: string;
|
||||
location?: string;
|
||||
status?: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export interface Device {
|
||||
id: string;
|
||||
deviceKey: string;
|
||||
name: string;
|
||||
kind: string;
|
||||
model?: string;
|
||||
onlineStatus: string;
|
||||
lastSeen?: string;
|
||||
roomId?: string;
|
||||
}
|
||||
|
||||
export interface Alarm {
|
||||
id: string;
|
||||
code?: string;
|
||||
title?: string;
|
||||
message?: string;
|
||||
severity?: string;
|
||||
open: boolean;
|
||||
acknowledged: boolean;
|
||||
triggeredAt: string;
|
||||
resolvedAt?: string;
|
||||
deviceKey?: string;
|
||||
metric?: string;
|
||||
value?: number;
|
||||
thresholdMin?: number;
|
||||
thresholdMax?: number;
|
||||
}
|
||||
|
||||
export interface Threshold {
|
||||
id: string;
|
||||
name?: string;
|
||||
minValue: number;
|
||||
maxValue: number;
|
||||
debounceSeconds: number;
|
||||
severity: number;
|
||||
enabled: boolean;
|
||||
sensorId?: string;
|
||||
}
|
||||
|
||||
export interface Camera {
|
||||
id: number;
|
||||
roomId?: string;
|
||||
code: string;
|
||||
name: string;
|
||||
rtspUrl?: string;
|
||||
streamUrl?: string;
|
||||
hlsUrl?: string;
|
||||
flvUrl?: string;
|
||||
isOnline: boolean;
|
||||
gbDeviceId?: string;
|
||||
gbChannelId?: string;
|
||||
position?: string;
|
||||
resolution?: string;
|
||||
}
|
||||
|
||||
export interface TelemetryRecord {
|
||||
deviceKey: string;
|
||||
metric: string;
|
||||
value: number;
|
||||
timestamp: string;
|
||||
}
|
||||
|
||||
export interface LoginRequest {
|
||||
username: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface LoginResponse {
|
||||
accessToken: string;
|
||||
refreshToken: string;
|
||||
user: User;
|
||||
}
|
||||
|
||||
export interface ControlCommand {
|
||||
deviceKey: string;
|
||||
action: string;
|
||||
value?: string | number;
|
||||
payload?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface TelemetryQuery {
|
||||
deviceKey?: string;
|
||||
metric?: string;
|
||||
from?: string;
|
||||
to?: string;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export interface AlarmQuery {
|
||||
openOnly?: boolean;
|
||||
deviceKey?: string;
|
||||
severity?: string;
|
||||
}
|
||||
|
||||
export interface VideoClipQuery {
|
||||
cameraId?: number;
|
||||
from?: string;
|
||||
to?: string;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export interface VideoPlayRequest {
|
||||
format: 'hls' | 'flv' | 'webrtc';
|
||||
}
|
||||
|
||||
export interface VideoPlayResponse {
|
||||
url: string;
|
||||
format: string;
|
||||
}
|
||||
|
||||
export interface VideoClip {
|
||||
id: string;
|
||||
cameraId: number;
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
duration?: number;
|
||||
url?: string;
|
||||
thumbnail?: string;
|
||||
// 对齐 app 端字段
|
||||
trigger?: string;
|
||||
resolution?: string;
|
||||
sizeBytes?: string | number;
|
||||
startAt?: string;
|
||||
endAt?: string;
|
||||
durationSec?: number;
|
||||
playbackUrl?: string;
|
||||
}
|
||||
|
||||
export interface RealtimeMetric {
|
||||
key: string;
|
||||
name: string;
|
||||
value: number;
|
||||
unit: string;
|
||||
status: 'normal' | 'warn' | 'danger';
|
||||
}
|
||||
|
||||
export interface TrendPoint {
|
||||
time: string;
|
||||
temp?: number;
|
||||
humidity?: number;
|
||||
co2?: number;
|
||||
}
|
||||
|
||||
export interface ThresholdInput {
|
||||
name?: string;
|
||||
minValue: number;
|
||||
maxValue: number;
|
||||
debounceSeconds: number;
|
||||
severity: number;
|
||||
enabled: boolean;
|
||||
sensorId?: string;
|
||||
}
|
||||
|
||||
export interface DashboardStats {
|
||||
roomCount: number;
|
||||
deviceCount: number;
|
||||
onlineDeviceCount: number;
|
||||
alarmCount: number;
|
||||
openAlarmCount: number;
|
||||
}
|
||||
|
||||
export interface ApiResponse<T> {
|
||||
data: T;
|
||||
message?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user