Organize workspace: Frontend, Backend, and Tests in one repo
This commit is contained in:
1
.vscode-server/data/User/History/2b7be92a/entries.json
Normal file
1
.vscode-server/data/User/History/2b7be92a/entries.json
Normal file
@@ -0,0 +1 @@
|
||||
{"version":1,"resource":"vscode-remote://ssh-remote%2B10.0.11.3/home/chloe/Seasoned.Backend/Controllers/RecipeController.cs","entries":[{"id":"vcso.cs","timestamp":1772653722495},{"id":"gfRM.cs","timestamp":1772658067690}]}
|
||||
30
.vscode-server/data/User/History/2b7be92a/gfRM.cs
Normal file
30
.vscode-server/data/User/History/2b7be92a/gfRM.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Seasoned.Backend.Services;
|
||||
using Seasoned.Backend.DTOs;
|
||||
|
||||
namespace Seasoned.Backend.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class RecipeController : ControllerBase
|
||||
{
|
||||
private readonly IRecipeService _recipeService;
|
||||
|
||||
// Dependency Injection: The service is "injected" here
|
||||
public RecipeController(IRecipeService recipeService)
|
||||
{
|
||||
_recipeService = recipeService;
|
||||
}
|
||||
|
||||
[HttpPost("upload")]
|
||||
public async Task<ActionResult<RecipeResponseDto>> UploadRecipe([FromForm] IFormFile image)
|
||||
{
|
||||
if (image == null || image.Length == 0)
|
||||
{
|
||||
return BadRequest("No image uploaded.");
|
||||
}
|
||||
|
||||
var result = await _recipeService.ParseRecipeImageAsync(image);
|
||||
return Ok(result);
|
||||
}
|
||||
}
|
||||
30
.vscode-server/data/User/History/2b7be92a/vcso.cs
Normal file
30
.vscode-server/data/User/History/2b7be92a/vcso.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Seasoned.Backend.Services;
|
||||
using Seasoned.Backend.DTOs;
|
||||
|
||||
namespace Seasoned.Backend.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class RecipeController : ControllerBase
|
||||
{
|
||||
private readonly IRecipeService _recipeService;
|
||||
|
||||
// Dependency Injection: The service is "injected" here
|
||||
public RecipeController(IRecipeService recipeService)
|
||||
{
|
||||
_recipeService = recipeService;
|
||||
}
|
||||
|
||||
[HttpPost("upload")]
|
||||
public async Task<ActionResult<RecipeResponseDto>> UploadRecipe(IFormFile image)
|
||||
{
|
||||
if (image == null || image.Length == 0)
|
||||
{
|
||||
return BadRequest("No image uploaded.");
|
||||
}
|
||||
|
||||
var result = await _recipeService.ParseRecipeImageAsync(image);
|
||||
return Ok(result);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user