feat(digest): 改成每天 9 点推「昨天」的视频情况
当天还没过完,上午发「今天的」只会是半张表,晚上数据又翻了几倍;改报前一天, 和运营早上看的复盘口径一致。 - default_day() = 昨天,定时 / 手动发送 / 预览三处共用,口径不会再分叉 - 去重标记记的是**被报的那一天**,不是发送时刻 —— 9 点失败、10 点补发成功后 不会再发一遍 - 推送时间默认 09:00;配置写坏时也按 09:00 兜底,不再是 22:00
This commit is contained in:
@@ -61,7 +61,7 @@ export function WebhookPanel() {
|
||||
}
|
||||
>
|
||||
<Eye className="w-3 h-3 mr-1" />
|
||||
预览今天
|
||||
预览昨天
|
||||
</Button>
|
||||
{status?.configured && (
|
||||
<>
|
||||
@@ -72,7 +72,7 @@ export function WebhookPanel() {
|
||||
disabled={sendDigest.isPending}
|
||||
>
|
||||
<Image className="w-3 h-3 mr-1" />
|
||||
发今天图
|
||||
发昨天图
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
|
||||
@@ -427,13 +427,13 @@ export function useTestWebhook() {
|
||||
})
|
||||
}
|
||||
|
||||
/** 手动推一次「今天的视频情况」图。定时那条由后端调度器负责。 */
|
||||
/** 手动推一次「昨天的视频情况」图。定时那条由后端调度器负责。 */
|
||||
export function useSendDailyDigest() {
|
||||
const platform = usePlatformParam()
|
||||
return useMutation({
|
||||
mutationFn: async () => (await monitorApi.sendDailyDigest(platform)).data,
|
||||
onSuccess: (result) =>
|
||||
toast.success(`已发送今天的视频情况图(${result.rows} 条),请查看企业微信群`),
|
||||
toast.success(`已发送昨天的视频情况图(${result.rows} 条),请查看企业微信群`),
|
||||
onError: (error: Error) => toast.error(`发送失败:${error.message}`),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ export const monitorApi = {
|
||||
api.get<LoginState>('/monitor/login/state', { params: { force } }),
|
||||
|
||||
getWebhook: () => api.get<WebhookStatus>('/monitor/webhook'),
|
||||
/** 当天视频情况图:手动发一次(定时那条由后端按设置触发)。 */
|
||||
/** 昨天视频情况图:手动发一次(每天早上那条由后端按设置触发)。 */
|
||||
sendDailyDigest: (platform?: string) =>
|
||||
api.post<{ ok: boolean; rows: number; detail: string }>('/monitor/digest/send', null, {
|
||||
params: { platform },
|
||||
|
||||
Reference in New Issue
Block a user