aboutsummaryrefslogtreecommitdiff
path: root/src/Web/DevHive.Web/Controllers/ProfilePictureController.cs
diff options
context:
space:
mode:
authorSyndamia <kamen.d.mladenov@protonmail.com>2021-03-13 15:07:51 +0200
committerSyndamia <kamen.d.mladenov@protonmail.com>2021-03-13 15:07:51 +0200
commit75d57f305f2ed1ecf8b82bd62d4bb8f17c06303b (patch)
treeb721fe307d22a7a89f8ee13b3e557df4a2e2bbab /src/Web/DevHive.Web/Controllers/ProfilePictureController.cs
parent503a23c04355624b133161c9356b139f2e4500f6 (diff)
parent4add0831649f6e534d3883aa0e0e7f380d8042c7 (diff)
downloadDevHive-75d57f305f2ed1ecf8b82bd62d4bb8f17c06303b.tar
DevHive-75d57f305f2ed1ecf8b82bd62d4bb8f17c06303b.tar.gz
DevHive-75d57f305f2ed1ecf8b82bd62d4bb8f17c06303b.zip
Merge branch 'dev' of github.com:Team-Kaleidoscope/DevHive into unit_test_refactoring
Diffstat (limited to 'src/Web/DevHive.Web/Controllers/ProfilePictureController.cs')
-rw-r--r--src/Web/DevHive.Web/Controllers/ProfilePictureController.cs48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/Web/DevHive.Web/Controllers/ProfilePictureController.cs b/src/Web/DevHive.Web/Controllers/ProfilePictureController.cs
new file mode 100644
index 0000000..2eec99e
--- /dev/null
+++ b/src/Web/DevHive.Web/Controllers/ProfilePictureController.cs
@@ -0,0 +1,48 @@
+using System;
+using System.Threading.Tasks;
+using DevHive.Web.Models.User;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+
+namespace DevHive.Web.Controllers
+{
+ /// <summary>
+ /// All endpoints for interacting with the profile picture layer
+ /// </summary>
+ [ApiController]
+ [Route("api/[controller]")]
+ public class ProfilePictureController
+ {
+ // private readonly ProfilePictureService _profilePictureService;
+
+ // public ProfilePictureController(ProfilePictureService profilePictureService)
+ // {
+ // this._profilePictureService = profilePictureService;
+ // }
+
+ /// <summary>
+ /// Alter the profile picture of a user
+ /// </summary>
+ /// <param name="userId">The user's Id</param>
+ /// <param name="updateProfilePictureWebModel">The new profile picture</param>
+ /// <param name="authorization">JWT Bearer Token</param>
+ /// <returns>???</returns>
+ [HttpPut]
+ [Route("ProfilePicture")]
+ [Authorize(Roles = "User,Admin")]
+ public async Task<IActionResult> UpdateProfilePicture(Guid userId, [FromForm] UpdateProfilePictureWebModel updateProfilePictureWebModel, [FromHeader] string authorization)
+ {
+ throw new NotImplementedException();
+ // if (!await this._userService.ValidJWT(userId, authorization))
+ // return new UnauthorizedResult();
+
+ // UpdateProfilePictureServiceModel updateProfilePictureServiceModel = this._userMapper.Map<UpdateProfilePictureServiceModel>(updateProfilePictureWebModel);
+ // updateProfilePictureServiceModel.UserId = userId;
+
+ // ProfilePictureServiceModel profilePictureServiceModel = await this._userService.UpdateProfilePicture(updateProfilePictureServiceModel);
+ // ProfilePictureWebModel profilePictureWebModel = this._userMapper.Map<ProfilePictureWebModel>(profilePictureServiceModel);
+
+ // return new AcceptedResult("UpdateProfilePicture", profilePictureWebModel);
+ }
+ }
+}