mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
test to make server
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using Govor.Application.Interfaces;
|
||||
using Govor.Core.Models;
|
||||
using Govor.Core.Repositories.PrivateChats;
|
||||
using Govor.Data.Repositories.Exceptions;
|
||||
|
||||
namespace Govor.Application.Services;
|
||||
|
||||
public class UserPrivateChatsGetter : IUserPrivateChatsGetterService
|
||||
{
|
||||
private readonly IPrivateChatsRepository _groupRep;
|
||||
|
||||
public UserPrivateChatsGetter(IPrivateChatsRepository groupsRepository)
|
||||
{
|
||||
_groupRep = groupsRepository;
|
||||
}
|
||||
|
||||
public async Task<List<PrivateChat>> GetUserChatsAsync(Guid userId)
|
||||
{
|
||||
try
|
||||
{
|
||||
return await _groupRep.GetAllOfUser(userId);
|
||||
}
|
||||
catch (NotFoundByKeyException<Guid> ex)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user