mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
Refactor friend request and media services, remove console commands
Refactored the friend request command service and SignalR hub to return and broadcast FriendshipDto objects, improving real-time updates. Enhanced media upload and download logic to support file storage and retrieval, including database integration. Removed all command classes and related infrastructure from the Govor.Console project, streamlining the console client. Updated dependency injection and interfaces to reflect these changes.
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
using Govor.Core.Models;
|
||||
|
||||
namespace Govor.Application.Interfaces.Friends;
|
||||
|
||||
public interface IFriendRequestCommandService
|
||||
{
|
||||
Task SendAsync(Guid fromUserId, Guid toUserId);
|
||||
Task AcceptAsync(Guid requestId, Guid currentUserId);
|
||||
Task RejectAsync(Guid requestId, Guid currentUserId);
|
||||
Task<Friendship> SendAsync(Guid fromUserId, Guid toUserId);
|
||||
Task<Friendship> AcceptAsync(Guid requestId, Guid currentUserId);
|
||||
Task<Friendship> RejectAsync(Guid requestId, Guid currentUserId);
|
||||
}
|
||||
|
||||
@@ -6,9 +6,16 @@ public interface IMediaService
|
||||
{
|
||||
public Task<MediaUploadResult> UploadMediaAsync(Media file);
|
||||
public Task DeleteMediaAsync(Guid fileId);
|
||||
public Task<MediaUploadResult> GetMediaAsync(string url);
|
||||
public Task<Media> GetMediaByUrlAsync(string url);
|
||||
public Task<Media> GetMediaByIdAsync(Guid mediaId);
|
||||
}
|
||||
|
||||
public record Media(byte[] Data, string FileName, MediaType Type, string MineType, string EncryptedKey);
|
||||
public record Media(Guid UploaderId,
|
||||
DateTime UploadedOn,
|
||||
byte[] Data,
|
||||
string FileName,
|
||||
MediaType Type,
|
||||
string MineType,
|
||||
string EncryptedKey);
|
||||
|
||||
public record MediaUploadResult(Guid? MediaId, string Url);
|
||||
Reference in New Issue
Block a user