mirror of
https://github.com/won-ktds/smarketing-backend.git
synced 2025-12-06 07:06:24 +00:00
feat: ai-poster content
This commit is contained in:
parent
cf1a586189
commit
9108232c5a
@ -98,7 +98,7 @@ def create_app():
|
||||
app.logger.error(traceback.format_exc())
|
||||
return jsonify({'error': f'SNS 콘텐츠 생성 중 오류가 발생했습니다: {str(e)}'}), 500
|
||||
|
||||
@app.route('/api/ai/poster', methods=['GET'])
|
||||
@app.route('/api/ai/poster', methods=['POST'])
|
||||
def generate_poster_content():
|
||||
"""
|
||||
홍보 포스터 생성 API
|
||||
@ -114,7 +114,7 @@ def create_app():
|
||||
return jsonify({'error': '요청 데이터가 없습니다.'}), 400
|
||||
|
||||
# 필수 필드 검증
|
||||
required_fields = ['title', 'category', 'contentType', 'images']
|
||||
required_fields = ['title', 'category', 'images']
|
||||
for field in required_fields:
|
||||
if field not in data:
|
||||
return jsonify({'error': f'필수 필드가 누락되었습니다: {field}'}), 400
|
||||
@ -140,12 +140,9 @@ def create_app():
|
||||
poster_request = PosterContentGetRequest(
|
||||
title=data.get('title'),
|
||||
category=data.get('category'),
|
||||
contentType=data.get('contentType'),
|
||||
images=data.get('images', []),
|
||||
photoStyle=data.get('photoStyle'),
|
||||
requirement=data.get('requirement'),
|
||||
toneAndManner=data.get('toneAndManner'),
|
||||
emotionIntensity=data.get('emotionIntensity'),
|
||||
menuName=data.get('menuName'),
|
||||
eventName=data.get('eventName'),
|
||||
startDate=start_date,
|
||||
|
||||
@ -33,12 +33,9 @@ class PosterContentGetRequest:
|
||||
"""홍보 포스터 생성 요청 모델"""
|
||||
title: str
|
||||
category: str
|
||||
contentType: str
|
||||
images: List[str] # 이미지 URL 리스트
|
||||
photoStyle: Optional[str] = None
|
||||
requirement: Optional[str] = None
|
||||
toneAndManner: Optional[str] = None
|
||||
emotionIntensity: Optional[str] = None
|
||||
menuName: Optional[str] = None
|
||||
eventName: Optional[str] = None
|
||||
startDate: Optional[date] = None # LocalDate -> date
|
||||
|
||||
@ -154,7 +154,6 @@ class PosterService:
|
||||
|
||||
### 📋 기본 정보
|
||||
카테고리: {request.category}
|
||||
콘텐츠 타입: {request.contentType}
|
||||
메뉴명: {request.menuName or '없음'}
|
||||
메뉴 정보: {main_description}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user