From 4cf208e2d87c01a2373bbe9535546e6ed35b81e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Thu, 5 Mar 2026 14:51:09 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20[rd]=20CM=EC=86=A1=20=E2=86=92=20?= =?UTF-8?q?=EB=82=98=EB=A0=88=EC=9D=B4=EC=85=98=20=EB=AA=85=EC=B9=AD=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20+=20=EA=B2=B0=EA=B3=BC=20=EC=9E=90?= =?UTF-8?q?=EB=8F=99=20=EC=8A=A4=ED=81=AC=EB=A1=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 모든 UI 텍스트 CM송 → 나레이션으로 변경 - 버튼: 나레이션 제작 - 제작 시 결과 패널로 자동 스크롤 - 프롬프트, 다운로드 파일명, 저장 메시지 모두 변경 --- app/Http/Controllers/Rd/CmSongController.php | 20 ++++----- resources/views/rd/cm-song/create.blade.php | 44 +++++++++++--------- resources/views/rd/cm-song/index.blade.php | 12 +++--- resources/views/rd/cm-song/show.blade.php | 6 +-- resources/views/rd/index.blade.php | 6 +-- 5 files changed, 46 insertions(+), 42 deletions(-) diff --git a/app/Http/Controllers/Rd/CmSongController.php b/app/Http/Controllers/Rd/CmSongController.php index 99045b43..1a76f726 100644 --- a/app/Http/Controllers/Rd/CmSongController.php +++ b/app/Http/Controllers/Rd/CmSongController.php @@ -24,7 +24,7 @@ public function __construct() } /** - * CM송 목록 + * 나레이션 목록 */ public function index(Request $request): View|\Illuminate\Http\Response { @@ -40,7 +40,7 @@ public function index(Request $request): View|\Illuminate\Http\Response } /** - * CM송 제작 페이지 + * 나레이션 제작 페이지 */ public function create(Request $request): View|\Illuminate\Http\Response { @@ -52,7 +52,7 @@ public function create(Request $request): View|\Illuminate\Http\Response } /** - * CM송 상세 + * 나레이션 상세 */ public function show(Request $request, int $id): View|\Illuminate\Http\Response { @@ -66,7 +66,7 @@ public function show(Request $request, int $id): View|\Illuminate\Http\Response } /** - * CM송 가사 생성 (Gemini API) + * 나레이션 가사 생성 (Gemini API) */ public function generateLyrics(Request $request): JsonResponse { @@ -85,7 +85,7 @@ public function generateLyrics(Request $request): JsonResponse default => '14~16줄', }; - $prompt = "당신은 전문 CM송 작사가입니다. 다음 정보를 바탕으로 기억에 남는 {$duration}초 분량의 라디오 CM송 가사를 작성해주세요. + $prompt = "당신은 전문 나레이션 작사가입니다. 다음 정보를 바탕으로 기억에 남는 {$duration}초 분량의 라디오 나레이션 가사를 작성해주세요. 회사명: {$request->company_name} 업종/제품: {$request->industry} @@ -188,7 +188,7 @@ public function generateAudio(Request $request): JsonResponse } /** - * CM송 저장 + * 나레이션 저장 */ public function store(Request $request): JsonResponse { @@ -242,7 +242,7 @@ public function store(Request $request): JsonResponse return response()->json([ 'success' => true, 'id' => $song->id, - 'message' => 'CM송이 저장되었습니다.', + 'message' => '나레이션이 저장되었습니다.', ]); } @@ -257,13 +257,13 @@ public function download(int $id) abort(404, '음성 파일이 없습니다.'); } - $filename = "CM송_{$song->company_name}_".date('Ymd', strtotime($song->created_at)).'.wav'; + $filename = "나레이션_{$song->company_name}_".date('Ymd', strtotime($song->created_at)).'.wav'; return Storage::disk('tenant')->download($song->audio_path, $filename); } /** - * CM송 삭제 + * 나레이션 삭제 */ public function destroy(int $id): JsonResponse { @@ -277,7 +277,7 @@ public function destroy(int $id): JsonResponse return response()->json([ 'success' => true, - 'message' => 'CM송이 삭제되었습니다.', + 'message' => '나레이션이 삭제되었습니다.', ]); } diff --git a/resources/views/rd/cm-song/create.blade.php b/resources/views/rd/cm-song/create.blade.php index 05a8c3d7..a2bccb03 100644 --- a/resources/views/rd/cm-song/create.blade.php +++ b/resources/views/rd/cm-song/create.blade.php @@ -1,16 +1,16 @@ @extends('layouts.app') -@section('title', 'AI CM송 제작') +@section('title', 'AI 나레이션 제작') @section('content')

- AI CM송 제작 + AI 나레이션 제작

