aboutsummaryrefslogtreecommitdiff
path: root/common/src/api.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2026-01-06 04:00:51 +0100
committermetamuffin <metamuffin@disroot.org>2026-01-06 04:00:51 +0100
commitc04f49adaa2cb0fa3074d6b122d1e11689c4f5de (patch)
treec8713e458ba2428c3f4df37181351e56ec7a7c57 /common/src/api.rs
parent1d3fe7b02b2d2ec7cad5c8e3e0fd4eafb60bf0e0 (diff)
downloadjellything-c04f49adaa2cb0fa3074d6b122d1e11689c4f5de.tar
jellything-c04f49adaa2cb0fa3074d6b122d1e11689c4f5de.tar.bz2
jellything-c04f49adaa2cb0fa3074d6b122d1e11689c4f5de.tar.zst
find field + refactor old common types
Diffstat (limited to 'common/src/api.rs')
-rw-r--r--common/src/api.rs13
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>,