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