use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, utoipa::ToSchema)]
pub struct SpaceDetail {
pub id: u64,
pub name: String,
pub vid_type: String,
pub partition_num: i32,
pub replica_factor: i32,
pub comment: Option<String>,
pub created_at: i64,
pub statistics: SpaceStatistics,
}
#[derive(Debug, Serialize, utoipa::ToSchema)]
pub struct SpaceStatistics {
pub tag_count: i64,
pub edge_type_count: i64,
pub index_count: i64,
pub estimated_vertex_count: i64,
pub estimated_edge_count: i64,
}
#[derive(Debug, Serialize, utoipa::ToSchema)]
pub struct TagSummary {
pub id: i64,
pub name: String,
pub property_count: i64,
pub index_count: i64,
pub created_at: i64,
}
#[derive(Debug, Serialize, utoipa::ToSchema)]
pub struct TagDetail {
pub id: i64,
pub name: String,
pub properties: Vec<PropertyDef>,
pub indexes: Vec<IndexInfo>,
pub created_at: i64,
}
#[derive(Debug, Serialize, utoipa::ToSchema)]
pub struct EdgeTypeSummary {
pub id: i64,
pub name: String,
pub property_count: i64,
pub index_count: i64,
pub created_at: i64,
}
#[derive(Debug, Serialize, utoipa::ToSchema)]
pub struct EdgeTypeDetail {
pub id: i64,
pub name: String,
pub properties: Vec<PropertyDef>,
pub indexes: Vec<IndexInfo>,
pub created_at: i64,
}
#[derive(Debug, Serialize, Deserialize, utoipa::ToSchema)]
pub struct PropertyDef {
pub name: String,
pub data_type: String,
pub nullable: bool,
pub default_value: Option<String>,
}
#[derive(Debug, Serialize, utoipa::ToSchema)]
pub struct IndexInfo {
pub id: i64,
pub name: String,
pub index_type: String, pub fields: Vec<String>,
pub status: String, pub progress: Option<i32>,
pub created_at: i64,
}
#[derive(Debug, Deserialize, utoipa::ToSchema)]
pub struct CreateIndexRequest {
pub name: String,
pub index_type: String,
pub entity_type: String, pub entity_name: String,
pub fields: Vec<String>,
pub comment: Option<String>,
}
#[derive(Debug, Deserialize, utoipa::ToSchema)]
pub struct UpdateTagRequest {
pub add_properties: Option<Vec<PropertyDef>>,
pub drop_properties: Option<Vec<String>>,
}
#[derive(Debug, Deserialize, utoipa::ToSchema)]
pub struct UpdateEdgeTypeRequest {
pub add_properties: Option<Vec<PropertyDef>>,
pub drop_properties: Option<Vec<String>>,
}