Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,18 +28,18 @@ class EventManager:
|
|
| 28 |
"participation": "유익하고 착한 댓글 남기기"
|
| 29 |
},
|
| 30 |
"채용공고": {
|
| 31 |
-
"action": "채용공고 확인",
|
| 32 |
"reward_frequency": "일별",
|
| 33 |
"participation": "채용공고 열람 및 지원"
|
| 34 |
},
|
| 35 |
"게시글작성": {
|
| 36 |
"action": "게시글 작성",
|
| 37 |
-
"reward_frequency": "일별",
|
| 38 |
"participation": "양질의 게시글 작성"
|
| 39 |
}
|
| 40 |
}
|
| 41 |
|
| 42 |
-
def calculate_event_duration(self, start_date
|
| 43 |
"""이벤트 기간 계산"""
|
| 44 |
try:
|
| 45 |
start = datetime.datetime.strptime(start_date, "%Y-%m-%d")
|
|
@@ -50,7 +50,7 @@ class EventManager:
|
|
| 50 |
except:
|
| 51 |
return 0, 0
|
| 52 |
|
| 53 |
-
def generate_monthly_concept(self, month
|
| 54 |
"""월별 컨셉 생성"""
|
| 55 |
if month in self.monthly_concepts:
|
| 56 |
concept = self.monthly_concepts[month]
|
|
@@ -62,8 +62,7 @@ class EventManager:
|
|
| 62 |
}
|
| 63 |
return {}
|
| 64 |
|
| 65 |
-
def generate_event_copy(self, event_type
|
| 66 |
-
custom_details: str = "") -> str:
|
| 67 |
"""이벤트 카피 생성"""
|
| 68 |
if not concept:
|
| 69 |
return "먼저 이벤트 기간을 설정해주세요."
|
|
@@ -89,7 +88,7 @@ class EventManager:
|
|
| 89 |
|
| 90 |
return base_copy
|
| 91 |
|
| 92 |
-
def generate_design_advice(self, concept
|
| 93 |
"""디자인 조언 생성"""
|
| 94 |
if not concept:
|
| 95 |
return "컨셉 정보가 필요합니다."
|
|
@@ -122,7 +121,7 @@ class EventManager:
|
|
| 122 |
def create_interface():
|
| 123 |
event_manager = EventManager()
|
| 124 |
|
| 125 |
-
with gr.Blocks(title="이벤트 관리 시스템"
|
| 126 |
gr.Markdown("# 🎉 이벤트 관리 시스템")
|
| 127 |
gr.Markdown("월별 이벤트 기획부터 디자인 조언까지 한 번에!")
|
| 128 |
|
|
@@ -137,8 +136,8 @@ def create_interface():
|
|
| 137 |
)
|
| 138 |
|
| 139 |
end_date = gr.Textbox(
|
| 140 |
-
label="이벤트 종료일",
|
| 141 |
-
placeholder="YYYY-MM-DD (예: 2025-05-25)",
|
| 142 |
value="2025-05-25"
|
| 143 |
)
|
| 144 |
|
|
@@ -165,7 +164,7 @@ def create_interface():
|
|
| 165 |
)
|
| 166 |
|
| 167 |
concept_info = gr.Textbox(
|
| 168 |
-
label="월별 컨셉 정보",
|
| 169 |
interactive=False,
|
| 170 |
lines=3
|
| 171 |
)
|
|
@@ -212,18 +211,13 @@ def create_interface():
|
|
| 212 |
gr.Markdown("""
|
| 213 |
## 📝 사용 가이드
|
| 214 |
1. **이벤트 기간 설정**: 시작일과 종료일을 YYYY-MM-DD 형식으로 입력
|
| 215 |
-
2. **이벤트 종류 선택**: 드롭다운에서 이벤트 타입 선택
|
| 216 |
3. **추가 정보 입력**: 특별한 조건이나 상세내용 입력 (선택사항)
|
| 217 |
4. **생성하기 클릭**: 자동으로 컨셉, 카피, 디자인 조언 생성
|
| 218 |
-
|
| 219 |
-
### 🎯 다음 단계 개발 예정
|
| 220 |
-
- 이미지 레퍼런스 분석 기능
|
| 221 |
-
- 상세한 공지사항 템플릿
|
| 222 |
-
- 이벤트 종류별 맞춤 설정
|
| 223 |
""")
|
| 224 |
|
| 225 |
return demo
|
| 226 |
|
| 227 |
if __name__ == "__main__":
|
| 228 |
demo = create_interface()
|
| 229 |
-
demo.launch(
|
|
|
|
| 28 |
"participation": "유익하고 착한 댓글 남기기"
|
| 29 |
},
|
| 30 |
"채용공고": {
|
| 31 |
+
"action": "채용공고 확인",
|
| 32 |
"reward_frequency": "일별",
|
| 33 |
"participation": "채용공고 열람 및 지원"
|
| 34 |
},
|
| 35 |
"게시글작성": {
|
| 36 |
"action": "게시글 작성",
|
| 37 |
+
"reward_frequency": "일별",
|
| 38 |
"participation": "양질의 게시글 작성"
|
| 39 |
}
|
| 40 |
}
|
| 41 |
|
| 42 |
+
def calculate_event_duration(self, start_date, end_date):
|
| 43 |
"""이벤트 기간 계산"""
|
| 44 |
try:
|
| 45 |
start = datetime.datetime.strptime(start_date, "%Y-%m-%d")
|
|
|
|
| 50 |
except:
|
| 51 |
return 0, 0
|
| 52 |
|
| 53 |
+
def generate_monthly_concept(self, month):
|
| 54 |
"""월별 컨셉 생성"""
|
| 55 |
if month in self.monthly_concepts:
|
| 56 |
concept = self.monthly_concepts[month]
|
|
|
|
| 62 |
}
|
| 63 |
return {}
|
| 64 |
|
| 65 |
+
def generate_event_copy(self, event_type, concept, duration, custom_details=""):
|
|
|
|
| 66 |
"""이벤트 카피 생성"""
|
| 67 |
if not concept:
|
| 68 |
return "먼저 이벤트 기간을 설정해주세요."
|
|
|
|
| 88 |
|
| 89 |
return base_copy
|
| 90 |
|
| 91 |
+
def generate_design_advice(self, concept):
|
| 92 |
"""디자인 조언 생성"""
|
| 93 |
if not concept:
|
| 94 |
return "컨셉 정보가 필요합니다."
|
|
|
|
| 121 |
def create_interface():
|
| 122 |
event_manager = EventManager()
|
| 123 |
|
| 124 |
+
with gr.Blocks(title="이벤트 관리 시스템") as demo:
|
| 125 |
gr.Markdown("# 🎉 이벤트 관리 시스템")
|
| 126 |
gr.Markdown("월별 이벤트 기획부터 디자인 조언까지 한 번에!")
|
| 127 |
|
|
|
|
| 136 |
)
|
| 137 |
|
| 138 |
end_date = gr.Textbox(
|
| 139 |
+
label="이벤트 종료일",
|
| 140 |
+
placeholder="YYYY-MM-DD (예: 2025-05-25)",
|
| 141 |
value="2025-05-25"
|
| 142 |
)
|
| 143 |
|
|
|
|
| 164 |
)
|
| 165 |
|
| 166 |
concept_info = gr.Textbox(
|
| 167 |
+
label="월별 컨셉 정보",
|
| 168 |
interactive=False,
|
| 169 |
lines=3
|
| 170 |
)
|
|
|
|
| 211 |
gr.Markdown("""
|
| 212 |
## 📝 사용 가이드
|
| 213 |
1. **이벤트 기간 설정**: 시작일과 종료일을 YYYY-MM-DD 형식으로 입력
|
| 214 |
+
2. **이벤트 종류 선택**: 드롭다운에서 이벤트 타입 선택
|
| 215 |
3. **추가 정보 입력**: 특별한 조건이나 상세내용 입력 (선택사항)
|
| 216 |
4. **생성하기 클릭**: 자동으로 컨셉, 카피, 디자인 조언 생성
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 217 |
""")
|
| 218 |
|
| 219 |
return demo
|
| 220 |
|
| 221 |
if __name__ == "__main__":
|
| 222 |
demo = create_interface()
|
| 223 |
+
demo.launch()
|