From a3275b45ef2db23b10d8f430ec17886d89768389 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Wed, 21 Sep 2022 15:54:25 +0200 Subject: Change field type for models --- src/models/model.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/models/model.rs') 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, - duration: i32, - height: i32, - weight: i32, + duration: f64, + height: f64, + weight: f64, printer: Option, material: Option, author_id: i32, @@ -29,9 +29,9 @@ pub struct Model { pub struct ModelCreate { pub name: String, pub description: Option, - pub duration: i32, - pub height: i32, - pub weight: i32, + pub duration: f64, + pub height: f64, + pub weight: f64, pub printer: Option, pub material: Option, } @@ -41,9 +41,9 @@ pub struct ModelUser { pub id: i32, name: String, description: Option, - duration: i32, - height: i32, - weight: i32, + duration: f64, + height: f64, + weight: f64, printer: Option, material: Option, author_id: i32, @@ -66,9 +66,9 @@ impl Model { pub fn new( name: String, description: Option, - duration: i32, - height: i32, - weight: i32, + duration: f64, + height: f64, + weight: f64, printer: Option, material: Option, author_id: i32, -- cgit v1.2.3-71-g8e6c