feat(aiot): 新增方案B实体类

- AiAlert: AI告警实体
- AiAlgoTemplate: 算法参数模板实体
- AiConfigSnapshot: 配置版本快照实体
- AiEdgeDevice: 边缘设备状态实体
- AiRoiAlgoBind: 新增 templateId 和 paramOverride 字段

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-05 13:31:13 +08:00
parent fe308474ff
commit b0df1485ad
5 changed files with 165 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
package com.genersoft.iot.vmp.aiot.bean;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
@Schema(description = "AI告警记录")
public class AiAlert {
@Schema(description = "数据库自增ID")
private Long id;
@Schema(description = "告警唯一ID")
private String alertId;
@Schema(description = "摄像头ID")
private String cameraId;
@Schema(description = "ROI区域ID")
private String roiId;
@Schema(description = "绑定ID")
private String bindId;
@Schema(description = "告警类型leave_post/intrusion/crowd_detection")
private String alertType;
@Schema(description = "目标类别")
private String targetClass;
@Schema(description = "置信度")
private Double confidence;
@Schema(description = "边界框JSON: [x1,y1,x2,y2]")
private String bbox;
@Schema(description = "告警消息")
private String message;
@Schema(description = "告警图片路径")
private String imagePath;
@Schema(description = "持续时长(分钟)")
private Double durationMinutes;
@Schema(description = "扩展数据JSON")
private String extraData;
@Schema(description = "接收时间")
private String receivedAt;
}

View File

@@ -0,0 +1,33 @@
package com.genersoft.iot.vmp.aiot.bean;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
@Schema(description = "算法参数模板")
public class AiAlgoTemplate {
@Schema(description = "数据库自增ID")
private Integer id;
@Schema(description = "模板唯一ID")
private String templateId;
@Schema(description = "模板名称")
private String templateName;
@Schema(description = "关联算法代码")
private String algoCode;
@Schema(description = "JSON参数")
private String params;
@Schema(description = "描述")
private String description;
@Schema(description = "创建时间")
private String createTime;
@Schema(description = "更新时间")
private String updateTime;
}

View File

@@ -0,0 +1,39 @@
package com.genersoft.iot.vmp.aiot.bean;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
@Schema(description = "配置版本快照")
public class AiConfigSnapshot {
@Schema(description = "数据库自增ID")
private Long id;
@Schema(description = "版本号同scope维度自增")
private Integer version;
@Schema(description = "范围类型CAMERA/ROI/BIND")
private String scopeType;
@Schema(description = "范围IDcamera_id/roi_id/bind_id")
private String scopeId;
@Schema(description = "所属摄像头ID")
private String cameraId;
@Schema(description = "完整JSON快照")
private String snapshot;
@Schema(description = "变更类型CREATE/UPDATE/DELETE/ROLLBACK/PUSH")
private String changeType;
@Schema(description = "变更描述")
private String changeDesc;
@Schema(description = "操作人")
private String createdBy;
@Schema(description = "创建时间")
private String createdAt;
}

View File

@@ -0,0 +1,36 @@
package com.genersoft.iot.vmp.aiot.bean;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
@Schema(description = "边缘设备状态")
public class AiEdgeDevice {
@Schema(description = "数据库自增ID")
private Integer id;
@Schema(description = "设备唯一ID")
private String deviceId;
@Schema(description = "状态online/offline")
private String status;
@Schema(description = "最后心跳时间")
private String lastHeartbeat;
@Schema(description = "运行时长(秒)")
private Long uptimeSeconds;
@Schema(description = "已处理帧数")
private Long framesProcessed;
@Schema(description = "已生成告警数")
private Long alertsGenerated;
@Schema(description = "流统计信息JSON")
private String streamStats;
@Schema(description = "更新时间")
private String updatedAt;
}

View File

@@ -28,6 +28,12 @@ public class AiRoiAlgoBind {
@Schema(description = "启用状态")
private Integer enabled;
@Schema(description = "引用的模板IDNULL表示独立参数")
private String templateId;
@Schema(description = "覆盖模板的局部参数JSON")
private String paramOverride;
@Schema(description = "创建时间")
private String createTime;