diff --git a/scripts/debug_render.py b/scripts/debug_render.py index 09ddf66..9e60859 100644 --- a/scripts/debug_render.py +++ b/scripts/debug_render.py @@ -70,13 +70,13 @@ class MockConfigManager: return self.template_name def get_max_topics(self) -> int: - return 5 + return 8 def get_max_user_titles(self) -> int: return 8 def get_max_golden_quotes(self) -> int: - return 5 + return 8 def get_pdf_output_dir(self) -> str: return "data/pdf" @@ -137,6 +137,26 @@ async def debug_render( contributors=["周八", "吴九"], detail="[123456789] 分享了最新游戏的通关体验,讨论了画面表现和剧情走向。", ), + SummaryTopic( + topic="新出的3A大作测评", + contributors=["周八", "吴九"], + detail="[123456789] 分享了最新游戏的通关体验,讨论了画面表现和剧情走向。", + ), + SummaryTopic( + topic="新出的3A大作测评", + contributors=["周八", "吴九"], + detail="[123456789] 分享了最新游戏的通关体验,讨论了画面表现和剧情走向。", + ), + SummaryTopic( + topic="新出的3A大作测评", + contributors=["周八", "吴九"], + detail="[123456789] 分享了最新游戏的通关体验,讨论了画面表现和剧情走向。", + ), + SummaryTopic( + topic="新出的3A大作测评", + contributors=["周八", "吴九"], + detail="[123456789] 分享了最新游戏的通关体验,讨论了画面表现和剧情走向。", + ), ] user_titles = [ @@ -161,6 +181,34 @@ async def debug_render( mbti="INFP", reason="总是在凌晨三点出没,留下几句深奥的话语后消失。", ), + UserTitle( + name="潜水员", + user_id="112233445", + title="深夜潜水员", + mbti="INFP", + reason="总是在凌晨三点出没,留下几句深奥的话语后消失。", + ), + UserTitle( + name="潜水员", + user_id="112233445", + title="深夜潜水员", + mbti="INFP", + reason="总是在凌晨三点出没,留下几句深奥的话语后消失。", + ), + UserTitle( + name="潜水员", + user_id="112233445", + title="深夜潜水员", + mbti="INFP", + reason="总是在凌晨三点出没,留下几句深奥的话语后消失。", + ), + UserTitle( + name="潜水员", + user_id="112233445", + title="深夜潜水员", + mbti="INFP", + reason="总是在凌晨三点出没,留下几句深奥的话语后消失。", + ), ] golden_quotes = [ @@ -182,6 +230,30 @@ async def debug_render( reason="引发了长达3小时的群聊大讨论", user_id="112233445", ), + GoldenQuote( + content="PHP是世界上最好的语言!", + sender="王五", + reason="引发了长达3小时的群聊大讨论", + user_id="112233445", + ), + GoldenQuote( + content="PHP是世界上最好的语言!", + sender="王五", + reason="引发了长达3小时的群聊大讨论", + user_id="112233445", + ), + GoldenQuote( + content="PHP是世界上最好的语言!", + sender="王五", + reason="引发了长达3小时的群聊大讨论", + user_id="112233445", + ), + GoldenQuote( + content="PHP是世界上最好的语言!", + sender="王五", + reason="引发了长达3小时的群聊大讨论", + user_id="112233445", + ), ] stats.golden_quotes = golden_quotes diff --git a/src/infrastructure/reporting/templates/spring_festival/activity_chart.html b/src/infrastructure/reporting/templates/spring_festival/activity_chart.html new file mode 100644 index 0000000..473b7dc --- /dev/null +++ b/src/infrastructure/reporting/templates/spring_festival/activity_chart.html @@ -0,0 +1,44 @@ +{% if chart_data %} +
+ {% for item in chart_data %} +
+ +
+ {{ item.count if item.count > 0 else '' }} +
+ + +
+ + +
+ {{ "%02d"|format(item.hour) }}:00 +
+
+ {% endfor %} +
+{% else %} +
+ 🏮 尚无活跃记录 🏮 +
+{% endif %} \ No newline at end of file diff --git a/src/infrastructure/reporting/templates/spring_festival/image_template.html b/src/infrastructure/reporting/templates/spring_festival/image_template.html new file mode 100644 index 0000000..dc60a0f --- /dev/null +++ b/src/infrastructure/reporting/templates/spring_festival/image_template.html @@ -0,0 +1,675 @@ + + + + + + 春节特供 · 群聊日报 + + + + + + + + +
+
+
+
+
+ +
+
+

