feat(plugin): timeseries 聚合 API — date_trunc 时间序列
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user