fix: change price and sold price to f32s
This commit is contained in:
parent
5dbbe23103
commit
7c7bda5f94
2 changed files with 6 additions and 6 deletions
|
|
@ -1,14 +1,14 @@
|
||||||
use sea_orm::entity::prelude::*;
|
use sea_orm::entity::prelude::*;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize, utoipa::ToSchema)]
|
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize, utoipa::ToSchema)]
|
||||||
#[sea_orm(table_name = "BookInstances")]
|
#[sea_orm(table_name = "BookInstances")]
|
||||||
#[schema(title="BookInstance", as=entities::BookInstance)]
|
#[schema(title="BookInstance", as=entities::BookInstance)]
|
||||||
pub struct Model {
|
pub struct Model {
|
||||||
#[sea_orm(primary_key, auto_increment = true)]
|
#[sea_orm(primary_key, auto_increment = true)]
|
||||||
pub id: u32,
|
pub id: u32,
|
||||||
pub price: i32,
|
pub price: f32,
|
||||||
pub sold_price: Option<i32>,
|
pub sold_price: Option<f32>,
|
||||||
pub status: BookStatus,
|
pub status: BookStatus,
|
||||||
pub book_id: u32,
|
pub book_id: u32,
|
||||||
pub owner_id: u32,
|
pub owner_id: u32,
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ pub struct BookInstanceCreateParams {
|
||||||
book_id: u32,
|
book_id: u32,
|
||||||
owner_id: u32,
|
owner_id: u32,
|
||||||
bal_id: u32,
|
bal_id: u32,
|
||||||
price: i32,
|
price: f32,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[axum::debug_handler]
|
#[axum::debug_handler]
|
||||||
|
|
@ -99,7 +99,7 @@ pub async fn create_book_instance(
|
||||||
pub struct BookInstanceUpdateParams {
|
pub struct BookInstanceUpdateParams {
|
||||||
status: Option<book_instance::BookStatus>,
|
status: Option<book_instance::BookStatus>,
|
||||||
owner_id: Option<u32>,
|
owner_id: Option<u32>,
|
||||||
price: Option<i32>,
|
price: Option<f32>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[axum::debug_handler]
|
#[axum::debug_handler]
|
||||||
|
|
@ -160,7 +160,7 @@ pub async fn update_book_instance(
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize, utoipa::ToSchema)]
|
#[derive(Deserialize, Serialize, utoipa::ToSchema)]
|
||||||
pub struct BookInstanceSaleParams {
|
pub struct BookInstanceSaleParams {
|
||||||
price: i32,
|
price: f32,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[axum::debug_handler]
|
#[axum::debug_handler]
|
||||||
|
|
|
||||||
Reference in a new issue