Skip to main content

get_flow_summary

Function get_flow_summary 

Source
pub async fn get_flow_summary(
    __arg0: State<RestState>,
    rec: Option<Extension<Arc<KeyRecord>>>,
    __arg2: Json<Value>,
) -> Result<Json<Value>, (StatusCode, Json<Value>)>
Expand description

POST /api/flow-summary — 账户资金流水(v1.4.30 P2)

v1.4.93 Jackie feedback Problem 1 (date-range support): proto Trd_FlowSummary 一次只接一天 (clearing_date). 之前 CLI v1.4.32 --date-range 已实装客户端循环, REST 层之前未暴露 → jackie 报告需 10 次 单日 call. 本版加 REST adapter 层客户端循环, 接受:

// v1 单日 (向后兼容)
{"c2s":{"header":{...},"clearing_date":"2026-04-22"}}

// v2 范围 (v1.4.93 新加, 等价 CLI --date-range)
{"c2s":{"header":{...},"begin_date":"2026-04-15","end_date":"2026-04-22"}}

范围模式: 跳周末, 31 天上限 (防 bot 脚本无意打几百天被服务端 rate-limit), 循环 fetch 单日 → 聚合 flow_summary_info_list 返一个 response. direction (cash_flow_direction) 顶层 c2s 字段透传到每天调用.

防 backend 无 native range 接口 — 这是 client-side fanout, 与 proto 一致.