From 632ca2783c754bf33493495d2926fafcdc8d0476 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sun, 7 Aug 2022 16:00:49 -0400 Subject: [PATCH] some changes --- .../wyattjmiller/home/recipefoliobackend/model/Recipe.java | 6 +++--- .../home/recipefoliobackend/utils/LoadDatabase.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/wyattjmiller/home/recipefoliobackend/model/Recipe.java b/src/main/java/com/wyattjmiller/home/recipefoliobackend/model/Recipe.java index f1bcab1..0e3e63e 100644 --- a/src/main/java/com/wyattjmiller/home/recipefoliobackend/model/Recipe.java +++ b/src/main/java/com/wyattjmiller/home/recipefoliobackend/model/Recipe.java @@ -13,18 +13,18 @@ public class Recipe { private String Name; private String Description; private String Ingredients; - private LocalDateTime CreatedTimestamp; + private LocalDateTime CreatedTimestamp = LocalDateTime.now(); // constructors public Recipe() { } - public Recipe(String name, String description, String ingredients, LocalDateTime createdTimestamp) { + public Recipe(String name, String description, String ingredients) { this.Name = name; this.Description = description; this.Ingredients = ingredients; - this.CreatedTimestamp = createdTimestamp; + this.CreatedTimestamp = LocalDateTime.now(); } // mehtods (fields) diff --git a/src/main/java/com/wyattjmiller/home/recipefoliobackend/utils/LoadDatabase.java b/src/main/java/com/wyattjmiller/home/recipefoliobackend/utils/LoadDatabase.java index 095dfdb..b5d95b9 100644 --- a/src/main/java/com/wyattjmiller/home/recipefoliobackend/utils/LoadDatabase.java +++ b/src/main/java/com/wyattjmiller/home/recipefoliobackend/utils/LoadDatabase.java @@ -18,7 +18,7 @@ class LoadDatabase { @Bean CommandLineRunner initDatabase(RecipeRepository repository) { return args -> { - log.info("Preloading " + repository.save(new Recipe("Peanut Butter and Jelly Sandwhich", "The defacto sandwhich", "Peanut Butter, Jelly, and bread", LocalDateTime.now()))); + log.info("Preloading " + repository.save(new Recipe("Peanut Butter and Jelly Sandwhich", "The defacto sandwhich", "Peanut Butter, Jelly, and bread"))); }; } }