From 490c6c759d7fd2380bf42f5eaec56cefa8b4a1b2 Mon Sep 17 00:00:00 2001 From: liangxu Date: Fri, 1 May 2026 11:02:21 +0800 Subject: [PATCH] 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) --- .../src/components/CustomArticleTab.vue | 6 +- .../src/components/InstantTaskTab.vue | 6 +- .../src/components/PublishArticleModal.vue | 13 +- .../src/components/ScheduleTaskTab.vue | 7 +- apps/admin-web/src/i18n/messages/en-US.ts | 2 +- apps/admin-web/src/i18n/messages/zh-CN.ts | 2 +- apps/admin-web/src/views/TemplatesView.vue | 2 +- packages/shared-types/src/index.ts | 8 +- server/internal/tenant/app/article_service.go | 18 ++- .../tenant/app/instant_task_service.go | 26 ++-- .../tenant/app/prompt_generate_service.go | 2 +- .../internal/tenant/app/publish_platforms.go | 142 +++++++++--------- .../tenant/app/schedule_task_service.go | 63 +++++--- ...move_legacy_article_platform_json.down.sql | 1 + ...remove_legacy_article_platform_json.up.sql | 11 ++ 15 files changed, 172 insertions(+), 137 deletions(-) create mode 100644 server/migrations/20260501103000_remove_legacy_article_platform_json.down.sql create mode 100644 server/migrations/20260501103000_remove_legacy_article_platform_json.up.sql diff --git a/apps/admin-web/src/components/CustomArticleTab.vue b/apps/admin-web/src/components/CustomArticleTab.vue index 05db7de..2fdf9e6 100644 --- a/apps/admin-web/src/components/CustomArticleTab.vue +++ b/apps/admin-web/src/components/CustomArticleTab.vue @@ -116,7 +116,7 @@ const deleteMutation = useMutation({ const columns = computed>(() => [ { title: t("custom.article.titleColumn"), dataIndex: "title", key: "title", width: 340 }, { title: t("custom.filters.promptRule"), dataIndex: "prompt_rule_name", key: "prompt_rule_name", width: 160 }, - { title: t("custom.schedule.platform"), dataIndex: "platforms", key: "platforms", width: 180 }, + { title: t("custom.schedule.autoPublishPlatforms"), dataIndex: "auto_publish_platforms", key: "auto_publish_platforms", width: 180 }, { title: t("common.generateStatus"), dataIndex: "generate_status", key: "generate_status", width: 128 }, { title: t("common.publishStatus"), dataIndex: "publish_status", key: "publish_status", width: 128 }, { title: t("common.wordCount"), dataIndex: "word_count", key: "word_count", width: 100 }, @@ -319,8 +319,8 @@ onBeforeUnmount(() => { -