feat(plugin): timeseries 聚合 API — date_trunc 时间序列

This commit is contained in:
iven
2026-04-17 11:01:43 +08:00
parent c9a58e9d34
commit a333b3673f
5 changed files with 233 additions and 1 deletions

View File

@@ -83,3 +83,25 @@ pub struct BatchActionReq {
/// batch_update 时的更新数据
pub data: Option<serde_json::Value>,
}
/// 时间序列查询参数
#[derive(Debug, Serialize, Deserialize, utoipa::IntoParams)]
pub struct TimeseriesParams {
/// 时间字段名
pub time_field: String,
/// 时间粒度: "day" / "week" / "month"
pub time_grain: String,
/// 开始日期 (ISO)
pub start: Option<String>,
/// 结束日期 (ISO)
pub end: Option<String>,
}
/// 时间序列数据项
#[derive(Debug, Serialize, Deserialize, utoipa::ToSchema)]
pub struct TimeseriesItem {
/// 时间周期
pub period: String,
/// 计数
pub count: i64,
}