feat(seo): 사이트맵 재생성 진행상황 + 실시간/폴링 UI
관리자 "전체 재생성"을 큐(Full 모드)로 던지고 진행상황을 SEO 탭에서 확인한다. Reverb ON 이면 방송 채널 구독으로 실시간 갱신, OFF 면 상태 API 폴링으로 폴백한다. - SitemapProgress 진행상황 스토어(queued→running→writing→completed/failed, 캐시 TTL 3600, 방송 스로틀) + SitemapManager.getStatus 확장(progress + realtime_enabled) - GET /api/admin/seo/sitemap/status(core.settings.read) 신규 - 관리자 재생성을 항상 Full 모드로 큐잉 + 진행률 기록, Job 최종 실패 시 progress=failed 고정 - core.admin.seo.sitemap 방송 채널 인증(core.settings.read) - SEO 탭 진행상황 UI(상태 배지/단계/누적 URL/실시간·폴링 안내) + 폴링 분기 - 재생성 중 누적 URL 표기(replaceAllForContributor 삽입 건수 반환 — count 쿼리 없이 스트림 누적) - ja 언어팩 진행상황 UI 번역 동기화
This commit is contained in:
1 parent
1629684156
commit
face022073
29 files changed
+1145
-83
No files matched your search
@@ -2,12 +2,14 @@
|
||||
|
||||
namespace App\Http\Controllers\Api\Admin;
|
||||
|
||||
use App\Enums\SitemapGenerationMode;
|
||||
use App\Http\Controllers\Api\Base\AdminBaseController;
|
||||
use App\Http\Requests\Admin\SeoCacheClearRequest;
|
||||
use App\Jobs\GenerateSitemapJob;
|
||||
use App\Seo\Contracts\SeoCacheManagerInterface;
|
||||
use App\Seo\SeoCacheStatsService;
|
||||
use App\Seo\SitemapManager;
|
||||
use App\Seo\SitemapProgress;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
@@ -21,7 +23,8 @@ class SeoCacheController extends AdminBaseController
|
||||
public function __construct(
|
||||
private SeoCacheStatsService $statsService,
|
||||
private SeoCacheManagerInterface $cacheManager,
|
||||
private SitemapManager $sitemapManager
|
||||
private SitemapManager $sitemapManager,
|
||||
private SitemapProgress $sitemapProgress
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
@@ -111,12 +114,25 @@ class SeoCacheController extends AdminBaseController
|
||||
return $this->error('seo.sitemap_disabled', 400);
|
||||
}
|
||||
|
||||
GenerateSitemapJob::dispatch();
|
||||
// 관리자 수동 재생성은 항상 전체(Full) — 현 생성 상태와 무관하게 전량 재생성 (D7)
|
||||
GenerateSitemapJob::dispatch(SitemapGenerationMode::Full);
|
||||
|
||||
return $this->success('seo.sitemap_regenerate_dispatched', [
|
||||
'status' => 'dispatched',
|
||||
...$this->sitemapManager->getStatus(),
|
||||
]);
|
||||
// 큐 대기 중에도 UI 가 'queued' 를 표시하도록 즉시 기록
|
||||
$this->sitemapProgress->start(SitemapGenerationMode::Full->value);
|
||||
|
||||
return $this->success('seo.sitemap_regenerate_dispatched', $this->sitemapManager->getStatus());
|
||||
}
|
||||
|
||||
/**
|
||||
* Sitemap 재생성 진행상황과 실시간 연결 가능 여부를 조회합니다.
|
||||
*
|
||||
* SEO 탭 진입 시 초기 로드용이며, 폴링(Reverb OFF)일 때 주기적으로 재조회됩니다.
|
||||
*
|
||||
* @return JsonResponse 진행상황(progress) + last_updated_at + realtime_enabled 를 포함한 JSON 응답
|
||||
*/
|
||||
public function sitemapStatus(): JsonResponse
|
||||
{
|
||||
return $this->success('messages.success', $this->sitemapManager->getStatus());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user