| 123456789101112131415161718192021 |
- package dao
- import "time"
- // DeviceImage maps an edge-uploaded image ID to the managed image path.
- // Image bytes are stored by the configured OSS provider.
- type DeviceImage struct {
- ID uint `gorm:"primaryKey" json:"id"`
- DeviceCode string `gorm:"size:50;not null;index:idx_device_image_lookup,priority:1" json:"device_code"`
- ImageID string `gorm:"size:128;not null;index:idx_device_image_lookup,priority:2;uniqueIndex:uk_device_image" json:"image_id"`
- EventID string `gorm:"size:128;index" json:"event_id"`
- Direction string `gorm:"size:10" json:"direction"`
- URL string `gorm:"type:text;not null" json:"url"`
- Key string `gorm:"size:512" json:"key"`
- ContentType string `gorm:"size:100" json:"content_type"`
- Size int64 `json:"size"`
- SHA256 string `gorm:"size:64" json:"sha256"`
- CreatedAt time.Time `json:"created_at"`
- }
- func (DeviceImage) TableName() string { return "device_image" }
|