use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; /// 插件数据记录响应 #[derive(Debug, Serialize, Deserialize, utoipa::ToSchema)] pub struct PluginDataResp { pub id: String, pub data: serde_json::Value, pub created_at: Option>, pub updated_at: Option>, pub version: Option, } /// 创建插件数据请求 #[derive(Debug, Serialize, Deserialize, utoipa::ToSchema)] pub struct CreatePluginDataReq { pub data: serde_json::Value, } /// 更新插件数据请求 #[derive(Debug, Serialize, Deserialize, utoipa::ToSchema)] pub struct UpdatePluginDataReq { pub data: serde_json::Value, pub version: i32, } /// 插件数据列表查询参数 #[derive(Debug, Serialize, Deserialize, utoipa::IntoParams)] pub struct PluginDataListParams { pub page: Option, pub page_size: Option, pub search: Option, /// JSON 格式过滤: {"field":"value"} pub filter: Option, pub sort_by: Option, /// "asc" or "desc" pub sort_order: Option, } /// 聚合查询响应项 #[derive(Debug, Serialize, Deserialize, utoipa::ToSchema)] pub struct AggregateItem { /// 分组键(字段值) pub key: String, /// 计数 pub count: i64, } /// 聚合查询参数 #[derive(Debug, Serialize, Deserialize, utoipa::IntoParams)] pub struct AggregateQueryParams { /// 分组字段名 pub group_by: String, /// JSON 格式过滤: {"field":"value"} pub filter: Option, } /// 统计查询参数 #[derive(Debug, Serialize, Deserialize, utoipa::IntoParams)] pub struct CountQueryParams { /// 搜索关键词 pub search: Option, /// JSON 格式过滤: {"field":"value"} pub filter: Option, }