A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal
blob: 1d491fbf1f95b951d6620b9563e66a428c551257 (1331 bytes)[doc][blame][raw]
1
use sqlx::FromRow;3
#[derive(Debug, Clone, FromRow)]4
pub struct Account {5
pub id: i32,6
pub username: Option<String>,7
pub language: String,8
pub is_playback_history: bool,9
}11
#[derive(Debug, Clone, FromRow)]12
pub struct Device {13
pub id: i32,14
pub token: String,15
pub account_id: i32,16
}18
#[derive(Debug, Clone, FromRow)]19
pub struct Station {20
pub id: i32,21
pub uuid: String,22
pub name: String,23
pub stream_url: String,24
pub votes: i32,25
pub favicon: Option<String>,26
pub homepage: Option<String>,27
pub tags: Vec<String>,28
pub country: Option<String>,29
pub languages: Vec<String>,30
pub state: Option<String>,31
}33
#[derive(Debug, FromRow)]34
pub struct Like {35
pub id: i32,36
pub account_id: i32,37
pub station_id: String,38
}40
// use rand::{distributions::Alphanumeric, Rng};42
// #[derive(Debug, Deserialize, Serialize, FromRow)]43
// pub struct Code {44
// pub code: String,45
// pub used: bool,46
// pub expired: bool,47
// }49
// impl Code {50
// pub fn new() -> Self {51
// let code = rand::thread_rng()52
// .sample_iter(&Alphanumeric)53
// .take(6)54
// .map(char::from)55
// .map(|c| c.to_uppercase().to_string())56
// .collect::<String>();57
// Self { code, used: false, expired: false }58
// }59
// }