feat: Add player_configs feature and migrate user preferences
- Implemented player_configs table to store multiple player configurations per user. - Migrated existing player settings from user_preferences to player_configs. - Removed player-related columns from user_preferences. - Added referral state fields to user for tracking referral rewards. - Created migration scripts for database changes and data migration. - Added test cases for app services and usage helpers. - Introduced video job service interfaces and implementations.
This commit is contained in:
34
internal/video/interfaces.go
Normal file
34
internal/video/interfaces.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package video
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
runtimedomain "stream.api/internal/video/runtime/domain"
|
||||
runtimeservices "stream.api/internal/video/runtime/services"
|
||||
)
|
||||
|
||||
type Job = runtimedomain.Job
|
||||
|
||||
type AgentWithStats = runtimeservices.AgentWithStats
|
||||
|
||||
type PaginatedJobs = runtimeservices.PaginatedJobs
|
||||
|
||||
var ErrInvalidJobCursor = runtimeservices.ErrInvalidJobCursor
|
||||
|
||||
type JobService interface {
|
||||
CreateJob(ctx context.Context, userID string, videoID string, name string, config []byte, priority int, timeLimit int64) (*Job, error)
|
||||
ListJobs(ctx context.Context, offset, limit int) (*PaginatedJobs, error)
|
||||
ListJobsByAgent(ctx context.Context, agentID string, offset, limit int) (*PaginatedJobs, error)
|
||||
ListJobsByCursor(ctx context.Context, agentID string, cursor string, pageSize int) (*PaginatedJobs, error)
|
||||
GetJob(ctx context.Context, id string) (*Job, error)
|
||||
CancelJob(ctx context.Context, id string) error
|
||||
RetryJob(ctx context.Context, id string) (*Job, error)
|
||||
SubscribeJobLogs(ctx context.Context, jobID string) (<-chan runtimedomain.LogEntry, error)
|
||||
SubscribeJobUpdates(ctx context.Context) (<-chan string, error)
|
||||
SubscribeSystemResources(ctx context.Context) (<-chan runtimedomain.SystemResource, error)
|
||||
}
|
||||
|
||||
type AgentRuntime interface {
|
||||
ListAgentsWithStats() []*AgentWithStats
|
||||
SendCommand(agentID string, cmd string) bool
|
||||
}
|
||||
Reference in New Issue
Block a user