diff options
Diffstat (limited to 'API/Controllers')
| -rw-r--r-- | API/Controllers/UserController.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/API/Controllers/UserController.cs b/API/Controllers/UserController.cs new file mode 100644 index 0000000..d9b55db --- /dev/null +++ b/API/Controllers/UserController.cs @@ -0,0 +1,41 @@ +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +using API.Database; +using API.Service; +using Microsoft.AspNetCore.Mvc; +using Models.Classes; +using Models.DTOs; + +namespace API.Controllers +{ + [ApiController] + [Route("/api/[controller]")] + public class UserController: ControllerBase + { + private readonly UserService _service; + + public UserController(DevHiveContext context) + { + this._service = new UserService(context); + } + + //Create + [HttpPost] + public async Task<HttpStatusCode> Create([FromForm] UserDTO userDTO) + { + HttpStatusCode returnStatusCode = await this._service.CreateUser(userDTO); + + return returnStatusCode; + } + + //Read + // [HttpGet] + + // //Update + // [HttpPut] + + // //Delete + // [HttpDelete] + } +}
\ No newline at end of file |
