1 2 3 4 5 6 7 8 9 10 11 12
use serde::{Deserialize, Serialize}; use crate::entity::entity::Entity; #[derive(Debug, Serialize, Deserialize)] pub struct TreeEntity<E,T> { #[serde(flatten)] pub entity: Entity<T>, pub parent_id: T, pub sort_value: i32, pub children: Vec<E>, }