22 lines
523 B
Rust
22 lines
523 B
Rust
use serde::{Serialize, Deserialize};
|
|
|
|
use chrono::NaiveDateTime;
|
|
use diesel::prelude::*;
|
|
|
|
#[derive(Queryable, Serialize, Deserialize, Debug)]
|
|
pub struct User {
|
|
pub id: i32,
|
|
pub username: String,
|
|
pub password: String,
|
|
pub power_level: i16,
|
|
pub is_owner: bool,
|
|
pub created_at: NaiveDateTime,
|
|
pub updated_at: Option<NaiveDateTime>
|
|
}
|
|
|
|
#[derive(Insertable, Serialize, Deserialize)]
|
|
#[diesel(table_name = crate::schema::users)]
|
|
pub struct NewUser {
|
|
pub username: String,
|
|
pub password: String
|
|
} |