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