feat(schedule): support random cover source for scheduled and manual publish

Add a cover mode to schedule tasks so auto-publish can pick a random cover
image instead of a fixed one, scoped to all images or a specific folder.

- migration: add cover_mode / cover_random_scope / cover_random_folder_id
  columns and check constraints on schedule_tasks
- backend: validate cover mode/scope/folder on create & update; the dispatch
  worker resolves a random active image (signed asset URL) at enqueue time
- frontend: new CoverSourceSelector component wired into GenerateTaskDrawer
  and PublishArticleModal, plus coverSource i18n strings

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-14 21:02:39 +08:00
parent f27c910c93
commit c6b7090536
11 changed files with 1032 additions and 178 deletions
@@ -69,6 +69,15 @@ const zhCN = {
},
},
},
coverSource: {
specific: '指定图片',
random: '随机图片',
randomAll: '全部图片',
randomFolder: '指定文件夹',
folderPlaceholder: '选择图片文件夹',
randomHint: '发布时会从所选范围随机抽取一张封面图。',
randomEmpty: '请先选择随机图片文件夹',
},
nav: {
workspace: '工作台',
articleCreation: '文章创作',