Primera subida
This commit is contained in:
48
back/Controllers/DireccionController.cs
Normal file
48
back/Controllers/DireccionController.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using back.Application.Services;
|
||||
using back.Entities.DTOs.Request;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace back.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class DireccionController : ControllerBase
|
||||
{
|
||||
private readonly DireccionService service;
|
||||
|
||||
public DireccionController(DireccionService service)
|
||||
{
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
[HttpGet("GetOne/{id}")]
|
||||
public async Task<IActionResult> GetOne(int id)
|
||||
{
|
||||
return Ok(await service.GetOne(id));
|
||||
}
|
||||
|
||||
[HttpGet("GetAll")]
|
||||
public async Task<IActionResult> GetAll()
|
||||
{
|
||||
return Ok(await service.GetAll());
|
||||
}
|
||||
|
||||
//[HttpPost("Create")]
|
||||
//public async Task<IActionResult> Create(DireccionRequestDto dto)
|
||||
//{
|
||||
// return Ok(await service.Add(dto));
|
||||
//}
|
||||
|
||||
[HttpPut("Update")]
|
||||
public async Task<IActionResult> Update(DireccionUpdateRequestDto dto)
|
||||
{
|
||||
return Ok(await service.Update(dto));
|
||||
}
|
||||
|
||||
//[HttpDelete("Delete/{id}")]
|
||||
//public async Task<IActionResult> Delete(int id)
|
||||
//{
|
||||
// return Ok(service.Delete(id));
|
||||
//}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user