You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
2.9 KiB
49 lines
2.9 KiB
using Endpoint;
|
|
using Models;
|
|
|
|
namespace LocalEndpoint
|
|
{
|
|
internal class RecipesService : IRecipesService
|
|
{
|
|
|
|
public List<RecipeInfo> PopularRecipes()
|
|
{
|
|
return new List<RecipeInfo> {
|
|
new RecipeInfo("Chicken Curry", 45, new Uri("https://cdn.chefclub.tools/uploads/recipes/cover-thumbnail/f287b191-dc8e-4c85-bbb6-e26387c354d3.jpg"), 3),
|
|
new RecipeInfo("Spaghetti Bolognese", 30, new Uri("https://media.istockphoto.com/id/1144823591/fr/photo/spaghetti-dans-un-plat-sur-un-fond-blanc.jpg?s=612x612&w=0&k=20&c=qFzd8iE185mpsX7hWqYaieOWlzJVCkzFdYsxmwUT3-Q="), 1),
|
|
new RecipeInfo("Beef Stroganoff", 10, new Uri("https://www.cookwithnabeela.com/wp-content/uploads/2023/02/BeefStroganoff.webp"), 5),
|
|
new RecipeInfo("Fish And Ships", 15, new Uri("https://upload.wikimedia.org/wikipedia/commons/f/ff/Fish_and_chips_blackpool.jpg"), 4),
|
|
new RecipeInfo("Caesar Salad", 20, new Uri("https://www.galbani.fr/wp-content/uploads/2020/04/AdobeStock_157570276-2.jpeg"), 1)
|
|
};
|
|
}
|
|
|
|
|
|
public List<RecipeInfo> RecommendedRecipes(Account account)
|
|
{
|
|
return new List<RecipeInfo> {
|
|
new RecipeInfo("Chicken Salad", 20, new Uri("https://healthyfitnessmeals.com/wp-content/uploads/2021/04/Southwest-chicken-salad-7-500x500.jpg"), 4),
|
|
new RecipeInfo("Chocolate Cake", 10, new Uri("https://bakewithshivesh.com/wp-content/uploads/2022/08/IMG_0248-scaled.jpg"), 3),
|
|
new RecipeInfo("Salmon", 10, new Uri("https://www.wholesomeyum.com/wp-content/uploads/2021/06/wholesomeyum-Pan-Seared-Salmon-Recipe-13.jpg"), 4),
|
|
new RecipeInfo("Fish", 30, new Uri("https://www.ciaanet.org/wp-content/uploads/2022/07/Atlantic-and-Pacific-whole-salmon-1024x683.jpg"), 4.5F),
|
|
new RecipeInfo("Space Cake", 5, new Uri("https://static.youmiam.com/images/recipe/1500x1000/space-cake-22706?placeholder=web_recipe&sig=f14a7a86da837c6b8cc678cde424d6d5902f99ec&v3"), 5)
|
|
};
|
|
}
|
|
|
|
public Recipe GetRecipe(RecipeInfo info)
|
|
{
|
|
User owner = new User(new Uri("https://i.ibb.co/L6t6bGR/DALL-E-2023-05-10-20-27-31-cook-looking-at-the-camera-with-a-chef-s-hat-laughing-in-an-exaggerated-w.png"), "The Funny Chief");
|
|
List<Ingredient> ingredients = new List<Ingredient> { new Ingredient("Banana", 12), new Ingredient("Apple", 2) };
|
|
List<PreparationStep> steps = new List<PreparationStep> { new PreparationStep("Step 1", "This step is an hardcoded step from a stub implementation of IRecipesSeervice") };
|
|
return new Recipe(info, owner, ingredients, steps);
|
|
}
|
|
|
|
public RecipeState RecipeStateOf(Account account, Recipe recipe)
|
|
{
|
|
Random random = new Random();
|
|
return new RecipeState((uint) random.Next(1, 10), random.Next() % 2 == 0, (uint)random.Next(0, 6), recipe);
|
|
}
|
|
|
|
|
|
}
|
|
}
|