feat(schedule-tasks): support auto-publish via media accounts

Replace the legacy target_platform string on schedule tasks with a
workspace-aware auto-publish payload (auto_publish + publish_account_ids
JSONB + cover_asset_url + cover_image_asset_id) and migrate the schema,
sqlc queries, generated models, domain struct, ScheduleTaskService DTOs,
and dispatch worker to round-trip the new fields. PromptRuleGeneration
gains a WithPublishJobService hook so executeGeneration can enqueue an
auto-publish job once the article is ready, and worker-generate wires
the publish-job service in. On the admin-web side, extract
PublishArticleModal's account-card builders into a shared
publish-account-cards module, rebuild GenerateTaskDrawer's schedule
mode around account selection plus a CoverPickerModal, and surface the
new "auto publish" column on ScheduleTaskTab. Shared types and i18n
strings cover the new fields.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-30 01:32:19 +08:00
parent c9267d2fae
commit 6e6e19cccb
22 changed files with 1380 additions and 603 deletions
+17 -2
View File
@@ -91,6 +91,7 @@ const zhCN = {
},
auth: {
welcomeBack: "欢迎回来",
tenantAdminLogin: "租户后台登录",
loginAndEnter: "登录并进入工作台",
email: "邮箱",
loginIdentifier: "手机号 / 邮箱",
@@ -597,7 +598,7 @@ const zhCN = {
publishing: "发布中",
success: "发布成功",
failed: "发布失败",
partial_success: "部分成功",
partial_success: "部分发布",
published: "发布成功",
publish_success: "发布成功",
publish_failed: "发布失败",
@@ -1263,10 +1264,20 @@ const zhCN = {
platformUnauthorized: "未授权",
platformEmptyTitle: "暂无发布平台",
platformEmptyHint: "当前还没有可用的平台数据,请先检查媒体管理配置。",
publishSection: "发布设置",
autoPublish: "是否自动发布",
autoPublishHint: "开启后,定时生成完成的文章会使用指定媒体账号自动进入发布队列。",
publishAccounts: "媒体账号",
publishAccountsHint: "请选择具体账号。客户端离线时会先排队,上线后继续发布。",
publishAccountEmptyTitle: "暂无可选媒体账号",
publishAccountEmptyHint: "请先在桌面端绑定媒体账号,再回到这里配置自动发布。",
cover: "封面图",
coverHint: "请保证封面清晰、美观和完整",
scheduleCoverHint: "默认不设置封面。需要时可单独指定,生成完成后会写入文章并用于发布。",
scheduleCoverRequiredHint: "已选账号的平台要求发布封面,请先选择封面图。",
coverUpload: "上传封面图",
coverUploadHint: "当前仅做本地预览",
scheduleCoverUploadHint: "从本地或素材库选择",
scheduleTime: "定时生成文章",
scheduleEveryDay: "每天",
enableWebSearch: "生成文章联网搜索",
@@ -1285,7 +1296,9 @@ const zhCN = {
name: "任务名称",
rule: "关联规则",
cron: "执行频率",
platform: "目标平台",
autoPublish: "自动发布",
manualPublish: "手动发布",
autoPublishAccountCount: "自动 · {count} 个账号",
nextRun: "下次执行",
startAt: "开始时间",
endAt: "结束时间",
@@ -1350,6 +1363,8 @@ const zhCN = {
missingPromptRule: "请先选择 Prompt",
invalidGenerateCount: "生成篇数至少为 1",
invalidScheduleTime: "请选择有效的定时时间",
missingPublishAccounts: "开启自动发布后,请至少选择一个媒体账号",
missingScheduleCover: "已选媒体账号的平台要求封面图,请先设置封面",
missingPromptName: "请先填写 Prompt 名称",
missingPromptContent: "请先填写 Prompt 内容",
},