diff options
Diffstat (limited to 'backend')
-rw-r--r-- | backend/recipe.go | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/backend/recipe.go b/backend/recipe.go new file mode 100644 index 0000000..4fb8816 --- /dev/null +++ b/backend/recipe.go @@ -0,0 +1,45 @@ +package main + +type Ingredient struct { + Name string + Amount float64 + Unit string +} + +type Step struct { + Num int + Desc string + Time int +} + +type Recipe struct { + Id int + Title string + Desc string + Photos []string + Serving_size int + Cook_time int + Rating int + Keywords []string + Ingredients []Ingredient + Steps []Step +} + +func MakeRecipe() *Recipe { + var r Recipe + + r = Recipe{ + Id: 0, + Title: "", + Desc: "", + Serving_size: 0, + Cook_time: 0, + Rating: 5, + Keywords: make([]string, 0), + Ingredients: make([]Ingredient, 0), + Steps: make([]Step, 0)} + + return &r + +} + |