diff options
| author | transtrike <transtrike@gmail.com> | 2020-12-14 23:29:14 +0200 |
|---|---|---|
| committer | transtrike <transtrike@gmail.com> | 2020-12-14 23:29:14 +0200 |
| commit | dee2e37a4a8759108390c664e06bf147b8385cbf (patch) | |
| tree | bd65fe5649731a55aa6f1d8b48d53d89032fb8be /src/DevHive.Web/Controllers | |
| parent | 1ccdefdac025b1b986ad2bd0bc3eda7505d6e7c3 (diff) | |
| download | DevHive-dee2e37a4a8759108390c664e06bf147b8385cbf.tar DevHive-dee2e37a4a8759108390c664e06bf147b8385cbf.tar.gz DevHive-dee2e37a4a8759108390c664e06bf147b8385cbf.zip | |
Stabalized project for compilation. Next step after init architecture
Diffstat (limited to 'src/DevHive.Web/Controllers')
| -rw-r--r-- | src/DevHive.Web/Controllers/ErrorController.cs | 20 | ||||
| -rw-r--r-- | src/DevHive.Web/Controllers/RoleController.cs | 34 | ||||
| -rw-r--r-- | src/DevHive.Web/Controllers/UserController.cs | 66 |
3 files changed, 120 insertions, 0 deletions
diff --git a/src/DevHive.Web/Controllers/ErrorController.cs b/src/DevHive.Web/Controllers/ErrorController.cs new file mode 100644 index 0000000..560b0da --- /dev/null +++ b/src/DevHive.Web/Controllers/ErrorController.cs @@ -0,0 +1,20 @@ +using System; +using System.Net; +using System.Net.Http; +using Microsoft.AspNetCore.Mvc; + +namespace DevHive.Web.Controllers +{ + [ApiController] + [Route("/api/[controller]")] + public class ErrorController + { + [HttpGet] + public HttpStatusCode HttpError(HttpRequestException exception) + { + Console.WriteLine("WE HERE, BOIIIIIII"); + + return HttpStatusCode.OK; + } + } +} diff --git a/src/DevHive.Web/Controllers/RoleController.cs b/src/DevHive.Web/Controllers/RoleController.cs new file mode 100644 index 0000000..fda8bb2 --- /dev/null +++ b/src/DevHive.Web/Controllers/RoleController.cs @@ -0,0 +1,34 @@ +using System; +using System.Threading.Tasks; +using DevHive.Data.Repositories; +using DevHive.Services.Services; +using Microsoft.AspNetCore.Mvc; + +namespace DevHive.Web.Controllers +{ + [ApiController] + [Route("/api/[controller]")] + public class RoleController + { + private readonly RoleService _service; + + public RoleController(DevHiveContext context) + { + //this._service = new RoleService(context); + } + + [HttpPost] + public Task<IActionResult> Create(string name) + { + //return this._service.CreatePost(name); + throw new NotImplementedException(); + } + + [HttpGet] + public Task<IActionResult> ShowPost(uint postId) + { + //return this._service.GetPostById(postId); + throw new NotImplementedException(); + } + } +} diff --git a/src/DevHive.Web/Controllers/UserController.cs b/src/DevHive.Web/Controllers/UserController.cs new file mode 100644 index 0000000..84231d1 --- /dev/null +++ b/src/DevHive.Web/Controllers/UserController.cs @@ -0,0 +1,66 @@ +using System; +using System.Threading.Tasks; +using AutoMapper; +using DevHive.Data.Repositories; +using DevHive.Services.Models.Identity; +using DevHive.Services.Options; +using DevHive.Services.Services; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; + +namespace DevHive.Web.Controllers +{ + [ApiController] + [Route("/api/[controller]")] + public class UserController: ControllerBase + { + private readonly UserService _service; + + public UserController(DevHiveContext context, IMapper mapper, JWTOptions jwtOptions) + { + //this._service = new UserService(context, mapper, jwtOptions); + } + + [HttpPost] + [Route("Login")] + public async Task<IActionResult> Login([FromBody] LoginServiceModel loginServiceModel) + { + //return await this._service.LoginUser(loginDTO); + throw new NotImplementedException(); + } + + [HttpPost] + [Route("Register")] + public async Task<IActionResult> Register([FromBody] RegisterServiceModel registerServiceModel) + { + //return await this._service.RegisterUser(registerDto); + throw new NotImplementedException(); + } + + //Read + [HttpGet] + public async Task<IActionResult> GetById(Guid id) + { + //return await this._service.GetUserById(id); + throw new NotImplementedException(); + } + + //Update + [HttpPut] + [Authorize] + public async Task<IActionResult> Update(Guid id, [FromBody] UpdateUserServiceModel updateUserServiceModel) + { + //return await this._service.UpdateUser(id, userDTO); + throw new NotImplementedException(); + } + + //Delete + [HttpDelete] + [Authorize] + public async Task<IActionResult> Delete(Guid id) + { + //return await this._service.DeleteUser(id); + throw new NotImplementedException(); + } + } +} |
