summaryrefslogtreecommitdiffstats
path: root/src/models/model.rs
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2022-09-21 13:54:25 +0000
committerSanto Cariotti <santo@dcariotti.me>2022-09-21 13:54:25 +0000
commita3275b45ef2db23b10d8f430ec17886d89768389 (patch)
tree799a8f671c355c39417358b9d73c58510911c146 /src/models/model.rs
parent5d21d188f82774a814b8ace48cd833958b92a176 (diff)
Change field type for models
Diffstat (limited to 'src/models/model.rs')
-rw-r--r--src/models/model.rs24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/models/model.rs b/src/models/model.rs
index 071f515..03f872e 100644
--- a/src/models/model.rs
+++ b/src/models/model.rs
@@ -14,9 +14,9 @@ pub struct Model {
#[validate(length(min = 2, message = "Can not be empty"))]
name: String,
description: Option<String>,
- duration: i32,
- height: i32,
- weight: i32,
+ duration: f64,
+ height: f64,
+ weight: f64,
printer: Option<String>,
material: Option<String>,
author_id: i32,
@@ -29,9 +29,9 @@ pub struct Model {
pub struct ModelCreate {
pub name: String,
pub description: Option<String>,
- pub duration: i32,
- pub height: i32,
- pub weight: i32,
+ pub duration: f64,
+ pub height: f64,
+ pub weight: f64,
pub printer: Option<String>,
pub material: Option<String>,
}
@@ -41,9 +41,9 @@ pub struct ModelUser {
pub id: i32,
name: String,
description: Option<String>,
- duration: i32,
- height: i32,
- weight: i32,
+ duration: f64,
+ height: f64,
+ weight: f64,
printer: Option<String>,
material: Option<String>,
author_id: i32,
@@ -66,9 +66,9 @@ impl Model {
pub fn new(
name: String,
description: Option<String>,
- duration: i32,
- height: i32,
- weight: i32,
+ duration: f64,
+ height: f64,
+ weight: f64,
printer: Option<String>,
material: Option<String>,
author_id: i32,