summaryrefslogtreecommitdiff
path: root/dichroism/src/entities
diff options
context:
space:
mode:
authorAdam T. Carpenter <atc@53hor.net>2020-10-22 17:44:38 -0400
committerAdam T. Carpenter <atc@53hor.net>2020-10-22 17:44:38 -0400
commit99dabd3f2f81ffcf0b6f2b59e13ebb4502b2ccac (patch)
tree15e19324332173405fc7544af2c17195d7b05ff1 /dichroism/src/entities
parent76a782599b4ecc4ecb9b0ce7acc6420ed9e1ec8e (diff)
downloadtheglassyladies-99dabd3f2f81ffcf0b6f2b59e13ebb4502b2ccac.tar.xz
theglassyladies-99dabd3f2f81ffcf0b6f2b59e13ebb4502b2ccac.zip
Added product migration, better organization of DTOs, Entities, and
Domain Models. Also made config loading/photo generation easier.
Diffstat (limited to 'dichroism/src/entities')
-rw-r--r--dichroism/src/entities/mod.rs7
-rw-r--r--dichroism/src/entities/photo.rs5
-rw-r--r--dichroism/src/entities/photo_set.rs8
-rw-r--r--dichroism/src/entities/product.rs11
4 files changed, 31 insertions, 0 deletions
diff --git a/dichroism/src/entities/mod.rs b/dichroism/src/entities/mod.rs
new file mode 100644
index 0000000..0b17cf7
--- /dev/null
+++ b/dichroism/src/entities/mod.rs
@@ -0,0 +1,7 @@
+mod photo;
+mod photo_set;
+mod product;
+
+pub use photo::Photo;
+pub use photo_set::PhotoSet;
+pub use product::Product;
diff --git a/dichroism/src/entities/photo.rs b/dichroism/src/entities/photo.rs
new file mode 100644
index 0000000..34e9c28
--- /dev/null
+++ b/dichroism/src/entities/photo.rs
@@ -0,0 +1,5 @@
+#[derive(Debug, Clone, Serialize)]
+pub struct Photo {
+ pub id: i32,
+ pub path: String,
+}
diff --git a/dichroism/src/entities/photo_set.rs b/dichroism/src/entities/photo_set.rs
new file mode 100644
index 0000000..b9f7710
--- /dev/null
+++ b/dichroism/src/entities/photo_set.rs
@@ -0,0 +1,8 @@
+#[derive(Debug, Clone, Serialize)]
+pub struct PhotoSet {
+ pub id: i32,
+ pub base: i32,
+ pub fullsize: i32,
+ pub thumbnail: i32,
+ pub original: i32,
+}
diff --git a/dichroism/src/entities/product.rs b/dichroism/src/entities/product.rs
new file mode 100644
index 0000000..4f47c1d
--- /dev/null
+++ b/dichroism/src/entities/product.rs
@@ -0,0 +1,11 @@
+#[derive(Debug, Clone, Queryable, Serialize)]
+pub struct Product {
+ pub id: i32,
+ pub photo_set: i32,
+ pub cents: i32,
+ pub quantity: i32,
+ pub name: String,
+ pub description: String,
+ pub featured: i32,
+}
+