Captures the current working tree after theme slots, ArticleAccess, and the payment / paid-content plugins so subsequent work has a reviewable git history.
45 lines
1.2 KiB
PHP
45 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Domain\Ai\Jobs;
|
|
|
|
use App\Models\Article;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
use Illuminate\Queue\SerializesModels;
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
/**
|
|
* Phase-2 stub: auto-pick or generate a cover image for an article.
|
|
* Dispatch later from import scripts / artisan batch; process via Workerman/queue.
|
|
*/
|
|
class GenerateArticleCoverJob implements ShouldQueue
|
|
{
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
public function __construct(
|
|
public int $articleId,
|
|
public string $strategy = 'auto', // auto|from_content|generate
|
|
) {
|
|
$this->onQueue('ai-content');
|
|
}
|
|
|
|
public function handle(): void
|
|
{
|
|
$article = Article::query()->find($this->articleId);
|
|
if ($article === null) {
|
|
return;
|
|
}
|
|
|
|
// Intentionally unimplemented in phase 1.
|
|
Log::info('GenerateArticleCoverJob stub skipped', [
|
|
'article_id' => $article->id,
|
|
'strategy' => $this->strategy,
|
|
'cover_status' => $article->cover_status,
|
|
]);
|
|
}
|
|
}
|