chore: removed dead code
This commit is contained in:
parent
029eb95382
commit
d8971f6c62
6 changed files with 4 additions and 251 deletions
|
|
@ -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>,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ use tower_http::trace::TraceLayer;
|
|||
|
||||
#[derive(Clone)]
|
||||
pub struct Context {
|
||||
pub pool: crate::db::DbPool,
|
||||
pub repo: crate::db::SqliteRepository,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue