Compare commits

..
16 changed files with 315 additions and 225 deletions

No files matched your search

+70
View File
@@ -2457,6 +2457,27 @@
letter-spacing: -0.006em;
white-space: pre-line;
flex: 1;
margin: 0;
}
.comp2-lyrics-paragraphs {
display: flex;
flex-direction: column;
gap: 1rem;
flex: 1;
}
.comp2-lyrics-para-section {
display: flex;
flex-direction: column;
gap: 0.3rem;
}
.comp2-lyrics-tag {
font-size: 12px;
font-weight: 700;
color: #379599;
letter-spacing: 0.05em;
}
/* 소셜 연결 섹션 */
@@ -8046,6 +8067,51 @@
background: #379599;
}
.lyrics-paragraphs {
width: 100%;
overflow-y: auto;
padding: 1rem;
display: flex;
flex-direction: column;
gap: 1.25rem;
scrollbar-color: #046266 transparent;
}
.lyrics-paragraphs::-webkit-scrollbar {
width: 6px;
}
.lyrics-paragraphs::-webkit-scrollbar-track {
background: transparent;
}
.lyrics-paragraphs::-webkit-scrollbar-thumb {
background: #046266;
border-radius: 3px;
}
.lyrics-section {
display: flex;
flex-direction: column;
gap: 0.4rem;
}
.lyrics-tag {
font-size: var(--text-xs);
font-weight: 700;
color: #379599;
letter-spacing: 0.05em;
}
.lyrics-paragraph {
font-size: var(--text-sm);
font-weight: 400;
color: #CEE5E6;
line-height: 1.9;
white-space: pre-line;
margin: 0;
}
.lyrics-placeholder {
width: 100%;
display: flex;
@@ -10572,6 +10638,10 @@
transform: rotate(180deg);
}
.social-posting-channel-placeholder {
color: rgba(255, 255, 255, 0.35);
}
.social-posting-channel-menu {
position: absolute;
top: 100%;
+8
View File
@@ -5,6 +5,14 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>ADO2</title>
<!-- ① 페이지 설명 -->
<meta name="description" content="ADO2는 ㈜에이아이오투오의 AI 기반 마케팅 자동화 플랫폼입니다. 콘텐츠 제작부터 채널 배포까지 자동으로 처리합니다." />
<!-- ② Open Graph 제목 -->
<meta property="og:title" content="ADO2 - AI 마케팅 자동화 플랫폼" />
<!-- ③ Open Graph 설명 -->
<meta property="og:description" content="ADO2는 ㈜에이아이오투오의 AI 기반 마케팅 자동화 플랫폼입니다. 콘텐츠 제작부터 채널 배포까지 자동으로 처리합니다." />
<meta property="og:url" content="https://demo.castad.net/" />
<meta property="og:type" content="website" />
<link rel="icon" type="image/svg+xml" href="/favicon_32.svg" sizes="32x32">
<link rel="icon" type="image/svg+xml" href="/favicon_48.svg" sizes="48x48">
<script src="https://cdn.tailwindcss.com"></script>
-71
View File
@@ -1,71 +0,0 @@
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>개인정보처리방침 - ADO2</title>
<style>
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; line-height: 1.8; color: #333; max-width: 800px; margin: 0 auto; padding: 40px 20px; }
h1 { font-size: 28px; border-bottom: 2px solid #eee; padding-bottom: 12px; margin-bottom: 30px; }
h2 { font-size: 19px; margin-top: 40px; color: #111; }
p, li { font-size: 15px; color: #555; margin-bottom: 10px; }
ul { padding-left: 20px; }
.google-policy { background: #f0f7ff; border-left: 4px solid #4285f4; padding: 16px 20px; margin: 24px 0; border-radius: 4px; }
.google-policy p { color: #1a1a2e; margin: 0; }
.updated { color: #888; font-size: 14px; margin-bottom: 30px; }
</style>
</head>
<body>
<h1>개인정보처리방침 (Privacy Policy)</h1>
<p class="updated"><strong>시행일:</strong> 2026년 5월 7일 &nbsp;|&nbsp; <strong>최종 수정일:</strong> 2026년 5월 7일</p>
<p>㈜에이아이오투오(이하 "회사")는 AI 마케팅 자동화 서비스 ADO2(이하 "서비스")를 제공함에 있어 사용자의 개인정보를 중요시하며, 「개인정보 보호법」 등 관련 법령을 성실히 준수합니다.</p>
<h2>1. 수집하는 개인정보 항목 및 수집 방법</h2>
<p>회사는 서비스 제공을 위해 아래와 같은 개인정보를 수집합니다.</p>
<ul>
<li><strong>Google OAuth를 통한 수집:</strong> 이름, 이메일 주소, 프로필 사진</li>
<li><strong>마케팅 자동화 서비스 제공용 (해당 권한 동의 시):</strong> YouTube 채널 데이터, Google 광고 계정 데이터 등 연동된 마케팅 채널 데이터</li>
<li><strong>서비스 이용 과정에서 자동 수집:</strong> 접속 IP, 쿠키, 서비스 이용 기록</li>
</ul>
<h2>2. 개인정보의 수집 및 이용 목적</h2>
<ul>
<li>AI 마케팅 콘텐츠 자동 생성 및 배포 서비스 제공</li>
<li>계정 연동 및 사용자 식별·본인 인증</li>
<li>서비스 품질 개선 및 통계 분석</li>
<li>공지사항 전달 및 고객 상담</li>
</ul>
<div class="google-policy">
<p><strong>[Google API 서비스 사용자 데이터 정책 준수]</strong><br><br>
㈜에이아이오투오가 운영하는 ADO2 서비스가 Google API로부터 수신한 정보의 사용 및 타 앱으로의 전송은,
<a href="https://developers.google.com/terms/api-services-user-data-policy" target="_blank">Google API 서비스 사용자 데이터 정책</a>의
제한적 사용(Limited Use) 요건을 포함한 모든 정책을 엄격히 준수합니다.</p>
</div>
<h2>3. 개인정보의 보유 및 이용 기간</h2>
<p>원칙적으로 회원 탈퇴 또는 개인정보 수집·이용 목적이 달성된 후에는 해당 정보를 지체 없이 파기합니다. 단, 관련 법령에 따라 보존이 필요한 경우 해당 기간 동안 보관합니다.</p>
<ul>
<li>전자상거래 관련 기록: 5년 (전자상거래 등에서의 소비자보호에 관한 법률)</li>
<li>접속 로그 기록: 3개월 (통신비밀보호법)</li>
</ul>
<h2>4. 개인정보의 제3자 제공</h2>
<p>회사는 사용자의 사전 동의 없이 개인정보를 외부에 제공하지 않습니다. 다만, 법령에 의거한 수사기관 등의 적법한 요청이 있는 경우는 예외로 합니다.</p>
<h2>5. 정보주체의 권리 및 행사 방법</h2>
<p>사용자는 언제든지 자신의 개인정보에 대한 열람, 수정, 삭제, 처리 정지를 요청할 수 있습니다. 서비스 내 계정 설정에서 직접 처리하거나 아래 문의처로 연락해 주시기 바랍니다.</p>
<h2>6. 개인정보 보호책임자 및 문의처</h2>
<p>개인정보 보호와 관련된 불만 처리 및 피해 구제에 관한 사항은 아래로 문의해 주시기 바랍니다.</p>
<ul>
<li><strong>회사명:</strong> ㈜에이아이오투오</li>
<li><strong>서비스명:</strong> ADO2</li>
<li><strong>이메일:</strong> o2oteam@o2o.kr</li>
<li><strong>웹사이트:</strong> https://demo.castad.net</li>
</ul>
<p style="margin-top:40px; font-size:14px; color:#999;">본 방침은 2026년 5월 7일부터 시행됩니다.</p>
</body>
</html>
-65
View File
@@ -1,65 +0,0 @@
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>서비스 약관 - ADO2</title>
<style>
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; line-height: 1.8; color: #333; max-width: 800px; margin: 0 auto; padding: 40px 20px; }
h1 { font-size: 28px; border-bottom: 2px solid #eee; padding-bottom: 12px; margin-bottom: 30px; }
h2 { font-size: 19px; margin-top: 40px; color: #111; }
p, li { font-size: 15px; color: #555; margin-bottom: 10px; }
ul { padding-left: 20px; }
.updated { color: #888; font-size: 14px; margin-bottom: 30px; }
</style>
</head>
<body>
<h1>서비스 이용약관 (Terms of Service)</h1>
<p class="updated"><strong>시행일:</strong> 2026년 5월 7일 &nbsp;|&nbsp; <strong>최종 수정일:</strong> 2026년 5월 7일</p>
<h2>제 1 조 (목적)</h2>
<p>본 약관은 ㈜에이아이오투오(이하 "회사")가 제공하는 AI 마케팅 자동화 서비스 ADO2(이하 "서비스")의 이용과 관련하여, 회사와 이용자(이하 "회원") 간의 권리, 의무 및 책임사항을 규정함을 목적으로 합니다.</p>
<h2>제 2 조 (용어의 정의)</h2>
<ul>
<li>"서비스"라 함은 회사가 제공하는 ADO2 AI 마케팅 자동화 플랫폼 및 관련 제반 기능을 의미합니다.</li>
<li>"회원"이라 함은 본 약관에 동의하고 회사와 이용계약을 체결하여 서비스를 이용하는 자를 말합니다.</li>
<li>"콘텐츠"라 함은 서비스 내에서 AI가 생성하거나 회원이 등록하는 텍스트, 이미지, 음악, 영상 등 일체의 자료를 말합니다.</li>
</ul>
<h2>제 3 조 (약관의 효력 및 변경)</h2>
<p>회사는 본 약관의 내용을 서비스 화면에 게시하며, 관련 법령을 위배하지 않는 범위에서 약관을 개정할 수 있습니다. 약관이 변경되는 경우 시행일 7일 전부터 공지합니다.</p>
<h2>제 4 조 (서비스의 제공 및 변경)</h2>
<p>회사는 AI 기반 마케팅 콘텐츠(가사, 이미지, 영상 등) 자동 생성, Google·YouTube 등 외부 플랫폼 연동, SNS 자동 배포 등의 서비스를 제공합니다. 운영상·기술상의 필요에 따라 서비스의 전부 또는 일부를 변경할 수 있습니다.</p>
<h2>제 5 조 (회원의 의무)</h2>
<ul>
<li>타인의 Google 계정 등 외부 서비스 계정을 무단으로 도용하여 서비스를 이용해서는 안 됩니다.</li>
<li>스팸 발송, API 한도 고의 초과, 허위 정보 등록 등 비정상적인 방법으로 서비스를 이용해서는 안 됩니다.</li>
<li>회사 또는 제3자의 지식재산권을 침해해서는 안 됩니다.</li>
</ul>
<h2>제 6 조 (외부 API 연동 및 데이터 활용)</h2>
<p>서비스는 Google, YouTube, Naver 등의 제3자 API를 활용하여 마케팅 자동화 기능을 제공합니다. 회원은 각 외부 서비스의 이용약관 및 정책을 준수할 의무가 있으며, 외부 API 제공사의 정책 변경으로 인한 서비스 제한에 대해 회사는 면책됩니다.</p>
<h2>제 7 조 (AI 생성 콘텐츠의 권리)</h2>
<p>서비스 내에서 AI가 생성한 콘텐츠에 대한 권리 관계는 관련 법령 및 회사의 별도 정책에 따릅니다. 회원이 직접 입력한 정보(매장 URL, 상호명 등)를 기반으로 생성된 콘텐츠에 대한 책임은 회원에게 있습니다.</p>
<h2>제 8 조 (책임 제한)</h2>
<p>회사는 천재지변, 외부 플랫폼(Google, YouTube, Naver 등)의 장애, 통신 장애 등 불가항력으로 서비스를 제공할 수 없는 경우 책임이 면제됩니다.</p>
<h2>제 9 조 (준거법 및 재판관할)</h2>
<p>본 약관과 관련된 분쟁은 대한민국 법을 준거법으로 하며, 소송은 회사의 소재지를 관할하는 법원에 제소합니다.</p>
<h2>문의처</h2>
<ul>
<li><strong>회사명:</strong> ㈜에이아이오투오</li>
<li><strong>서비스명:</strong> ADO2</li>
<li><strong>이메일:</strong> o2oteam@o2o.kr</li>
<li><strong>웹사이트:</strong> https://demo.castad.net</li>
</ul>
<p style="margin-top:40px; font-size:14px; color:#999;">본 약관은 2026년 5월 7일부터 시행됩니다.</p>
</body>
</html>
+2 -5
View File
@@ -275,8 +275,7 @@ const App: React.FC = () => {
setIsAnalysisComplete(true);
} catch (err) {
console.error('Crawling failed:', err);
const errorMessage = err instanceof Error ? err.message : t('app.analysisError');
setError(errorMessage);
setError(t('app.analysisError'));
setViewMode('landing');
}
};
@@ -301,9 +300,7 @@ const App: React.FC = () => {
setIsAnalysisComplete(true);
} catch (err) {
console.error('Autocomplete failed:', err);
const is404 = err instanceof Error && err.message.includes('status: 404');
const errorMessage = is404 ? t('app.autocompleteError') : (err instanceof Error ? err.message : t('app.autocompleteGeneralError'));
setError(errorMessage);
setError(t('app.autocompleteError'));
setViewMode('landing');
}
};
+32 -4
View File
@@ -142,6 +142,10 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
const channelDropdownRef = useRef<HTMLDivElement>(null);
const privacyDropdownRef = useRef<HTMLDivElement>(null);
const hasBeenOpenedRef = useRef(false);
const loadedForTaskIdRef = useRef<string | null>(null);
const loadedAtRef = useRef<number>(0);
const seoCache = useRef<Map<string, { title: string; description: string; tags: string }>>(new Map());
const SEO_CACHE_TTL = 50 * 60 * 1000;
// Upload progress modal state
const [showUploadProgress, setShowUploadProgress] = useState(false);
@@ -207,11 +211,28 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
// 소셜 계정 로드
useEffect(() => {
if (isOpen) {
loadSocialAccounts();
if (!isOpen) return;
const now = Date.now();
loadSocialAccounts();
const taskId = video?.task_id ?? null;
const expired = now - loadedAtRef.current > SEO_CACHE_TTL;
if (taskId && (taskId !== loadedForTaskIdRef.current || expired)) {
loadedForTaskIdRef.current = taskId;
loadedAtRef.current = now;
loadAutocomplete();
} else if (taskId) {
const cached = seoCache.current.get(taskId);
if (cached) {
setTitle(cached.title);
setDescription(cached.description);
setTags(cached.tags);
}
}
}, [isOpen, video]);
}, [isOpen, video?.task_id]);
const loadSocialAccounts = async () => {
setIsLoadingAccounts(true);
@@ -252,6 +273,11 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
if (autoSeoResponse.title) setTitle(autoSeoResponse.title);
if (autoSeoResponse.description) setDescription(autoSeoResponse.description);
if (autoSeoResponse.keywords) setTags(autoSeoResponse.keywords.join(','));
seoCache.current.set(video.task_id, {
title: autoSeoResponse.title || '',
description: autoSeoResponse.description || '',
tags: autoSeoResponse.keywords?.join(',') || '',
});
} catch (error) {
console.error('Failed to load autocomplete:', error);
// 실패해도 사용자에게 별도 알림 없이 조용히 처리
@@ -530,7 +556,7 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
onClick={() => setIsChannelDropdownOpen(!isChannelDropdownOpen)}
>
<div className="social-posting-channel-selected">
{selectedAccount && (
{selectedAccount ? (
<>
<img
src={getPlatformIcon(selectedAccount.platform)}
@@ -539,6 +565,8 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
/>
<span>{selectedAccount.display_name}</span>
</>
) : (
<span className="social-posting-channel-placeholder">{t('social.selectChannel')}</span>
)}
</div>
<svg className="social-posting-channel-arrow" viewBox="0 0 12 8" fill="none">
+5 -3
View File
@@ -208,7 +208,7 @@
"imageAlt": "Image",
"uploadBadge": "Uploaded",
"imageUpload": "Image Upload",
"dragAndDrop": "Drag and drop\nimages to upload",
"dragAndDrop": "Drag & drop or\nclick to upload",
"videoRatio": "Video Ratio",
"minImages": "Min. 5 images",
"youtubeShorts": "YouTube Shorts",
@@ -234,6 +234,7 @@
"lyricsColumn": "Lyrics",
"lyricsHint": "Select the lyrics area to edit",
"lyricsPlaceholder": "Lyrics will be displayed when sound is generated.",
"lyricsPlaceholderBGM": "Background music is generated without lyrics.",
"generateButton": "Generate Sound",
"regenerateButton": "Regenerate",
"regenerateHint": "Press the regenerate button to create new lyrics and music.",
@@ -306,6 +307,7 @@
"resolution": "Resolution",
"lyrics": "Lyrics",
"sampleLyrics": "Loading lyrics...",
"noLyricsBGM": "Background music is generated without lyrics.",
"downloading": "Downloading...",
"download": "Download",
"uploadToSocial": "Upload to Social"
@@ -548,8 +550,8 @@
"kakaoLoginFailed": "Kakao login failed. Please try again.",
"loginUrlFailed": "Failed to get login URL. Please try again.",
"invalidUrl": "Invalid URL. Please enter a Naver Map URL.",
"analysisError": "An error occurred during analysis. Please try again.",
"autocompleteError": "Failed to retrieve business information. Please enter the URL directly.",
"analysisError": "No results found. Please check your input and try again.",
"autocompleteError": "No results found. Please check your input and try again.",
"autocompleteGeneralError": "An error occurred while retrieving business information. Please try again.",
"pageComingSoon": "{{page}} page is coming soon."
}
+5 -3
View File
@@ -208,7 +208,7 @@
"imageAlt": "이미지",
"uploadBadge": "업로드",
"imageUpload": "이미지 업로드",
"dragAndDrop": "이미지를 드래그하여\n업로드",
"dragAndDrop": "이미지를 끌어다 놓거나\n클릭하여 업로드",
"videoRatio": "영상 비율",
"minImages": "최소 5장",
"youtubeShorts": "유튜브 쇼츠",
@@ -234,6 +234,7 @@
"lyricsColumn": "가사",
"lyricsHint": "가사 영역을 선택해서 수정 가능해요",
"lyricsPlaceholder": "사운드 생성 시 가사 표시됩니다.",
"lyricsPlaceholderBGM": "배경음악은 가사 없이 생성됩니다.",
"generateButton": "사운드 생성",
"regenerateButton": "재생성 하기",
"regenerateHint": "재생성 버튼을 누르면 가사와 음악을 다시 만들 수 있어요.",
@@ -306,6 +307,7 @@
"resolution": "규격",
"lyrics": "가사",
"sampleLyrics": "가사를 불러오는 중...",
"noLyricsBGM": "배경음악은 가사 없이 생성됩니다.",
"downloading": "다운로드 중...",
"download": "다운로드",
"uploadToSocial": "소셜 채널 업로드"
@@ -548,8 +550,8 @@
"kakaoLoginFailed": "카카오 로그인에 실패했습니다. 다시 시도해주세요.",
"loginUrlFailed": "로그인 URL을 가져오는데 실패했습니다. 다시 시도해주세요.",
"invalidUrl": "유효하지 않은 URL입니다. 네이버 지도 URL을 입력해주세요.",
"analysisError": "분석 중 오류가 발생했습니다. 다시 시도해주세요.",
"autocompleteError": "업체 정보 조회에 실패했습니다. URL을 직접 입력해주세요.",
"analysisError": "검색 정보를 찾을 수 없습니다. 입력 정보를 다시 확인해주세요.",
"autocompleteError": "검색 정보를 찾을 수 없습니다. 입력 정보를 다시 확인해주세요.",
"autocompleteGeneralError": "업체 정보 조회 중 오류가 발생했습니다. 다시 시도해주세요.",
"pageComingSoon": "{{page}} 페이지 준비 중입니다."
}
+79 -9
View File
@@ -1,10 +1,87 @@
import React, { useState, useEffect } from 'react';
import React, { useState, useEffect, useRef, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { getVideosList, deleteVideo } from '../../utils/api';
import { VideoListItem } from '../../types/api';
import SocialPostingModal from '../../components/SocialPostingModal';
const VideoPreviewCard: React.FC<{ src: string; className?: string }> = ({ src, className }) => {
const videoRef = useRef<HTMLVideoElement>(null);
const isPlayingRef = useRef(false);
const pendingPlayRef = useRef(false);
useEffect(() => {
const video = videoRef.current;
if (!video) return;
const observer = new IntersectionObserver(
([entry]) => {
if (entry.isIntersecting) {
video.preload = 'auto';
} else {
video.preload = 'none';
}
},
{ threshold: 0.1 }
);
observer.observe(video);
return () => observer.disconnect();
}, []);
const safePlay = useCallback((video: HTMLVideoElement) => {
const playPromise = video.play();
if (playPromise !== undefined) {
playPromise
.then(() => { isPlayingRef.current = true; })
.catch((error) => {
if (error.name !== 'AbortError') console.error(error);
});
}
}, []);
const handleCanPlay = useCallback(() => {
if (!pendingPlayRef.current || !videoRef.current) return;
pendingPlayRef.current = false;
safePlay(videoRef.current);
}, [safePlay]);
const handleMouseEnter = useCallback(() => {
const video = videoRef.current;
if (!video) return;
if (video.readyState >= 3) {
safePlay(video);
} else {
pendingPlayRef.current = true;
}
}, [safePlay]);
const handleMouseLeave = useCallback(() => {
const video = videoRef.current;
if (!video) return;
pendingPlayRef.current = false;
if (isPlayingRef.current) {
video.pause();
video.currentTime = 0;
isPlayingRef.current = false;
}
}, []);
return (
<video
ref={videoRef}
src={src}
className={className}
muted
playsInline
preload="none"
onCanPlay={handleCanPlay}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
/>
);
};
interface ADO2ContentsPageProps {
onBack: () => void;
onNavigate?: (item: string) => void;
@@ -166,16 +243,9 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = ({ onBack, onNavigate
{/* Video Thumbnail */}
<div className="content-card-thumbnail">
{video.result_movie_url ? (
<video
<VideoPreviewCard
src={video.result_movie_url}
className="content-video-preview"
muted
playsInline
onMouseEnter={(e) => e.currentTarget.play()}
onMouseLeave={(e) => {
e.currentTarget.pause();
e.currentTarget.currentTime = 0;
}}
/>
) : (
<div className="content-no-video">
+25 -3
View File
@@ -483,9 +483,31 @@ const CompletionContent: React.FC<CompletionContentProps> = ({
<div className="comp2-meta-divider"></div>
<div className="comp2-lyrics-section">
<span className="comp2-meta-label">{t('completion.lyrics')}</span>
<p className="comp2-lyrics-text">
{songCompletionData?.lyrics || t('completion.sampleLyrics')}
</p>
{(() => {
if (!songCompletionData) {
return <p className="comp2-lyrics-text">{t('completion.sampleLyrics')}</p>;
}
if (!songCompletionData.lyrics) {
return <p className="comp2-lyrics-text">{t('completion.noLyricsBGM')}</p>;
}
const lines = songCompletionData.lyrics.split('\n').filter((l: string) => l.trim());
const size = Math.ceil(lines.length / 3);
const sections = [
{ tag: '[Verse]', lines: lines.slice(0, size) },
{ tag: '[Chorus]', lines: lines.slice(size, size * 2) },
{ tag: '[Outro]', lines: lines.slice(size * 2) },
].filter(s => s.lines.length > 0);
return (
<div className="comp2-lyrics-paragraphs">
{sections.map((section, i) => (
<div key={i} className="comp2-lyrics-para-section">
<span className="comp2-lyrics-tag">{section.tag}</span>
<p className="comp2-lyrics-text">{section.lines.join('\n')}</p>
</div>
))}
</div>
);
})()}
</div>
</div>
</div>
@@ -553,7 +553,7 @@ const ContentCalendarContent: React.FC<ContentCalendarContentProps> = ({ onNavig
<PlatformIcon platform={item.platform} size={16} />
<span style={{
fontFamily: 'Pretendard, sans-serif', fontWeight: 500, fontSize: 12,
color: '#9bcacc', lineHeight: 1,
color: '#9bcacc', lineHeight: 1.4,
overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis',
}}>
{item.platform_username || item.platform_user_id || item.channel_name}
+2 -4
View File
@@ -248,8 +248,7 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
setIsAnalysisComplete(true);
} catch (err) {
console.error('Autocomplete error:', err);
const msg = err instanceof Error ? err.message : '';
setAnalysisError(/^HTTP error!/.test(msg) ? t('app.autocompleteError') : (msg || t('app.autocompleteError')));
setAnalysisError(t('app.autocompleteError'));
goToWizardStep(-2); // URL 입력으로 돌아가기
}
};
@@ -318,8 +317,7 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
setIsAnalysisComplete(true);
} catch (err) {
console.error('Crawling failed:', err);
const errorMessage = err instanceof Error ? err.message : t('app.analysisError');
setAnalysisError(errorMessage);
setAnalysisError(t('app.analysisError'));
goToWizardStep(-2); // URL 입력으로 돌아가기
}
};
+60 -42
View File
@@ -276,6 +276,7 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
try {
const language = LANGUAGE_MAP[selectedLang] || 'Korean';
const isInstrumental = selectedType === '배경음악';
// 1. 가사 생성 요청
console.log('[SoundStudio] Sending m_id:', mId);
@@ -287,37 +288,13 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
region: businessInfo.region,
task_id: imageTaskId,
orientation,
...(isInstrumental && { instrumental: true }),
});
if (!lyricResponse.success || !lyricResponse.task_id) {
throw new Error(lyricResponse.error_message || t('soundStudio.lyricGenerationFailed'));
}
// 2. 가사 생성 상태 폴링 → 완료 시 상세 조회
setStatusMessage(t('soundStudio.generatingLyrics'));
const lyricDetailResponse = await waitForLyricComplete(
lyricResponse.task_id,
(status: string) => {
if (status === 'processing') {
setStatusMessage(t('soundStudio.generatingLyrics'));
}
}
);
if (!lyricDetailResponse.lyric_result) {
throw new Error(t('soundStudio.lyricNotReceived'));
}
// "I'm sorry" 체크
if (lyricDetailResponse.lyric_result.includes("I'm sorry")) {
throw new Error(t('soundStudio.lyricGenerationError'));
}
setLyrics(lyricDetailResponse.lyric_result);
setStatus('generating_song');
setStatusMessage(t('soundStudio.generatingSong'));
const genreMap: Record<string, string> = {
'자동 선택': 'pop',
'K-POP': 'kpop',
@@ -329,10 +306,39 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
'ROCK': 'rock',
};
let songLyrics: string | undefined;
if (!isInstrumental) {
// 2. 가사 생성 상태 폴링 → 완료 시 상세 조회
setStatusMessage(t('soundStudio.generatingLyrics'));
const lyricDetailResponse = await waitForLyricComplete(
lyricResponse.task_id,
(status: string) => {
if (status === 'processing') {
setStatusMessage(t('soundStudio.generatingLyrics'));
}
}
);
if (!lyricDetailResponse.lyric_result) {
throw new Error(t('soundStudio.lyricNotReceived'));
}
// "I'm sorry" 체크
if (lyricDetailResponse.lyric_result.includes("I'm sorry")) {
throw new Error(t('soundStudio.lyricGenerationError'));
}
setLyrics(lyricDetailResponse.lyric_result);
songLyrics = lyricDetailResponse.lyric_result;
}
setStatus('generating_song');
setStatusMessage(t('soundStudio.generatingSong'));
const songResponse = await generateSong(imageTaskId, {
genre: genreMap[selectedGenre] || 'pop',
language,
lyrics: lyricDetailResponse.lyric_result,
...(isInstrumental ? { instrumental: true, lyrics: '' } : { language, lyrics: songLyrics }),
});
if (!songResponse.success) {
@@ -351,7 +357,7 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
setStatus('polling');
setStatusMessage(t('soundStudio.generatingSong'));
await resumePolling(songResponse.task_id, songResponse.song_id, lyricDetailResponse.lyric_result, 0);
await resumePolling(songResponse.task_id, songResponse.song_id, songLyrics ?? '', 0);
} catch (error) {
console.error('Music generation failed:', error);
@@ -412,7 +418,7 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
<div className="sound-type-grid">
{[
{ key: '보컬', label: t('soundStudio.soundTypeVocal'), disabled: false },
{ key: '배경음악', label: t('soundStudio.soundTypeBGM'), disabled: true },
{ key: '배경음악', label: t('soundStudio.soundTypeBGM'), disabled: false },
].map(({ key, label, disabled }) => (
<button
key={key}
@@ -483,8 +489,8 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
{['한국어', 'English', '中文'].map((lang) => (
<button
key={lang}
onClick={() => !isGenerating && setSelectedLang(lang)}
disabled={isGenerating}
onClick={() => !isGenerating && selectedType !== '배경음악' && setSelectedLang(lang)}
disabled={isGenerating || selectedType === '배경음악'}
className={`genre-btn ${selectedLang === lang ? 'active' : ''}`}
>
<span>{LANGUAGE_FLAGS[lang]}</span> {lang}
@@ -495,8 +501,8 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
{['日本語', 'ไทย', 'Tiếng Việt'].map((lang) => (
<button
key={lang}
onClick={() => !isGenerating && setSelectedLang(lang)}
disabled={isGenerating}
onClick={() => !isGenerating && selectedType !== '배경음악' && setSelectedLang(lang)}
disabled={isGenerating || selectedType === '배경음악'}
className={`genre-btn ${selectedLang === lang ? 'active' : ''}`}
>
<span>{LANGUAGE_FLAGS[lang]}</span> {lang}
@@ -598,16 +604,28 @@ const SoundStudioContent: React.FC<SoundStudioContentProps> = ({
{/* Lyrics Display */}
<div className="lyrics-display">
{lyrics ? (
<textarea
value={lyrics}
readOnly
className="lyrics-textarea"
placeholder={t('soundStudio.lyricsPlaceholder')}
/>
) : (
{lyrics ? (() => {
const lines = lyrics.split('\n').filter(l => l.trim());
const size = Math.ceil(lines.length / 3);
const outroLines = lines.slice(size * 2).slice(0, 2);
const sections = [
{ tag: '[Verse]', lines: lines.slice(0, size) },
{ tag: '[Chorus]', lines: lines.slice(size, size * 2) },
{ tag: '[Outro]', lines: outroLines },
].filter(s => s.lines.length > 0);
return (
<div className="lyrics-paragraphs">
{sections.map((section, i) => (
<div key={i} className="lyrics-section">
<span className="lyrics-tag">{section.tag}</span>
<p className="lyrics-paragraph">{section.lines.join('\n')}</p>
</div>
))}
</div>
);
})() : (
<div className="lyrics-placeholder">
{t('soundStudio.lyricsPlaceholder')}
{selectedType === '배경음악' ? t('soundStudio.lyricsPlaceholderBGM') : t('soundStudio.lyricsPlaceholder')}
</div>
)}
</div>
+10 -8
View File
@@ -160,14 +160,16 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({ onAnalyze, onAutocomp
const handleAnalyzeClick = () => {
if (!inputValue.trim()) return;
if (searchType === 'name' && selectedItem && onAutocomplete) {
// 업체명 검색인 경우 autocomplete API 호출
const request: AutocompleteRequest = {
address: selectedItem.address,
roadAddress: selectedItem.roadAddress,
title: selectedItem.title,
};
onAutocomplete(request);
if (searchType === 'name') {
if (selectedItem && onAutocomplete) {
const request: AutocompleteRequest = {
address: selectedItem.address,
roadAddress: selectedItem.roadAddress,
title: selectedItem.title,
};
onAutocomplete(request);
}
// selectedItem 없으면 아무것도 하지 않음 (드롭다운에서 선택 필요)
} else {
// URL 검색인 경우 기존 로직
onAnalyze(inputValue.trim(), searchType);
+4 -2
View File
@@ -68,6 +68,7 @@ export interface LyricGenerateRequest {
region: string;
task_id: string;
orientation?: 'vertical' | 'horizontal';
instrumental?: boolean;
}
// 가사 생성 응답
@@ -103,8 +104,9 @@ export interface LyricDetailResponse {
// 노래 생성 요청
export interface SongGenerateRequest {
genre: string;
language: string;
lyrics: string;
language?: string;
lyrics?: string;
instrumental?: boolean;
}
// 노래 생성 응답
+12 -5
View File
@@ -162,6 +162,8 @@ export async function generateSong(taskId: string, request: SongGenerateRequest)
});
if (!response.ok) {
const errorBody = await response.json().catch(() => null);
console.error('[generateSong] 422 detail:', JSON.stringify(errorBody));
throw new Error(`HTTP error! status: ${response.status}`);
}
@@ -477,14 +479,20 @@ export async function authenticatedFetch(
let response = await fetch(url, { ...options, headers });
// 401 에러 시 토큰 갱신 시도
// 401 에러 시 에러 코드에 따라 처리
if (response.status === 401) {
const errorBody = await response.json().catch(() => null);
const errorCode = errorBody?.detail?.code;
if (errorCode !== 'TOKEN_EXPIRED') {
// INVALID_TOKEN 등 갱신으로 해결 불가한 경우 즉시 로그인 이동
redirectToLogin();
throw new Error(errorCode ?? 'Unauthorized');
}
try {
// 이미 갱신 중이면 기존 Promise 재사용 (중복 요청 방지)
// refreshPromise가 존재하면 재사용, 없으면 새로 생성
if (!refreshPromise) {
refreshPromise = refreshAccessToken().finally(() => {
// 성공/실패 상관없이 Promise 초기화 (다음 갱신을 위해)
refreshPromise = null;
});
}
@@ -501,7 +509,6 @@ export async function authenticatedFetch(
response = await fetch(url, { ...options, headers: newHeaders });
} catch (refreshError) {
console.error('Token refresh failed:', refreshError);
// 토큰 갱신 실패 시 로그인 페이지로 리다이렉트
redirectToLogin();
throw refreshError;
}