chore: removed dead code

This commit is contained in:
Jef Roosens 2025-03-04 16:53:34 +01:00
parent 029eb95382
commit d8971f6c62
No known key found for this signature in database
GPG key ID: 21FD3D77D56BAF49
6 changed files with 4 additions and 251 deletions

View file

@ -1,56 +1,5 @@
use chrono::{NaiveDateTime, Utc};
use serde::{Deserialize, Serialize};
use crate::db;
#[derive(Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum DeviceType {
Desktop,
Laptop,
Mobile,
Server,
Other,
}
impl From<DeviceType> for db::DeviceType {
fn from(value: DeviceType) -> Self {
match value {
DeviceType::Desktop => Self::Desktop,
DeviceType::Laptop => Self::Laptop,
DeviceType::Mobile => Self::Mobile,
DeviceType::Server => Self::Server,
DeviceType::Other => Self::Other,
}
}
}
impl From<db::DeviceType> for DeviceType {
fn from(value: db::DeviceType) -> Self {
match value {
db::DeviceType::Desktop => Self::Desktop,
db::DeviceType::Laptop => Self::Laptop,
db::DeviceType::Mobile => Self::Mobile,
db::DeviceType::Server => Self::Server,
db::DeviceType::Other => Self::Other,
}
}
}
#[derive(Serialize)]
pub struct Device {
pub id: String,
pub caption: String,
pub r#type: DeviceType,
pub subscriptions: i64,
}
#[derive(Deserialize)]
pub struct DevicePatch {
pub caption: Option<String>,
pub r#type: Option<DeviceType>,
}
#[derive(Deserialize)]
pub struct SubscriptionDelta {
pub add: Vec<String>,

View file

@ -6,7 +6,6 @@ use tower_http::trace::TraceLayer;
#[derive(Clone)]
pub struct Context {
pub pool: crate::db::DbPool,
pub repo: crate::db::SqliteRepository,
}