feat(phase2): 사주 공개 전환 + analyze 로그인·일일제한(서버 강제)

- app/work/saju/layout.tsx: isServiceVisible 가드 제거, 사주 서비스 공개 전환
- lib/service-visibility.ts: HideableService에서 saju 제거
- app/api/admin/services/route.ts: DEFAULT_SERVICES에서 saju 행 제거
- app/api/saju/analyze/route.ts: saju_detail 결제 게이트(403) 제거,
  로그인(401) + 서버측 일일 1회 제한(429, ai_usage_log 기반)으로 교체.
  recordUsage는 실제 Gemini 해석 성공 반환 직전에만 호출(MOCK 폴백 제외)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-02 21:28:24 +09:00
parent a9f5d8cee6
commit 5fd7ab8872
4 changed files with 14 additions and 21 deletions

View File

@@ -1,6 +1,4 @@
import { notFound } from 'next/navigation';
import type { Metadata } from 'next';
import { isServiceVisible } from '@/lib/service-visibility';
export const metadata: Metadata = {
title: 'AI 사주 분석',
@@ -24,7 +22,6 @@ export const metadata: Metadata = {
},
};
export default async function SajuLayout({ children }: { children: React.ReactNode }) {
if (!(await isServiceVisible('saju'))) notFound();
export default function SajuLayout({ children }: { children: React.ReactNode }) {
return <>{children}</>;
}