|
|
|
@ -4,6 +4,7 @@ using Model;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using API_Mapping;
|
|
|
|
|
|
|
|
|
|
namespace API.Controllers
|
|
|
|
|
{
|
|
|
|
@ -18,34 +19,44 @@ namespace API.Controllers
|
|
|
|
|
this._form = iform;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpGet("/forms/{id}")]
|
|
|
|
|
public Task<IEnumerable<Formulaire?>> GetAllForm()
|
|
|
|
|
[HttpGet("/forms")]
|
|
|
|
|
public async Task<IActionResult> GetAllForm([FromQuery] int index = 0, [FromQuery] int count = 10, [FromQuery] FormOrderCriteria orderCriteria = FormOrderCriteria.None)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
var result = (await _form.GetAllForm(index, count, orderCriteria)).Select(f => f.ToDTO());
|
|
|
|
|
if (result == null)
|
|
|
|
|
{
|
|
|
|
|
return NotFound();
|
|
|
|
|
}
|
|
|
|
|
return Ok(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpGet("{id}")]
|
|
|
|
|
public Task<Formulaire?> GetById(long id)
|
|
|
|
|
public async Task<IActionResult> GetById(long id)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
var result = (await _form.GetById(id)).ToDTO();
|
|
|
|
|
if (result == null)
|
|
|
|
|
{
|
|
|
|
|
return NotFound();
|
|
|
|
|
}
|
|
|
|
|
return Ok(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public Task<Formulaire?> CreateForm(Formulaire formulaire)
|
|
|
|
|
public async Task<Formulaire?> CreateForm(Formulaire formulaire)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
return await _form.CreateForm(formulaire);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpDelete("{id}")]
|
|
|
|
|
public Task<bool> DeleteForm(long id)
|
|
|
|
|
public async Task<bool> DeleteForm(long id)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
return await _form.DeleteForm(id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpPut("{id}")]
|
|
|
|
|
public Task<bool> UpdateForm(long id, Formulaire formulaire)
|
|
|
|
|
public async Task<bool> UpdateForm(long id, Formulaire formulaire)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
return await _form.UpdateForm(id, formulaire);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|