summaryrefslogtreecommitdiff
path: root/backend/recipe.go
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-11-09 19:15:53 -0500
committerTucker Evans <tuckerevans24@gmail.com>2019-11-09 19:16:20 -0500
commit57157a64c7f934faea9dab4317a8d80ea58728a4 (patch)
tree22ad9de886926ef34183be42261996fc31c793cb /backend/recipe.go
parent8e1eb58d54e89b39828f973ece36a05dc39c10b3 (diff)
Add Recipe Type (w/ subtypes Ingredients & Steps)
Diffstat (limited to 'backend/recipe.go')
-rw-r--r--backend/recipe.go45
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
+
+}
+