This repository has been archived by the owner on Jun 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change find user friends to find user friendships query handler
- Loading branch information
1 parent
9c8b6d2
commit 11e3125
Showing
18 changed files
with
158 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
...pplication/queryHandlers/friend/findUserFriendsQueryHandler/FindUserFriendsQueryHandler.h
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
...tion/queryHandlers/friend/findUserFriendsQueryHandler/FindUserFriendsQueryHandlerImpl.cpp
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
...cation/queryHandlers/friend/findUserFriendsQueryHandler/FindUserFriendsQueryHandlerImpl.h
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
...cation/queryHandlers/friend/findUserFriendsQueryHandler/FindUserFriendsQueryHandlerMock.h
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
...Handlers/friend/findUserFriendsQueryHandler/payloads/FindUserFriendsQueryHandlerPayload.h
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
...yHandlers/friend/findUserFriendsQueryHandler/payloads/FindUserFriendsQueryHandlerResult.h
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
...on/queryHandlers/friend/findUserFriendshipsQueryHandler/FindUserFriendshipsQueryHandler.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#pragma once | ||
|
||
#include "payloads/FindUserFriendshipsQueryHandlerPayload.h" | ||
#include "payloads/FindUserFriendshipsQueryHandlerResult.h" | ||
|
||
namespace server::application | ||
{ | ||
class FindUserFriendshipsQueryHandler | ||
{ | ||
public: | ||
virtual ~FindUserFriendshipsQueryHandler() = default; | ||
|
||
virtual FindUserFriendshipsQueryHandlerResult execute(const FindUserFriendshipsQueryHandlerPayload&) const = 0; | ||
}; | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
...ryHandlers/friend/findUserFriendshipsQueryHandler/FindUserFriendshipsQueryHandlerImpl.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "FindUserFriendshipsQueryHandlerImpl.h" | ||
|
||
namespace server::application | ||
{ | ||
FindUserFriendshipsQueryHandlerImpl::FindUserFriendshipsQueryHandlerImpl( | ||
std::shared_ptr<domain::FriendshipRepository> friendshipRepositoryInit) | ||
: friendshipRepository{std::move(friendshipRepositoryInit)} | ||
{ | ||
} | ||
|
||
FindUserFriendshipsQueryHandlerResult | ||
FindUserFriendshipsQueryHandlerImpl::execute(const FindUserFriendshipsQueryHandlerPayload& payload) const | ||
{ | ||
const auto friendships = friendshipRepository->findFriendshipsByUserId({payload.userId}); | ||
|
||
return {friendships}; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...ueryHandlers/friend/findUserFriendshipsQueryHandler/FindUserFriendshipsQueryHandlerImpl.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#pragma once | ||
|
||
#include <memory> | ||
|
||
#include "FindUserFriendshipsQueryHandler.h" | ||
#include "server/domain/repositories/friendshipRepository/FriendshipRepository.h" | ||
|
||
namespace server::application | ||
{ | ||
class FindUserFriendshipsQueryHandlerImpl : public FindUserFriendshipsQueryHandler | ||
{ | ||
public: | ||
explicit FindUserFriendshipsQueryHandlerImpl(std::shared_ptr<domain::FriendshipRepository>); | ||
|
||
FindUserFriendshipsQueryHandlerResult execute(const FindUserFriendshipsQueryHandlerPayload&) const override; | ||
|
||
private: | ||
std::shared_ptr<domain::FriendshipRepository> friendshipRepository; | ||
}; | ||
} |
Oops, something went wrong.