Start rust rewrite
This commit is contained in:
commit
12d57d020f
22 changed files with 2599 additions and 0 deletions
src/db
20
src/db/models.rs
Normal file
20
src/db/models.rs
Normal file
|
@ -0,0 +1,20 @@
|
|||
use super::types::EmgauwaUid;
|
||||
use serde::Serialize;
|
||||
|
||||
use super::schema::schedules;
|
||||
|
||||
#[derive(Serialize, Queryable)]
|
||||
pub struct Schedule {
|
||||
pub id: i32,
|
||||
pub uid: EmgauwaUid,
|
||||
pub name: String,
|
||||
pub periods: String,
|
||||
}
|
||||
|
||||
#[derive(Insertable)]
|
||||
#[table_name = "schedules"]
|
||||
pub struct NewSchedule<'a> {
|
||||
pub uid: &'a EmgauwaUid,
|
||||
pub name: &'a str,
|
||||
pub periods: &'a str,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue