Implementato controller mockup per le navette di Automha
This commit is contained in:
47
Integry Smart Warehouse/Core/Controller/ShuttleController.cs
Normal file
47
Integry Smart Warehouse/Core/Controller/ShuttleController.cs
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
using Integry_Smart_Warehouse.Core.WebHost.Controller;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Net.Mime;
|
||||||
|
|
||||||
|
namespace Integry_Smart_Warehouse.Core.Controller;
|
||||||
|
|
||||||
|
[Route("[controller]")]
|
||||||
|
[ApiController]
|
||||||
|
[Produces(MediaTypeNames.Application.Json)]
|
||||||
|
public class ShuttleController : IntegryControllerBase
|
||||||
|
{
|
||||||
|
[HttpGet]
|
||||||
|
[Route("Available")]
|
||||||
|
public async Task<IActionResult> RetrieveAvailableShuttles()
|
||||||
|
{
|
||||||
|
return Ok(new[]
|
||||||
|
{
|
||||||
|
new
|
||||||
|
{
|
||||||
|
ID = 1,
|
||||||
|
Nome = "Navetta 1"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
ID = 2,
|
||||||
|
Nome = "Navetta 2"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
[Route("{shuttleId}/Store")]
|
||||||
|
public async Task<IActionResult> Store(int shuttleId)
|
||||||
|
{
|
||||||
|
throw new Exception("Pippo");
|
||||||
|
return Ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
[Route("{shuttleId}/Retrieve")]
|
||||||
|
public async Task<IActionResult> Retrieve(int shuttleId)
|
||||||
|
{
|
||||||
|
return Ok();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,6 +11,8 @@ public class ISWWebHost
|
|||||||
|
|
||||||
app.UseHttpsRedirection();
|
app.UseHttpsRedirection();
|
||||||
|
|
||||||
|
app.UseResponseWrapper();
|
||||||
|
|
||||||
|
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
@@ -18,8 +20,6 @@ public class ISWWebHost
|
|||||||
{
|
{
|
||||||
endpoints.MapControllers();
|
endpoints.MapControllers();
|
||||||
});
|
});
|
||||||
|
|
||||||
app.UseResponseWrapper();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -13,8 +13,4 @@
|
|||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Core\Controller\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
Reference in New Issue
Block a user