#67 added blob storage service + endpoints for profile picture. WIP
This commit is contained in:
@@ -9,11 +9,17 @@ public class GetMyUser : EndpointGroupBase
|
||||
{
|
||||
app.MapGroup(this)
|
||||
.RequireAuthorization()
|
||||
.MapGet(GetCurrentUser);
|
||||
.MapGet(GetCurrentUser)
|
||||
.MapGet(GetCurrentUserProfilePicture, "profile-picture");
|
||||
}
|
||||
|
||||
private static async Task<UserDto> GetCurrentUser(ISender sender, [AsParameters] GetCurrentUserQuery query)
|
||||
{
|
||||
return await sender.Send(query);
|
||||
}
|
||||
|
||||
private static async Task<Stream> GetCurrentUserProfilePicture(ISender sender, [AsParameters] GetCurrentUserProfilePictureQuery query)
|
||||
{
|
||||
return await sender.Send(query);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ public class Users : EndpointGroupBase
|
||||
app.MapGroup(this)
|
||||
.MapPost(CreateUser)
|
||||
.MapPost(Login, "/login")
|
||||
.MapPost(UploadProfilePicture, "/upload-profile-picture")
|
||||
.MapGet(GetMinimalUser);
|
||||
}
|
||||
|
||||
@@ -27,4 +28,13 @@ public class Users : EndpointGroupBase
|
||||
{
|
||||
return await sender.Send(command);
|
||||
}
|
||||
|
||||
private static async Task<string> UploadProfilePicture(ISender sender, Stream stream)
|
||||
{
|
||||
var command = new UploadProfilePictureCommand
|
||||
{
|
||||
ProfilePicture = stream
|
||||
};
|
||||
return await sender.Send(command);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user