Added database connection
Code now connects to database and prints out errors. Also the ticket table now includes a timestamp field
This commit is contained in:
30
backend/src/models.rs
Normal file
30
backend/src/models.rs
Normal file
@@ -0,0 +1,30 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Deserialize)]
|
||||
pub enum category {
|
||||
WhiteboardBeamer,
|
||||
Internet,
|
||||
IPadKoffer,
|
||||
AppleTV,
|
||||
DocuCam,
|
||||
Sonstiges,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Clone, PartialEq, Debug)]
|
||||
pub struct ticket {
|
||||
pub id: i32,
|
||||
pub category: category,
|
||||
pub betreff: String,
|
||||
pub description: String,
|
||||
pub room: i16,
|
||||
pub date: chrono::NaiveDateTime,
|
||||
pub user_id: i16,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Clone, PartialEq, Debug)]
|
||||
pub struct user {
|
||||
pub id: i16,
|
||||
pub first_name: String,
|
||||
pub last_name: String,
|
||||
pub is_admin: bool,
|
||||
}
|
||||
Reference in New Issue
Block a user