Service for editing/creating recipe
Other stuff...
This commit is contained in:
parent
adcf4a5a5d
commit
cc2e5b6893
15 changed files with 323 additions and 146 deletions
|
|
@ -1,14 +1,94 @@
|
|||
use ron::de::from_reader;
|
||||
use serde::Deserialize;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Deserialize, Clone)]
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct SetRecipeTitle {
|
||||
pub recipe_id: i64,
|
||||
pub title: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Clone)]
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct SetRecipeDescription {
|
||||
pub recipe_id: i64,
|
||||
pub description: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct AddRecipeImage {
|
||||
pub recipe_id: i64,
|
||||
pub image: Vec<u8>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct AddRecipeImageReply {
|
||||
pub image_id: i64,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct RemoveRecipeImage {
|
||||
pub image_id: i64,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct AddRecipeIngredient {
|
||||
pub group_id: i64,
|
||||
pub name: String,
|
||||
pub quantity_value: Option<f64>,
|
||||
pub quantity_unit: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct AddRecipeIngredientReply {
|
||||
pub ingredient_id: i64,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct RemoveRecipeIngredient {
|
||||
pub group_id: i64,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct SetRecipeIngredientsOrder {
|
||||
pub group_id: i64,
|
||||
pub ingredient_ids: Vec<i64>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct AddRecipeGroup {
|
||||
pub recipe_id: i64,
|
||||
pub name: String,
|
||||
pub quantity_value: Option<f64>,
|
||||
pub quantity_unit: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct AddRecipeGroupReply {
|
||||
pub group_id: i64,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct RemoveRecipeGroupReply {
|
||||
pub group_id: i64,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct SetRecipeGroupsOrder {
|
||||
pub recipe_id: i64,
|
||||
pub group_ids: Vec<i64>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct AddRecipeStep {
|
||||
pub group_id: i64,
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct AddRecipeStepReply {
|
||||
pub step_id: i64,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct RemoveRecipeStep {
|
||||
pub step_id: i64,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue