feat(article): expose auto_publish_platforms derived from publish accounts

Replace the freeform `platforms` field on articles/tasks (parsed out of
wizard_state/input_params JSON) with `auto_publish_platforms`, resolved
by joining schedule publish accounts to platform_accounts. The migration
strips the legacy keys from existing rows so the new field is the single
source of truth.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-01 11:02:21 +08:00
parent 0f4310c345
commit 490c6c759d
15 changed files with 172 additions and 137 deletions
+4 -4
View File
@@ -557,7 +557,7 @@ export interface ArticleListItem {
prompt_rule_id: number | null;
prompt_rule_name: string | null;
generation_mode: string | null;
platforms: string[];
auto_publish_platforms: string[];
generate_status: string;
publish_status: string;
title: string | null;
@@ -582,7 +582,7 @@ export interface ArticleDetail {
template_id: number | null;
template_name: string | null;
generation_mode: string | null;
platforms: string[];
auto_publish_platforms: string[];
cover_asset_url: string | null;
cover_image_asset_id: number | null;
generate_status: string;
@@ -632,7 +632,6 @@ export interface GenerateImitationResponse {
export interface UpdateArticleRequest {
title: string;
markdown_content: string;
platforms?: string[];
cover_asset_url?: string | null;
referenced_image_asset_ids?: number[];
cover_image_asset_id?: number | null;
@@ -1448,6 +1447,7 @@ export interface ScheduleTask {
cron_expr: string;
auto_publish: boolean;
publish_account_ids: string[];
auto_publish_platforms: string[];
cover_asset_url: string | null;
cover_image_asset_id: number | null;
enable_web_search: boolean;
@@ -1534,7 +1534,7 @@ export interface InstantTaskItem {
name: string;
status: string;
execution_time: string | null;
platforms: string[];
auto_publish_platforms: string[];
generate_count: number;
created_at: string;
}