diff options
Diffstat (limited to 'common/src/api.rs')
| -rw-r--r-- | common/src/api.rs | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/common/src/api.rs b/common/src/api.rs index 04e221e..043de1b 100644 --- a/common/src/api.rs +++ b/common/src/api.rs @@ -4,17 +4,10 @@ Copyright (C) 2026 metamuffin <metamuffin.org> */ use crate::{ - url_enum, user::{NodeUserData, User}, - Node, NodeKind, }; -use chrono::{DateTime, Utc}; -use serde::{Deserialize, Serialize}; use std::{collections::BTreeMap, sync::Arc, time::Duration}; -type NodesWithUdata = Vec<(Arc<Node>, NodeUserData)>; - -#[derive(Serialize, Deserialize)] pub struct ApiNodeResponse { pub parents: NodesWithUdata, pub children: NodesWithUdata, @@ -22,38 +15,32 @@ pub struct ApiNodeResponse { pub userdata: NodeUserData, } -#[derive(Serialize, Deserialize)] pub struct ApiSearchResponse { pub count: usize, pub results: NodesWithUdata, pub duration: Duration, } -#[derive(Serialize, Deserialize)] pub struct ApiItemsResponse { pub count: usize, pub pages: usize, pub items: NodesWithUdata, } -#[derive(Serialize, Deserialize)] pub struct ApiHomeResponse { pub toplevel: NodesWithUdata, pub categories: Vec<(String, NodesWithUdata)>, } -#[derive(Serialize, Deserialize)] pub struct ApiStatsResponse { pub kinds: BTreeMap<NodeKind, StatsBin>, pub total: StatsBin, } -#[derive(Serialize, Deserialize)] pub struct ApiAdminUsersResponse { pub users: Vec<User>, } -#[derive(Serialize, Deserialize)] pub struct LogLine { pub time: DateTime<Utc>, pub module: Option<&'static str>, |