Updated user scheme
Forgot password and username
This commit is contained in:
@@ -33,6 +33,7 @@ pub struct User {
|
|||||||
pub first_name: String,
|
pub first_name: String,
|
||||||
pub last_name: String,
|
pub last_name: String,
|
||||||
pub is_admin: bool,
|
pub is_admin: bool,
|
||||||
|
pub pwd: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize, Debug)]
|
#[derive(Deserialize, Serialize, Debug)]
|
||||||
@@ -47,3 +48,25 @@ pub struct TicketCreateScheme {
|
|||||||
pub struct TicketUpdateScheme {
|
pub struct TicketUpdateScheme {
|
||||||
pub status: String,
|
pub status: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Deserialize, Serialize, Debug)]
|
||||||
|
pub struct UserCreateScheme {
|
||||||
|
pub first_name: String,
|
||||||
|
pub last_name: String,
|
||||||
|
pub username: String,
|
||||||
|
pub is_admin: bool,
|
||||||
|
pub pwd: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Deserialize, Serialize, Debug)]
|
||||||
|
pub struct LoginScheme {
|
||||||
|
pub username: String,
|
||||||
|
pub pwd: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
pub struct Claims {
|
||||||
|
pub subject: String,
|
||||||
|
pub issued: usize,
|
||||||
|
pub expires: usize,
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,5 +2,7 @@ CREATE TABLE users (
|
|||||||
id SMALLINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
id SMALLINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
||||||
name VARCHAR(30),
|
name VARCHAR(30),
|
||||||
firstname VARCHAR(30),
|
firstname VARCHAR(30),
|
||||||
|
username VARCHAR(30),
|
||||||
|
passwd TEXT,
|
||||||
is_admin BOOLEAN NOT NULL DEFAULT false
|
is_admin BOOLEAN NOT NULL DEFAULT false
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user