feat(schedule): update PromptRuleID type to pgtype.Int8 in schedule task models
Backend CI / Backend (push) Successful in 15m13s

This commit is contained in:
2026-05-23 00:18:57 +08:00
parent 0d2cedb1e8
commit 3e806a5a02
2 changed files with 37 additions and 25 deletions
@@ -762,7 +762,7 @@ type QuotaReservation struct {
type ScheduleTask struct { type ScheduleTask struct {
ID int64 `json:"id"` ID int64 `json:"id"`
TenantID int64 `json:"tenant_id"` TenantID int64 `json:"tenant_id"`
PromptRuleID int64 `json:"prompt_rule_id"` PromptRuleID pgtype.Int8 `json:"prompt_rule_id"`
BrandID pgtype.Int8 `json:"brand_id"` BrandID pgtype.Int8 `json:"brand_id"`
Name string `json:"name"` Name string `json:"name"`
CronExpr string `json:"cron_expr"` CronExpr string `json:"cron_expr"`
@@ -781,6 +781,18 @@ type ScheduleTask struct {
PublishAccountIds []byte `json:"publish_account_ids"` PublishAccountIds []byte `json:"publish_account_ids"`
CoverAssetUrl pgtype.Text `json:"cover_asset_url"` CoverAssetUrl pgtype.Text `json:"cover_asset_url"`
CoverImageAssetID pgtype.Int8 `json:"cover_image_asset_id"` CoverImageAssetID pgtype.Int8 `json:"cover_image_asset_id"`
TargetType string `json:"target_type"`
SubscriptionPromptID pgtype.Int8 `json:"subscription_prompt_id"`
ScheduleKind string `json:"schedule_kind"`
ScheduleDays []byte `json:"schedule_days"`
ScheduleTimeMode string `json:"schedule_time_mode"`
RandomWindowStart pgtype.Time `json:"random_window_start"`
RandomWindowEnd pgtype.Time `json:"random_window_end"`
GenerationInputJson []byte `json:"generation_input_json"`
LastRunAt pgtype.Timestamptz `json:"last_run_at"`
LastDispatchStatus pgtype.Text `json:"last_dispatch_status"`
LastDispatchError pgtype.Text `json:"last_dispatch_error"`
ConsecutiveFailures int32 `json:"consecutive_failures"`
} }
type TaskRecord struct { type TaskRecord struct {
@@ -47,7 +47,7 @@ RETURNING id, created_at
type CreateScheduleTaskParams struct { type CreateScheduleTaskParams struct {
TenantID int64 `json:"tenant_id"` TenantID int64 `json:"tenant_id"`
WorkspaceID pgtype.Int8 `json:"workspace_id"` WorkspaceID pgtype.Int8 `json:"workspace_id"`
PromptRuleID int64 `json:"prompt_rule_id"` PromptRuleID pgtype.Int8 `json:"prompt_rule_id"`
BrandID pgtype.Int8 `json:"brand_id"` BrandID pgtype.Int8 `json:"brand_id"`
Name string `json:"name"` Name string `json:"name"`
CronExpr string `json:"cron_expr"` CronExpr string `json:"cron_expr"`
@@ -108,7 +108,7 @@ type GetScheduleTaskByIDRow struct {
ID int64 `json:"id"` ID int64 `json:"id"`
TenantID int64 `json:"tenant_id"` TenantID int64 `json:"tenant_id"`
WorkspaceID pgtype.Int8 `json:"workspace_id"` WorkspaceID pgtype.Int8 `json:"workspace_id"`
PromptRuleID int64 `json:"prompt_rule_id"` PromptRuleID pgtype.Int8 `json:"prompt_rule_id"`
BrandID pgtype.Int8 `json:"brand_id"` BrandID pgtype.Int8 `json:"brand_id"`
Name string `json:"name"` Name string `json:"name"`
CronExpr string `json:"cron_expr"` CronExpr string `json:"cron_expr"`
@@ -183,7 +183,7 @@ type ListScheduleTasksRow struct {
ID int64 `json:"id"` ID int64 `json:"id"`
TenantID int64 `json:"tenant_id"` TenantID int64 `json:"tenant_id"`
WorkspaceID pgtype.Int8 `json:"workspace_id"` WorkspaceID pgtype.Int8 `json:"workspace_id"`
PromptRuleID int64 `json:"prompt_rule_id"` PromptRuleID pgtype.Int8 `json:"prompt_rule_id"`
BrandID pgtype.Int8 `json:"brand_id"` BrandID pgtype.Int8 `json:"brand_id"`
Name string `json:"name"` Name string `json:"name"`
CronExpr string `json:"cron_expr"` CronExpr string `json:"cron_expr"`
@@ -277,7 +277,7 @@ WHERE id = $13 AND tenant_id = $14 AND deleted_at IS NULL
` `
type UpdateScheduleTaskParams struct { type UpdateScheduleTaskParams struct {
PromptRuleID int64 `json:"prompt_rule_id"` PromptRuleID pgtype.Int8 `json:"prompt_rule_id"`
BrandID pgtype.Int8 `json:"brand_id"` BrandID pgtype.Int8 `json:"brand_id"`
Name string `json:"name"` Name string `json:"name"`
CronExpr string `json:"cron_expr"` CronExpr string `json:"cron_expr"`