feat:트렌드 키워드를 건강 채널용으로 필터링

건강 채널 전용 트렌딩 시스템:
- Gemini로 실시간 트렌드에서 건강 관련 키워드만 필터링
- 간접적 키워드도 건강 앵글로 리프레이밍 (예: 김치 → 장건강)
- 필터 결과 30분 캐싱 (Gemini 호출 최소화)
- 필터 실패 시 원본 키워드 폴백

제목 생성 건강 앵글 반영:
- generateTrendingHookTitles 프롬프트에 건강 채널 명시
- trending_context에 health_angle, suggested_topic 추가
- 모든 제목이 건강/웰빙 관점으로 생성되도록 가이드

UI 건강 테마 적용:
- 버튼/칩 색상: orange/indigo → green 테마
- 칩에 건강 앵글 태그 배지 표시
- 칩 클릭 시 건강 주제(suggested_topic)가 인풋에 채워짐

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
김보곤
2026-02-15 13:08:57 +09:00
parent e093c7b7e7
commit ed1967405c
3 changed files with 105 additions and 15 deletions

View File

@@ -12,6 +12,7 @@
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Cache;
use Illuminate\View\View;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
@@ -36,11 +37,18 @@ public function index(Request $request): View|Response
}
/**
* 실시간 급상승 키워드 목록
* 실시간 급상승 키워드 목록 (건강 채널용 필터링)
*/
public function fetchTrending(): JsonResponse
{
$keywords = $this->trendingService->fetchTrendingKeywords(10);
$keywords = Cache::remember('health_trending', 1800, function () {
$rawKeywords = $this->trendingService->fetchTrendingKeywords(20);
$healthKeywords = $this->geminiService->filterHealthTrending($rawKeywords);
// Gemini 필터링 실패 시 원본 반환
return ! empty($healthKeywords) ? $healthKeywords : $rawKeywords;
});
return response()->json([
'success' => true,