feat(post-output): add save-only and load-history endpoints

This commit is contained in:
augushong
2026-05-03 21:08:58 +08:00
parent f08957ad7e
commit a65025add9
2 changed files with 72 additions and 0 deletions

View File

@@ -212,4 +212,23 @@ class PhoneImage implements PostOutputManagerInterface
'page_count' => $pageCount,
]) > 0;
}
/**
* 仅保存配置(不生成图片),创建新的历史记录
* @param int $postId 文章ID
* @param array $config 配置(含 size/fontSize/watermark/pageAlignments/content_html)
* @param int $adminId 管理员ID
* @return PostOutput
*/
public static function saveConfigOnly(int $postId, array $config, int $adminId): PostOutput
{
return PostOutput::create([
'post_id' => $postId,
'output_type' => 'phone_image',
'config' => $config,
'status' => PostOutput::STATUS_PROCESSING,
'page_count' => 0,
'admin_id' => $adminId,
]);
}
}