57 lines
2.0 KiB
Go
57 lines
2.0 KiB
Go
package db
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// Message represents a chat message (persisted in SQL DB per ADR-006)
|
|
type Message struct {
|
|
ID uint `gorm:"primarykey" json:"id"`
|
|
Room string `json:"room"`
|
|
Username string `json:"username"`
|
|
Text string `json:"text"`
|
|
Timestamp time.Time `json:"timestamp"`
|
|
Type string `json:"type"` // "public", "private", "system", "moderation"
|
|
}
|
|
|
|
// ModerationLog for audit trail (immutable per ADR-005)
|
|
type ModerationLog struct {
|
|
ID uint `gorm:"primarykey" json:"id"`
|
|
Action string `json:"action"` // "mute", "ban", "delete", "timeout"
|
|
Target string `json:"target"`
|
|
Moderator string `json:"moderator"`
|
|
Reason string `json:"reason"`
|
|
Timestamp time.Time `json:"timestamp"`
|
|
}
|
|
|
|
// Media stores admin media library metadata (filesystem + DB model per ADR-006)
|
|
type Media struct {
|
|
ID uint `gorm:"primarykey" json:"id"`
|
|
Filename string `gorm:"index" json:"filename"`
|
|
OriginalName string `json:"originalName"`
|
|
Path string `json:"path"`
|
|
SizeBytes int64 `json:"sizeBytes"`
|
|
DurationSeconds int `json:"durationSeconds"`
|
|
Status string `gorm:"index" json:"status"`
|
|
Title string `json:"title"`
|
|
Tags string `json:"tags"`
|
|
UploadedAt time.Time `gorm:"autoCreateTime" json:"uploadedAt"`
|
|
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updatedAt"`
|
|
}
|
|
|
|
// ScheduleOverride represents a scheduled playlist override (ADR-004)
|
|
type ScheduleOverride struct {
|
|
ID uint `gorm:"primarykey" json:"id"`
|
|
MediaID uint `json:"mediaId"`
|
|
StartTime time.Time `json:"startTime"`
|
|
EndTime time.Time `json:"endTime"`
|
|
Reason string `json:"reason"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
}
|
|
|
|
// Presence tracks online users per room (using Redis per ADR-007)
|
|
type Presence struct {
|
|
Username string `json:"username"`
|
|
Room string `json:"room"`
|
|
Online bool `json:"online"`
|
|
} |