feat(server-go): AI 巡检闭环后端(inspection_records + /inspections 幂等接口)
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
)
|
||||
|
||||
// InspectionRecord AI 巡检记录
|
||||
type InspectionRecord struct {
|
||||
ID string `gorm:"type:uuid;primaryKey;default:gen_random_uuid()" json:"id"`
|
||||
UserID *string `gorm:"column:user_id;type:uuid;index" json:"userId,omitempty"`
|
||||
RoomID *string `gorm:"column:room_id;type:uuid;index" json:"roomId,omitempty"`
|
||||
ImageURL *string `gorm:"column:image_url;size:512" json:"imageUrl,omitempty"`
|
||||
Detections json.RawMessage `gorm:"column:detections;type:jsonb" json:"detections,omitempty"`
|
||||
RiskScore *float64 `gorm:"column:risk_score;type:float" json:"riskScore,omitempty"`
|
||||
RiskLevel *string `gorm:"column:risk_level;size:16" json:"riskLevel,omitempty"`
|
||||
AIStatus string `gorm:"column:ai_status;size:16;default:done" json:"aiStatus"`
|
||||
IdempotencyKey *string `gorm:"column:idempotency_key;size:128;uniqueIndex" json:"idempotencyKey,omitempty"`
|
||||
CreatedAt time.Time `gorm:"type:timestamptz" json:"createdAt"`
|
||||
UpdatedAt time.Time `gorm:"type:timestamptz" json:"updatedAt"`
|
||||
}
|
||||
|
||||
func (InspectionRecord) TableName() string { return "inspection_records" }
|
||||
Reference in New Issue
Block a user