From 1f1ec5f961432198f41848a2096e9b143a734a55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=9F=D0=BE=D0=BB?= =?UTF-8?q?=D0=B5=D0=B2=D0=BE=D0=B9?= Date: Sun, 14 May 2023 23:17:14 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=B0=20=D1=87=D1=82=D0=BE=20=D0=BD?= =?UTF-8?q?=D0=B5=20=D1=82=D0=B0=D0=BA=20=D1=81=20=D1=8D=D1=82=D0=B8=D0=BC?= =?UTF-8?q?=20=D0=B1=D1=8D=D0=BA=D0=B5=D0=BD=D0=B4=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +++ backend/src/models/car_station.rs | 12 ++++++++++++ backend/src/models/client.rs | 18 ++++++++++++++++++ backend/src/storages/mod.rs | 2 ++ 4 files changed, 35 insertions(+) create mode 100644 backend/src/models/car_station.rs create mode 100644 backend/src/models/client.rs create mode 100644 backend/src/storages/mod.rs diff --git a/.gitignore b/.gitignore index 902a5d5..630be45 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,9 @@ frontend/target/ frontend/.env frontend/dist +backend/.env +backend/target + # These are backup files generated by rustfmt **/*.rs.bk diff --git a/backend/src/models/car_station.rs b/backend/src/models/car_station.rs new file mode 100644 index 0000000..1e208a2 --- /dev/null +++ b/backend/src/models/car_station.rs @@ -0,0 +1,12 @@ +use serde::{Serialize, Deserialize}; + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CarStation { + pub id: i32, + pub address: String +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct BindingCarStation { + pub address: String +} \ No newline at end of file diff --git a/backend/src/models/client.rs b/backend/src/models/client.rs new file mode 100644 index 0000000..0e0f7a7 --- /dev/null +++ b/backend/src/models/client.rs @@ -0,0 +1,18 @@ +use serde::{Serialize, Deserialize}; + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct Client { + pub id: i32, + pub name: String, + pub surname: String, + pub middlename: Option, + pub phone: String +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct BindingClient { + pub name: String, + pub surname: String, + pub middlename: Option, + pub phone: String +} \ No newline at end of file diff --git a/backend/src/storages/mod.rs b/backend/src/storages/mod.rs new file mode 100644 index 0000000..4acaacf --- /dev/null +++ b/backend/src/storages/mod.rs @@ -0,0 +1,2 @@ +pub mod traits; +pub mod postgres; \ No newline at end of file