some changes

This commit is contained in:
Wyatt J. Miller 2022-08-07 16:00:49 -04:00
parent 08b7192527
commit 632ca2783c
2 changed files with 4 additions and 4 deletions

View File

@ -13,18 +13,18 @@ public class Recipe {
private String Name; private String Name;
private String Description; private String Description;
private String Ingredients; private String Ingredients;
private LocalDateTime CreatedTimestamp; private LocalDateTime CreatedTimestamp = LocalDateTime.now();
// constructors // constructors
public Recipe() { public Recipe() {
} }
public Recipe(String name, String description, String ingredients, LocalDateTime createdTimestamp) { public Recipe(String name, String description, String ingredients) {
this.Name = name; this.Name = name;
this.Description = description; this.Description = description;
this.Ingredients = ingredients; this.Ingredients = ingredients;
this.CreatedTimestamp = createdTimestamp; this.CreatedTimestamp = LocalDateTime.now();
} }
// mehtods (fields) // mehtods (fields)

View File

@ -18,7 +18,7 @@ class LoadDatabase {
@Bean @Bean
CommandLineRunner initDatabase(RecipeRepository repository) { CommandLineRunner initDatabase(RecipeRepository repository) {
return args -> { 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")));
}; };
} }
} }