- CM송 목록 + 나레이션 목록
@@ -20,7 +20,7 @@

- CM송 정보 입력 + 나레이션 정보 입력

@@ -76,11 +76,11 @@ class="w-full px-4 py-3 rounded-lg border border-gray-200 focus:ring-2 focus:rin
- +
- CM송 만들기 + 나레이션 제작
-
+

- 생성된 CM송 + 생성된 나레이션

-

정보를 입력하고 버튼을 누르면
이곳에 CM송이 나타납니다.

+

정보를 입력하고 버튼을 누르면
이곳에 나레이션이 나타납니다.

@@ -199,6 +199,7 @@ class="flex items-center gap-1.5 px-5 py-2 bg-white hover:bg-gray-50 text-gray-6 const moodSelector = document.getElementById('moodSelector'); const durationSlider = document.getElementById('durationSlider'); const durationDisplay = document.getElementById('durationDisplay'); + const resultPanel = document.getElementById('resultPanel'); const emptyState = document.getElementById('emptyState'); const loadingState = document.getElementById('loadingState'); const loadingText = document.getElementById('loadingText'); @@ -290,7 +291,7 @@ function showState(state) { if (state === 'result') resultState.classList.remove('hidden'); } - // CM송 생성 + // 나레이션 생성 async function generate() { const companyName = companyInput.value.trim(); const industry = industryInput.value.trim(); @@ -302,14 +303,17 @@ function showState(state) { } generateBtn.disabled = true; - generateBtn.innerHTML = ' CM송 제작 중...'; + generateBtn.innerHTML = ' 나레이션 제작 중...'; showState('loading'); - loadingText.textContent = 'AI가 멋진 가사를 쓰고 있어요...'; + loadingText.textContent = 'AI가 나레이션을 작성하고 있어요...'; audioSection.classList.add('hidden'); currentAudioData = null; currentAudioMimeType = null; currentAudioBlob = null; + // 결과 패널로 스크롤 + resultPanel.scrollIntoView({ behavior: 'smooth', block: 'start' }); + try { // 1. 가사 생성 const lyricsRes = await fetch('{{ route("rd.cm-song.generate-lyrics") }}', { @@ -328,7 +332,7 @@ function showState(state) { const lyricsData = await lyricsRes.json(); if (!lyricsData.success) { - throw new Error(lyricsData.error || '가사 생성 실패'); + throw new Error(lyricsData.error || '나레이션 생성 실패'); } currentLyrics = lyricsData.lyrics; @@ -371,23 +375,23 @@ function showState(state) { } } catch (error) { - console.error('CM송 생성 오류:', error); + console.error('나레이션 생성 오류:', error); alert('생성 중 오류가 발생했습니다: ' + error.message); showState('empty'); } finally { generateBtn.disabled = false; - generateBtn.innerHTML = ' CM송 만들기'; + generateBtn.innerHTML = ' 나레이션 제작'; } } // 다운로드 downloadBtn.addEventListener('click', function () { if (!currentAudioBlob) return; - const companyName = companyInput.value.trim() || 'CM송'; + const companyName = companyInput.value.trim() || '나레이션'; const url = URL.createObjectURL(currentAudioBlob); const a = document.createElement('a'); a.href = url; - a.download = 'CM송_' + companyName + '_' + new Date().toISOString().slice(0,10) + '.wav'; + a.download = '나레이션_' + companyName + '_' + new Date().toISOString().slice(0,10) + '.wav'; document.body.appendChild(a); a.click(); document.body.removeChild(a); @@ -421,7 +425,7 @@ function showState(state) { const data = await res.json(); if (data.success) { - alert('CM송이 저장되었습니다.'); + alert('나레이션이 저장되었습니다.'); window.location.href = '{{ route("rd.cm-song.index") }}'; } else { throw new Error(data.error || '저장 실패'); diff --git a/resources/views/rd/cm-song/index.blade.php b/resources/views/rd/cm-song/index.blade.php index 94945b3e..bfc80e15 100644 --- a/resources/views/rd/cm-song/index.blade.php +++ b/resources/views/rd/cm-song/index.blade.php @@ -1,20 +1,20 @@ @extends('layouts.app') -@section('title', 'CM송 관리') +@section('title', '나레이션 관리') @section('content')

- CM송 관리 + 나레이션 관리

@@ -91,9 +91,9 @@ class="p-1.5 text-gray-400 hover:text-red-600 transition" @else
-

아직 생성된 CM송이 없습니다.

+

아직 생성된 나레이션이 없습니다.

- 첫 번째 CM송을 만들어보세요 → + 첫 번째 나레이션을 만들어보세요 →
@endif @@ -103,7 +103,7 @@ class="p-1.5 text-gray-400 hover:text-red-600 transition" @push('scripts')