|
@ -11,14 +11,22 @@ use diesel::backend::Backend; |
|
|
|
|
|
|
|
|
use libpso::character::settings;
|
|
|
use libpso::character::settings;
|
|
|
|
|
|
|
|
|
|
|
|
use elseware::schema::*;
|
|
|
|
|
|
|
|
|
|
|
|
//const ELSEWHERE_COST: u32 = bcrypt::DEFAULT_COST;
|
|
|
|
|
|
const ELSEWHERE_COST: u32 = 5;
|
|
|
|
|
|
|
|
|
#[derive(Debug, AsExpression, FromSqlRow)]
|
|
|
#[derive(Debug, AsExpression, FromSqlRow)]
|
|
|
#[sql_type="sql_types::Binary"]
|
|
|
#[sql_type="sql_types::Binary"]
|
|
|
pub struct EUserSettings(pub settings::UserSettings);
|
|
|
pub struct EUserSettings(pub settings::UserSettings);
|
|
|
|
|
|
|
|
|
//const ELSEWHERE_COST: u32 = bcrypt::DEFAULT_COST;
|
|
|
|
|
|
const ELSEWHERE_COST: u32 = 5;
|
|
|
|
|
|
|
|
|
impl std::ops::Deref for EUserSettings {
|
|
|
|
|
|
type Target = settings::UserSettings;
|
|
|
|
|
|
|
|
|
use elseware::schema::*;
|
|
|
|
|
|
|
|
|
fn deref(&self) -> &Self::Target {
|
|
|
|
|
|
&self.0
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
#[derive(Queryable, Identifiable, Debug)]
|
|
|
#[derive(Queryable, Identifiable, Debug)]
|
|
|
pub struct UserAccount {
|
|
|
pub struct UserAccount {
|
|
@ -53,8 +61,8 @@ impl NewUser { |
|
|
#[belongs_to(UserAccount, foreign_key="user_id")]
|
|
|
#[belongs_to(UserAccount, foreign_key="user_id")]
|
|
|
#[table_name="user_settings"]
|
|
|
#[table_name="user_settings"]
|
|
|
pub struct UserSettings {
|
|
|
pub struct UserSettings {
|
|
|
id: i32,
|
|
|
|
|
|
user_id: i32,
|
|
|
|
|
|
|
|
|
pub id: i32,
|
|
|
|
|
|
pub user_id: i32,
|
|
|
//settings: Vec<u8>,
|
|
|
//settings: Vec<u8>,
|
|
|
pub settings: EUserSettings,
|
|
|
pub settings: EUserSettings,
|
|
|
}
|
|
|
}
|
|
|