Files
tencent-im-util/src/main/java/com/imutil/service/UsageStatService.java
T
yixiongandClaude d22fdcfaad feat: 初始化腾讯IM分发工具骨架,含回调分发链路与历史消息补拉
- 应用骨架: Solon + MyBatis-Plus + PostgreSQL + Redis + Sa-Token
- 核心链路: 回调网关 → 消息落库(幂等) → 分发队列(FOR UPDATE SKIP LOCKED) → worker消费/重试/死信
- 多租户隔离: 前缀法账号映射, 所有业务表带 tenant_id
- 管理后台: FreeMarker 渲染, 租户/授权/队列/用量管理页面
- 历史消息补拉: 水位线驱动, getRoamMsg/getGroupMsg 增量拉取, 兜底回调丢失
- msg_key 统一算法(回调/补拉共享, 跨路径去重)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-08 20:28:32 +08:00

24 lines
637 B
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package com.imutil.service;
import java.time.OffsetDateTime;
/**
* 用量统计服务
* <p>
* 按小时窗口从 im_message / api_call_log 聚合用量到 usage_stat(计费拆账依据)。
*
* @author imutil
*/
public interface UsageStatService {
/**
* 聚合某小时窗口 [start, end) 的用量,upsert 到 usage_statstat_level=1
* <p>
* 幂等:ON CONFLICT,重复跑不产生重复数据,取最新聚合值。
*
* @param start 窗口起点(含,整点)
* @param end 窗口终点(不含)
*/
void aggregateHour(OffsetDateTime start, OffsetDateTime end);
}