🧧 春节特供日报 🧧

+
+
—— {{current_date}} · 岁在丙午 ——
+
+ +
+
+
+
消息总数
+
{{message_count}}
+
+
+
参与群友
+
{{participant_count}}
+
+
+
表情统计
+
{{emoji_count}}
+
+
+
总字符数
+
{{total_characters}}
+
+
+ +
+
+ 巅峰时刻 +
+
+ {{most_active_period}} +
+
🏮 鸿运齐天 + · 众友云集 🏮
+
+
+ +
+ +
+
🏮 核心话题回顾
+
+ {{topics_html}} +
+
+ + +
+
📈 活跃时序图
+
+
ACTIVITY CHRONICLE
+ {{hourly_chart_html}} +
+
+ + +
+
🎖️ 群友风云榜
+ {{titles_html}} +
+ + +
+
每日金句回响
+
+ {{quotes_html}} +
+
+
+ + +
+ + + \ No newline at end of file diff --git a/src/infrastructure/reporting/templates/spring_festival/pdf_template.html b/src/infrastructure/reporting/templates/spring_festival/pdf_template.html new file mode 100644 index 0000000..3fe46d1 --- /dev/null +++ b/src/infrastructure/reporting/templates/spring_festival/pdf_template.html @@ -0,0 +1,330 @@ + + + + + + 春节特供日报 (PDF) + + + + + + + +
+
+ +
+

🏮 春节特供日报 🏮

+
—— {{current_date}} ——
+
+ +
+
+
消息数
+
{{message_count}}
+
+
+
群友数
+
{{participant_count}}
+
+
+
总字数
+
{{total_characters}}
+
+
+
活跃窗口
+
{{most_active_period}}
+
+
+ +
+
+
核心话题回顾
+ {{topics_html}} +
+
+
活跃趋势
+
+ {{hourly_chart_html}} +
+ +
群友风云榜
+ {{titles_html}} +
+
+ +
每日金句回响
+ {{quotes_html}} + + +
+ + + \ No newline at end of file diff --git a/src/infrastructure/reporting/templates/spring_festival/quote_item.html b/src/infrastructure/reporting/templates/spring_festival/quote_item.html new file mode 100644 index 0000000..725566a --- /dev/null +++ b/src/infrastructure/reporting/templates/spring_festival/quote_item.html @@ -0,0 +1,24 @@ +{% if quotes %} +
+ {% for quote in quotes %} +
+
+ {% if quote.avatar_url %} + {{ quote.sender }} + {% elif quote.avatar_data %} + {{ quote.sender }} + {% else %} +
+ {% endif %} +
+
+
“{{ quote.content }}”
+
—— {{ quote.sender }}
+
【评语】{{ quote.reason }}
+
+
+ {% endfor %} +
+{% endif %} \ No newline at end of file diff --git a/src/infrastructure/reporting/templates/spring_festival/topic_item.html b/src/infrastructure/reporting/templates/spring_festival/topic_item.html new file mode 100644 index 0000000..dbfe7d6 --- /dev/null +++ b/src/infrastructure/reporting/templates/spring_festival/topic_item.html @@ -0,0 +1,14 @@ +{% if topics %} +
+ {% for topic in topics %} +
+
+ 🏮 + {{ topic.topic.topic }} +
+
参与者: {{ topic.contributors }}
+
{{ topic.detail | safe }}
+
+ {% endfor %} +
+{% endif %} \ No newline at end of file diff --git a/src/infrastructure/reporting/templates/spring_festival/user_title_item.html b/src/infrastructure/reporting/templates/spring_festival/user_title_item.html new file mode 100644 index 0000000..606f43b --- /dev/null +++ b/src/infrastructure/reporting/templates/spring_festival/user_title_item.html @@ -0,0 +1,26 @@ +{% if titles %} +
+ {% for title in titles %} +
+
+
+ {% if title.avatar_data %} + {{ title.name }} + {% else %} +
+ {% endif %} +
+ +
+
{{ title.reason }}
+
+ {% endfor %} +
+{% endif %} \ No newline at end of file