增强群总结弹窗查看能力
- 后端群总结接口补充完整 summary_text 字段\n- 群运营详情页新增最近群总结全文弹窗\n- 保留原有摘要卡片展示并补充类型与生成时间
This commit is contained in:
@@ -97,8 +97,9 @@ def _load_recent_group_summaries(server, group_id: str, limit: int = 3) -> list:
|
||||
|
||||
设计说明:
|
||||
1. 群画像适合给“结论”,但运营者往往还想看到最近几期总结到底说了什么;
|
||||
2. 这里不把整段长文原样吐给前端,而是裁成可扫读的短摘要,避免弹窗过重;
|
||||
3. 若没有总结记录,返回空列表,由前端优雅降级。
|
||||
2. 默认卡片仍使用短摘要,避免详情页被大段文本挤占;
|
||||
3. 同时补充完整总结正文,供前端弹窗按需展开查看;
|
||||
4. 若没有总结记录,返回空列表,由前端优雅降级。
|
||||
"""
|
||||
summary_db = getattr(server, "message_summary_db", None)
|
||||
if summary_db is None:
|
||||
@@ -124,6 +125,9 @@ def _load_recent_group_summaries(server, group_id: str, limit: int = 3) -> list:
|
||||
"summary_type": str(row.get("summary_type") or "").strip(),
|
||||
"source_message_count": int(row.get("source_message_count") or 0),
|
||||
"last_generated_at": str(row.get("last_generated_at") or "").strip(),
|
||||
# 详情弹窗需要查看完整总结正文;这里保留原文,不做截断。
|
||||
"summary_text": raw_summary,
|
||||
# 卡片区域继续展示压缩后的摘要,避免详情首屏信息密度过高。
|
||||
"summary_excerpt": normalized_summary[:180] + ("..." if len(normalized_summary) > 180 else ""),
|
||||
})
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user