feat(schedule): support KOL subscription targets and random time windows
Frontend CI / Frontend (push) Successful in 3m37s
Backend CI / Backend (push) Failing after 6m47s

Extend schedule tasks to dispatch KOL subscription prompts in addition
to prompt rules, add daily/weekly scheduling with fixed or random time
windows, and track dispatch outcomes (last run, status, consecutive
failures).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-22 23:51:45 +08:00
parent 9cc6537e68
commit c28c4f1419
20 changed files with 3034 additions and 329 deletions
+32 -20
View File
@@ -3,24 +3,36 @@ package domain
import "time"
type ScheduleTask struct {
ID int64
TenantID int64
WorkspaceID *int64
OperatorID *int64
PromptRuleID int64
BrandID *int64
Name string
CronExpr string
AutoPublish bool
PublishAccountIDs []string
CoverAssetURL *string
CoverImageAssetID *int64
EnableWebSearch bool
GenerateCount int
StartAt *time.Time
EndAt *time.Time
NextRunAt *time.Time
Status string
CreatedAt time.Time
UpdatedAt time.Time
ID int64
TenantID int64
WorkspaceID *int64
OperatorID *int64
TargetType string
PromptRuleID *int64
SubscriptionPromptID *int64
BrandID *int64
Name string
CronExpr string
ScheduleKind string
ScheduleDays []string
ScheduleTimeMode string
RandomWindowStart string
RandomWindowEnd string
GenerationInput map[string]interface{}
AutoPublish bool
PublishAccountIDs []string
CoverAssetURL *string
CoverImageAssetID *int64
EnableWebSearch bool
GenerateCount int
StartAt *time.Time
EndAt *time.Time
NextRunAt *time.Time
LastRunAt *time.Time
LastDispatchStatus *string
LastDispatchError *string
ConsecutiveFailures int
Status string
CreatedAt time.Time
UpdatedAt time.Time
}