more modular + registration done
This commit is contained in:
parent
4e2318b852
commit
f3908219cd
11 changed files with 239 additions and 66 deletions
|
@ -1,6 +1,6 @@
|
|||
use diesel::prelude::*;
|
||||
use serde::{Serialize, Deserialize};
|
||||
use super::schema::accounts;
|
||||
use super::schema::*;
|
||||
|
||||
#[derive(Queryable, Serialize)]
|
||||
pub struct Account {
|
||||
|
@ -30,4 +30,55 @@ pub struct NewAccount {
|
|||
pub username: String,
|
||||
pub gjp2: String,
|
||||
pub email: String
|
||||
}
|
||||
|
||||
#[derive(Queryable, Serialize)]
|
||||
pub struct User {
|
||||
pub id: i32,
|
||||
|
||||
pub udid: Option<String>,
|
||||
pub account_id: Option<i32>,
|
||||
pub registered: i32,
|
||||
|
||||
pub username: String,
|
||||
|
||||
pub stars: i32,
|
||||
pub demons: i32,
|
||||
pub coins: i32,
|
||||
pub user_coins: i32,
|
||||
pub diamonds: i32,
|
||||
pub orbs: i32,
|
||||
pub creator_points: i32,
|
||||
|
||||
pub completed_levels: i32,
|
||||
|
||||
pub icon_type: i32,
|
||||
pub color1: i32,
|
||||
pub color2: i32,
|
||||
pub cube: i32,
|
||||
pub ship: i32,
|
||||
pub ball: i32,
|
||||
pub ufo: i32,
|
||||
pub wave: i32,
|
||||
pub robot: i32,
|
||||
pub spider: i32,
|
||||
pub swing_copter: i32,
|
||||
pub explosion: i32,
|
||||
pub special: i32,
|
||||
pub glow: i32,
|
||||
|
||||
pub created_at: String,
|
||||
pub last_played: String,
|
||||
|
||||
pub is_banned: i32,
|
||||
pub is_banned_upload: i32
|
||||
}
|
||||
|
||||
// TODO: err uhh we might need to make changes because green users 😀😀😀 im gonna commit suicide
|
||||
#[derive(Insertable, Deserialize)]
|
||||
#[diesel(table_name = users)]
|
||||
pub struct NewUser {
|
||||
pub account_id: i32,
|
||||
pub username: String,
|
||||
pub registered: i32
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue