feat(report): 格子悬停显示当天点赞/评论/收藏/分享;报表可按任务过滤
Deploy VitePress site to Pages / build (push) Canceled after 0s
Deploy VitePress site to Pages / Deploy (push) Canceled after 0s

两件事:

1. **格子悬停提示**(matrix.html)
   每个有数据的格子挂一个自定义浮层,显示「日期 · 博主 / 条数 / 点赞 / 评论 /
   收藏 / 分享 / 标签」。浮层 `pointer-events: none`,否则它会盖住格子触发
   mouseleave,自己闪个不停;表格滚动时主动收起。内容用 DOM 拼而不是
   innerHTML —— 昵称来自平台,不能当 HTML 解释。

2. **任务过滤**(/api/monitor/matrix 增加 task_id)
   平台下拉旁边加「任务」下拉,数据来自现有的 /api/monitor/tasks。
   `task_id` 会先校验平台归属,传错平台宁可返回空,也不给出别的平台的数。
   选择会写进地址栏,可以直接收藏某一组条件。

指标口径:每篇作品取**最近一轮**快照(run_id 最大)再按格子求和。未知是 None
不是 0 —— 提示里显示成「—」,避免把「没读到」说成「没有互动」。

测试:10 条(新增指标求和取最新一轮、未知为 None、任务过滤、跨平台任务被拒)。
This commit is contained in:
butubb
2026-10-22 14:11:38 +08:00
parent c095530879
commit ffafd90073
4 changed files with 340 additions and 35 deletions
+75 -6
View File
@@ -1452,7 +1452,10 @@ async def mark_events_read(session: AsyncSession, task_id: Optional[int] = None)
async def daily_tag_matrix( async def daily_tag_matrix(
session: AsyncSession, platform: str, days: int session: AsyncSession,
platform: str,
days: int,
task_id: Optional[int] = None,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
"""日期 × 博主 → 当天发出去的作品标签。给 ``/report/matrix`` 用。 """日期 × 博主 → 当天发出去的作品标签。给 ``/report/matrix`` 用。
@@ -1465,12 +1468,30 @@ async def daily_tag_matrix(
{"dates": ["2026-10-21", ...], # 新到旧 {"dates": ["2026-10-21", ...], # 新到旧
"creators": [{"hash": ..., "name": ...}], # 按昵称排序 "creators": [{"hash": ..., "name": ...}], # 按昵称排序
"cells": {"2026-10-21": {"<hash>": {"count": 2, "tags": ["大字报", "养号"]}}}} "cells": {"2026-10-21": {"<hash>": {
"count": 2, "tags": ["大字报", "养号"],
"likes": 120, "comments": 8, "collected": 30, "shares": 4,
}}}}
``likes/comments/collected/shares`` 是当天这些作品**最近一轮**指标的和;
指标未知时是 ``None``(不是 0),前端显示成「—」。``task_id`` 非空时只统计那一个任务。
""" """
task_ids = await platform_task_ids(session, platform) if task_id is not None:
# 只看一个任务。顺带把平台也校验一遍 —— 传错平台时宁可空,也别给出别的平台的数。
task_ids = list(
await session.scalars(
select(MonitorTask.id).where(
MonitorTask.id == task_id, MonitorTask.platform == platform
)
)
)
else:
task_ids = await platform_task_ids(session, platform)
empty = { empty = {
"platform": platform, "platform": platform,
"days": days, "days": days,
"task_id": task_id,
"dates": [], "dates": [],
"creators": [], "creators": [],
"cells": {}, "cells": {},
@@ -1482,6 +1503,7 @@ async def daily_tag_matrix(
notes = ( notes = (
await session.execute( await session.execute(
select( select(
MonitorNote.task_id,
MonitorNote.note_id, MonitorNote.note_id,
MonitorNote.creator_hash, MonitorNote.creator_hash,
MonitorNote.creator_name, MonitorNote.creator_name,
@@ -1498,8 +1520,9 @@ async def daily_tag_matrix(
if not notes: if not notes:
return empty return empty
# 标签一次取完,按 note_id 归组;顺序跟词表里的 sort_order 一致。
note_ids = {row.note_id for row in notes} note_ids = {row.note_id for row in notes}
# 标签一次取完,按 note_id 归组;顺序跟词表里的 sort_order 一致。
tag_rows = ( tag_rows = (
await session.execute( await session.execute(
select(MonitorNoteTag.note_id, MonitorTag.name) select(MonitorNoteTag.note_id, MonitorTag.name)
@@ -1515,10 +1538,35 @@ async def daily_tag_matrix(
for note_id, name in tag_rows: for note_id, name in tag_rows:
tags_by_note.setdefault(note_id, []).append(name) tags_by_note.setdefault(note_id, []).append(name)
# 指标:每篇作品取**最近一轮**(run_id 最大)。没有指标行的作品不参与求和 ——
# 未知和 0 是两回事,格子的提示里会显示成「—」而不是「0」。
metric_rows = (
await session.execute(
select(
MonitorNoteMetric.task_id,
MonitorNoteMetric.note_id,
MonitorNoteMetric.run_id,
MonitorNoteMetric.liked_count,
MonitorNoteMetric.comment_count,
MonitorNoteMetric.collected_count,
MonitorNoteMetric.share_count,
).where(
MonitorNoteMetric.task_id.in_(task_ids),
MonitorNoteMetric.note_id.in_(note_ids),
)
)
).all()
latest_metric: Dict[tuple, Any] = {}
for metric in metric_rows:
key = (metric.task_id, metric.note_id)
current = latest_metric.get(key)
if current is None or metric.run_id > current.run_id:
latest_metric[key] = metric
cells: Dict[str, Dict[str, Dict[str, Any]]] = {} cells: Dict[str, Dict[str, Dict[str, Any]]] = {}
names: Dict[str, str] = {} names: Dict[str, str] = {}
# 同一个作品可能挂在多个任务下(monitor_note 的唯一键是 (task_id, note_id)), # 同一个作品可能挂在多个任务下(monitor_note 的唯一键是 (task_id, note_id)),
# 不按 note_id 去重会把计数翻倍。 # 不按 note_id 去重会把计数和指标都翻倍。
seen: set = set() seen: set = set()
for row in notes: for row in notes:
@@ -1532,13 +1580,33 @@ async def daily_tag_matrix(
names.setdefault(creator_key, row.creator_name or "") names.setdefault(creator_key, row.creator_name or "")
bucket = cells.setdefault(day, {}).setdefault( bucket = cells.setdefault(day, {}).setdefault(
creator_key, {"count": 0, "tags": []} creator_key,
{
"count": 0,
"tags": [],
"likes": None,
"comments": None,
"collected": None,
"shares": None,
},
) )
bucket["count"] += 1 bucket["count"] += 1
for tag in tags_by_note.get(row.note_id, []): for tag in tags_by_note.get(row.note_id, []):
if tag not in bucket["tags"]: if tag not in bucket["tags"]:
bucket["tags"].append(tag) bucket["tags"].append(tag)
metric = latest_metric.get((row.task_id, row.note_id))
if metric is not None:
for column, key in (
("liked_count", "likes"),
("comment_count", "comments"),
("collected_count", "collected"),
("share_count", "shares"),
):
value = getattr(metric, column)
if value is not None:
bucket[key] = (bucket[key] or 0) + value
creators = [ creators = [
{"hash": key, "name": name or f"未知({key[:6]})"} {"hash": key, "name": name or f"未知({key[:6]})"}
for key, name in names.items() for key, name in names.items()
@@ -1548,6 +1616,7 @@ async def daily_tag_matrix(
return { return {
"platform": platform, "platform": platform,
"days": days, "days": days,
"task_id": task_id,
"dates": sorted(cells, reverse=True), "dates": sorted(cells, reverse=True),
"creators": creators, "creators": creators,
"cells": cells, "cells": cells,
+169 -26
View File
@@ -18,9 +18,7 @@
--text: #e6f1ff; --text: #e6f1ff;
--muted: #7b8ba3; --muted: #7b8ba3;
--cyan: #22d3ee; --cyan: #22d3ee;
--green: #34d399;
--pink: #f472b6; --pink: #f472b6;
--orange: #fb923c;
} }
* { box-sizing: border-box; } * { box-sizing: border-box; }
body { body {
@@ -59,6 +57,7 @@
cursor: pointer; cursor: pointer;
text-decoration: none; text-decoration: none;
} }
select { max-width: 200px; }
select:hover, button:hover, a.btn:hover { border-color: var(--cyan); } select:hover, button:hover, a.btn:hover { border-color: var(--cyan); }
#status { color: var(--muted); font-size: 12px; } #status { color: var(--muted); font-size: 12px; }
#status.error { color: var(--pink); } #status.error { color: var(--pink); }
@@ -99,7 +98,6 @@
text-align: left; text-align: left;
white-space: nowrap; white-space: nowrap;
font-weight: 500; font-weight: 500;
font-variant-numeric: tabular-nums;
} }
tbody td { tbody td {
border-right: 1px solid var(--line); border-right: 1px solid var(--line);
@@ -107,7 +105,7 @@
padding: 5px 8px; padding: 5px 8px;
white-space: nowrap; white-space: nowrap;
vertical-align: top; vertical-align: top;
min-width: 88px; min-width: 92px;
} }
tbody tr:hover th, tbody tr:hover td { background: #131c28; } tbody tr:hover th, tbody tr:hover td { background: #131c28; }
@@ -157,6 +155,29 @@
color: var(--muted); color: var(--muted);
} }
#login a { color: var(--cyan); } #login a { color: var(--cyan); }
/* 悬停提示。跟着格子走,但不吃鼠标事件 —— 否则它一出现就会盖住格子、
触发 mouseleave,然后自己消失,来回闪。 */
#tip {
display: none;
position: fixed;
z-index: 100;
pointer-events: none;
max-width: 320px;
padding: 8px 10px;
border: 1px solid var(--line);
border-radius: 8px;
background: #0f1620;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
font-size: 11px;
line-height: 1.7;
color: var(--text);
}
#tip .tip-head { color: var(--cyan); font-weight: 600; margin-bottom: 2px; }
#tip .tip-metrics { font-variant-numeric: tabular-nums; }
#tip .tip-metrics span { margin-right: 10px; white-space: nowrap; }
#tip .tip-metrics b { color: var(--muted); font-weight: 400; }
#tip .tip-tags { color: var(--muted); }
</style> </style>
</head> </head>
<body> <body>
@@ -168,6 +189,11 @@
<option value="xhs">小红书</option> <option value="xhs">小红书</option>
</select> </select>
</label> </label>
<label>任务
<select id="task">
<option value="">全部任务</option>
</select>
</label>
<label>范围 <label>范围
<select id="days"> <select id="days">
<option value="7">最近 7 天</option> <option value="7">最近 7 天</option>
@@ -186,30 +212,94 @@
</div> </div>
<div class="wrap" id="wrap"></div> <div class="wrap" id="wrap"></div>
<div id="tip"></div>
<div class="legend"> <div class="legend">
<span><b>N</b> = 当天发出的作品条数</span> <span><b>N</b> = 当天发出的作品条数</span>
<span><b>无标签</b> = 发了但没打标签</span> <span><b>无标签</b> = 发了但没打标签</span>
<span><b>空白</b> = 当天没发作品</span> <span><b>空白</b> = 当天没发作品</span>
<span>标签按词表里的顺序排列</span> <span>鼠标停到格子上可以看当天的点赞 / 评论 / 收藏 / 分享</span>
</div> </div>
<script> <script>
const params = new URLSearchParams(location.search); const params = new URLSearchParams(location.search);
const platformSel = document.getElementById('platform'); const platformSel = document.getElementById('platform');
const taskSel = document.getElementById('task');
const daysSel = document.getElementById('days'); const daysSel = document.getElementById('days');
const statusEl = document.getElementById('status'); const statusEl = document.getElementById('status');
const wrap = document.getElementById('wrap'); const wrap = document.getElementById('wrap');
const login = document.getElementById('login'); const login = document.getElementById('login');
const tip = document.getElementById('tip');
platformSel.value = params.get('platform') || 'dy';
daysSel.value = params.get('days') || '14';
function setStatus(text, isError) { function setStatus(text, isError) {
statusEl.textContent = text; statusEl.textContent = text;
statusEl.className = isError ? 'error' : ''; statusEl.className = isError ? 'error' : '';
} }
function cellNode(cell) { function fmt(value) {
if (value === null || value === undefined) return '—';
return Number(value).toLocaleString('zh-CN');
}
function hideTip() {
tip.style.display = 'none';
}
function buildTip(cell, day, creatorName) {
// 用 DOM 拼,不用 innerHTML —— 昵称是平台来的文本,不能当 HTML 解释。
tip.textContent = '';
const head = document.createElement('div');
head.className = 'tip-head';
head.textContent = day + ' · ' + creatorName;
tip.appendChild(head);
const metrics = document.createElement('div');
metrics.className = 'tip-metrics';
const pairs = [
['条数', cell.count],
['点赞', cell.likes],
['评论', cell.comments],
['收藏', cell.collected],
['分享', cell.shares],
];
for (const [label, value] of pairs) {
const span = document.createElement('span');
const name = document.createElement('b');
name.textContent = label;
span.appendChild(name);
span.appendChild(document.createTextNode(' ' + fmt(value)));
metrics.appendChild(span);
}
tip.appendChild(metrics);
const tags = document.createElement('div');
tags.className = 'tip-tags';
tags.textContent =
'标签:' + (cell.tags && cell.tags.length ? cell.tags.join(' / ') : '无标签');
tip.appendChild(tags);
}
function showTip(event) {
const td = event.currentTarget;
const cell = td._cell;
if (!cell) return;
buildTip(cell, td.dataset.day, td.dataset.creator);
tip.style.display = 'block';
// 先显示再量尺寸,否则 offsetWidth 是 0。
const rect = td.getBoundingClientRect();
const width = tip.offsetWidth;
const height = tip.offsetHeight;
let left = rect.left + rect.width / 2 - width / 2;
left = Math.max(8, Math.min(left, window.innerWidth - width - 8));
let top = rect.bottom + 8;
if (top + height > window.innerHeight - 8) {
top = rect.top - height - 8;
}
tip.style.left = left + 'px';
tip.style.top = Math.max(8, top) + 'px';
}
function cellNode(cell, day, creatorName) {
const td = document.createElement('td'); const td = document.createElement('td');
if (!cell) { if (!cell) {
const dot = document.createElement('span'); const dot = document.createElement('span');
@@ -228,14 +318,20 @@
none.className = 'untagged'; none.className = 'untagged';
none.textContent = '无标签'; none.textContent = '无标签';
td.appendChild(none); td.appendChild(none);
return td; } else {
} for (const tag of cell.tags) {
for (const tag of cell.tags) { const chip = document.createElement('span');
const chip = document.createElement('span'); chip.className = 'tag';
chip.className = 'tag'; chip.textContent = tag;
chip.textContent = tag; td.appendChild(chip);
td.appendChild(chip); }
} }
td._cell = cell;
td.dataset.day = day;
td.dataset.creator = creatorName;
td.addEventListener('mouseenter', showTip);
td.addEventListener('mouseleave', hideTip);
return td; return td;
} }
@@ -245,7 +341,11 @@
setStatus('这个范围内没有作品'); setStatus('这个范围内没有作品');
return; return;
} }
setStatus(`${data.dates.length} 天 · ${data.creators.length} 个博主`); const scope =
data.task_id && taskSel.selectedOptions.length
? ' · ' + taskSel.selectedOptions[0].textContent
: '';
setStatus(data.dates.length + ' 天 · ' + data.creators.length + ' 个博主' + scope);
const table = document.createElement('table'); const table = document.createElement('table');
const thead = document.createElement('thead'); const thead = document.createElement('thead');
@@ -271,7 +371,7 @@
tr.appendChild(th); tr.appendChild(th);
for (const day of data.dates) { for (const day of data.dates) {
const rowCells = data.cells[day] || {}; const rowCells = data.cells[day] || {};
tr.appendChild(cellNode(rowCells[creator.hash])); tr.appendChild(cellNode(rowCells[creator.hash], day, creator.name));
} }
tbody.appendChild(tr); tbody.appendChild(tr);
} }
@@ -279,41 +379,84 @@
wrap.appendChild(table); wrap.appendChild(table);
} }
async function loadTasks() {
taskSel.innerHTML = '<option value="">全部任务</option>';
try {
const response = await fetch(
'/api/monitor/tasks?platform=' + encodeURIComponent(platformSel.value),
{ credentials: 'same-origin' },
);
if (!response.ok) return;
const data = await response.json();
for (const task of data.tasks || []) {
const option = document.createElement('option');
option.value = String(task.id);
option.textContent = task.name;
taskSel.appendChild(option);
}
} catch (err) {
// 任务列表拉不到不该挡住看矩阵,保持「全部任务」即可。
}
}
async function load() { async function load() {
const platform = platformSel.value; const platform = platformSel.value;
const days = daysSel.value; const days = daysSel.value;
const taskId = taskSel.value;
// 把当前选择写进地址栏,方便直接收藏/分享到某一组条件 // 把当前选择写进地址栏,方便直接收藏/分享到某一组条件
const url = new URL(location.href); const url = new URL(location.href);
url.searchParams.set('platform', platform); url.searchParams.set('platform', platform);
url.searchParams.set('days', days); url.searchParams.set('days', days);
if (taskId) url.searchParams.set('task_id', taskId);
else url.searchParams.delete('task_id');
history.replaceState(null, '', url); history.replaceState(null, '', url);
setStatus('加载中…'); setStatus('加载中…');
wrap.innerHTML = ''; wrap.innerHTML = '';
hideTip();
login.style.display = 'none'; login.style.display = 'none';
try { try {
const response = await fetch( const query = new URLSearchParams({ platform: platform, days: days });
`/api/monitor/matrix?platform=${encodeURIComponent(platform)}&days=${days}`, if (taskId) query.set('task_id', taskId);
{ credentials: 'same-origin' }, const response = await fetch('/api/monitor/matrix?' + query.toString(), {
); credentials: 'same-origin',
});
if (response.status === 401) { if (response.status === 401) {
login.style.display = 'block'; login.style.display = 'block';
setStatus('未登录', true); setStatus('未登录', true);
return; return;
} }
if (!response.ok) { if (!response.ok) {
throw new Error(`HTTP ${response.status}`); throw new Error('HTTP ' + response.status);
} }
render(await response.json()); render(await response.json());
} catch (err) { } catch (err) {
setStatus(`加载失败:${err.message}`, true); setStatus('加载失败:' + err.message, true);
} }
} }
async function init() {
platformSel.value = params.get('platform') || 'dy';
daysSel.value = params.get('days') || '14';
await loadTasks();
const wanted = params.get('task_id');
if (wanted && Array.from(taskSel.options).some((o) => o.value === wanted)) {
taskSel.value = wanted;
}
await load();
}
document.getElementById('refresh').addEventListener('click', load); document.getElementById('refresh').addEventListener('click', load);
platformSel.addEventListener('change', load); platformSel.addEventListener('change', async () => {
await loadTasks();
await load();
});
taskSel.addEventListener('change', load);
daysSel.addEventListener('change', load); daysSel.addEventListener('change', load);
load(); // 表格滚动时把提示收起来,否则它会停在原地、和格子脱节。
wrap.addEventListener('scroll', hideTip);
init();
</script> </script>
</body> </body>
</html> </html>
+3 -2
View File
@@ -753,14 +753,15 @@ def _to_xlsx(rows: List[Dict[str, Any]], columns: List[tuple[str, str]], sheet:
async def get_tag_matrix( async def get_tag_matrix(
platform: str = Query(default=PLATFORM_XHS, description="dy / xhs"), platform: str = Query(default=PLATFORM_XHS, description="dy / xhs"),
days: int = Query(default=14, ge=1, le=90, description="回看多少天"), days: int = Query(default=14, ge=1, le=90, description="回看多少天"),
task_id: Optional[int] = Query(default=None, description="只看某一个任务;省略=整个平台"),
): ):
"""日期 × 博主 → 当天发出去的作品标签。 """日期 × 博主 → 当天发出去的作品标签(带点赞/评论/收藏/分享的当日小计)。
返回**长表结构**(dates / creators / cells),转置交给前端的报表页 返回**长表结构**(dates / creators / cells),转置交给前端的报表页
(``/report/matrix``)。理由见 ``service.daily_tag_matrix`` 的说明。 (``/report/matrix``)。理由见 ``service.daily_tag_matrix`` 的说明。
""" """
async with get_session() as session: async with get_session() as session:
return await service.daily_tag_matrix(session, platform, days) return await service.daily_tag_matrix(session, platform, days, task_id=task_id)
@router.get("/report") @router.get("/report")
+93 -1
View File
@@ -22,6 +22,7 @@ from api.monitor import service
from api.monitor.models import ( from api.monitor.models import (
MODE_CREATOR, MODE_CREATOR,
MonitorNote, MonitorNote,
MonitorNoteMetric,
MonitorNoteTag, MonitorNoteTag,
MonitorTag, MonitorTag,
MonitorTask, MonitorTask,
@@ -109,6 +110,30 @@ async def _attach(platform: str, note_id: str, tag_id: int) -> None:
) )
async def _metric(
task_id: int,
note_id: str,
run_id: int,
liked: int | None = None,
comment: int | None = None,
collected: int | None = None,
share: int | None = None,
) -> None:
async with monitor_db.get_session() as session:
session.add(
MonitorNoteMetric(
task_id=task_id,
note_id=note_id,
run_id=run_id,
captured_at=run_id,
liked_count=liked,
comment_count=comment,
collected_count=collected,
share_count=share,
)
)
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_same_day_notes_collapse_with_tags_union(db): async def test_same_day_notes_collapse_with_tags_union(db):
task_id = await _task() task_id = await _task()
@@ -185,12 +210,76 @@ async def test_no_tasks_returns_an_empty_shape(db):
assert data == { assert data == {
"platform": "dy", "platform": "dy",
"days": 7, "days": 7,
"task_id": None,
"dates": [], "dates": [],
"creators": [], "creators": [],
"cells": {}, "cells": {},
} }
@pytest.mark.asyncio
async def test_cell_sums_the_latest_metric_of_each_note(db):
task_id = await _task()
now = get_current_timestamp() - 1000
await _note(task_id, "n1", "博主A", now)
await _note(task_id, "n2", "博主A", now)
# 同一篇有两轮快照,只取 run_id 最大的那一轮
await _metric(task_id, "n1", run_id=1, liked=10, comment=1, collected=2, share=3)
await _metric(task_id, "n1", run_id=2, liked=20, comment=2, collected=4, share=5)
await _metric(task_id, "n2", run_id=1, liked=5, comment=None, collected=1, share=0)
async with monitor_db.get_session() as session:
data = await service.daily_tag_matrix(session, "dy", days=7)
cell = data["cells"][_day(now)]["hash-a"]
assert cell["count"] == 2
assert cell["likes"] == 25
assert cell["comments"] == 2 # None 不参与求和
assert cell["collected"] == 5
assert cell["shares"] == 5
@pytest.mark.asyncio
async def test_missing_metrics_are_none_not_zero(db):
task_id = await _task()
now = get_current_timestamp() - 1000
await _note(task_id, "n1", "博主A", now)
async with monitor_db.get_session() as session:
data = await service.daily_tag_matrix(session, "dy", days=7)
cell = data["cells"][_day(now)]["hash-a"]
# 「不知道」和「是 0」要分开 —— 前者在提示里显示成「—」
assert cell["likes"] is None
assert cell["comments"] is None
@pytest.mark.asyncio
async def test_task_filter_scopes_the_matrix(db):
first = await _task(name="任务一")
second = await _task(name="任务二")
now = get_current_timestamp() - 1000
await _note(first, "a", "博主A", now, creator_hash="hash-a")
await _note(second, "b", "博主B", now, creator_hash="hash-b")
async with monitor_db.get_session() as session:
data = await service.daily_tag_matrix(session, "dy", days=7, task_id=second)
assert data["task_id"] == second
assert [c["name"] for c in data["creators"]] == ["博主B"]
@pytest.mark.asyncio
async def test_task_from_another_platform_is_rejected(db):
xhs_task = await _task(platform="xhs")
async with monitor_db.get_session() as session:
data = await service.daily_tag_matrix(session, "dy", days=7, task_id=xhs_task)
assert data["dates"] == []
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_endpoint_returns_the_long_shape(client): async def test_endpoint_returns_the_long_shape(client):
task_id = await _task() task_id = await _task()
@@ -205,4 +294,7 @@ async def test_endpoint_returns_the_long_shape(client):
body = response.json() body = response.json()
assert body["dates"] == [_day(now)] assert body["dates"] == [_day(now)]
assert body["creators"][0]["name"] == "博主A" assert body["creators"][0]["name"] == "博主A"
assert body["cells"][_day(now)]["hash-a"] == {"count": 1, "tags": ["大字报"]} cell = body["cells"][_day(now)]["hash-a"]
assert cell["count"] == 1
assert cell["tags"] == ["大字报"]
assert "likes" in cell