Phase 2 completed: Stream Server Auth, Database and Business API

This commit is contained in:
2026-03-16 15:54:41 +08:00
commit c84dd6ea36
16 changed files with 757 additions and 0 deletions

14
internal/model/room.go Normal file
View File

@@ -0,0 +1,14 @@
package model
import (
"gorm.io/gorm"
)
// Room represents a user's personal live streaming room.
type Room struct {
gorm.Model
UserID uint `gorm:"uniqueIndex;not null"`
Title string `gorm:"default:'My Live Room'"`
StreamKey string `gorm:"uniqueIndex;not null"` // Secret key for OBS streaming
IsActive bool `gorm:"default:false"` // Whether the stream is currently active
}

12
internal/model/user.go Normal file
View File

@@ -0,0 +1,12 @@
package model
import (
"gorm.io/gorm"
)
// User represents a registered user in the system.
type User struct {
gorm.Model
Username string `gorm:"uniqueIndex;not null"`
Password string `gorm:"not null"` // Hashed password
}