diff options
| author | transtrike <transtrike@gmail.com> | 2021-04-02 23:53:11 +0300 |
|---|---|---|
| committer | transtrike <transtrike@gmail.com> | 2021-04-02 23:53:11 +0300 |
| commit | b0c6c6e1795a1cc8fe82a60ce16a263ab4cad397 (patch) | |
| tree | b82e15d10e28759dcd066b38ccdd16c23753b33c | |
| parent | adff0d579e7e23fd78cce144b358f98737c91bcf (diff) | |
| download | DevHive-b0c6c6e1795a1cc8fe82a60ce16a263ab4cad397.tar DevHive-b0c6c6e1795a1cc8fe82a60ce16a263ab4cad397.tar.gz DevHive-b0c6c6e1795a1cc8fe82a60ce16a263ab4cad397.zip | |
ReadProfilePic endpoint implemented
| -rw-r--r-- | src/Services/DevHive.Services/Interfaces/IProfilePictureService.cs | 7 | ||||
| -rw-r--r-- | src/Web/DevHive.Web/Controllers/ProfilePictureController.cs | 14 |
2 files changed, 14 insertions, 7 deletions
diff --git a/src/Services/DevHive.Services/Interfaces/IProfilePictureService.cs b/src/Services/DevHive.Services/Interfaces/IProfilePictureService.cs index c455831..edf2775 100644 --- a/src/Services/DevHive.Services/Interfaces/IProfilePictureService.cs +++ b/src/Services/DevHive.Services/Interfaces/IProfilePictureService.cs @@ -7,13 +7,6 @@ namespace DevHive.Services.Interfaces public interface IProfilePictureService { /// <summary> - /// Inserts a user's profile picture in the database and cloud - /// </summary> - /// <param name="profilePictureServiceModel">User's Guid and his/hers profile picture as file</param> - /// <returns>The new profile picture's URL in the cloud</returns> - Task<string> InsertProfilePicture(ProfilePictureServiceModel profilePictureServiceModel); - - /// <summary> /// Get a profile picture by it's Guid /// </summary> /// <param name="id">Profile picture's Guid</param> diff --git a/src/Web/DevHive.Web/Controllers/ProfilePictureController.cs b/src/Web/DevHive.Web/Controllers/ProfilePictureController.cs index 1c736f6..9a76e2c 100644 --- a/src/Web/DevHive.Web/Controllers/ProfilePictureController.cs +++ b/src/Web/DevHive.Web/Controllers/ProfilePictureController.cs @@ -29,6 +29,20 @@ namespace DevHive.Web.Controllers } /// <summary> + /// Get the URL of user's profile picture + /// </summary> + /// <param name="profilePictureId">The profile picture's Id</param> + /// <param name="authorization">JWT Bearer Token</param> + /// <returns>The URL of the profile picture</returns> + [HttpGet] + [AllowAnonymous] + public async Task<IActionResult> ReadProfilePicture(Guid profilePictureId, [FromHeader] string authorization) + { + string profilePicURL = await this._profilePictureService.GetProfilePictureById(profilePictureId); + return new OkObjectResult(new { ProfilePictureURL = profilePicURL} ); + } + + /// <summary> /// Alter the profile picture of a user /// </summary> /// <param name="userId">The user's Id</param> |
