Skip to content

Commit

Permalink
replace usage of dispatch post server code in queries
Browse files Browse the repository at this point in the history
  • Loading branch information
derklaro committed Dec 10, 2024
1 parent c3f042d commit 2b80caa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@ public interface SimRailDispatchPostRepository extends
/**
* Finds a single dispatch post by the given foreign id.
*
* @param id the foreign id of the dispatch post to get.
* @param serverCode the server code of the server to get the dispatch post on.
* @param id the foreign id of the dispatch post to get.
* @param serverId the server id of the server to get the dispatch post on.
* @return an optional holding the dispatch post entity if an entity with the given foreign id exists.
*/
@Nonnull
Optional<SimRailDispatchPostEntity> findByForeignIdAndServerCode(@Nonnull String id, @Nonnull String serverCode);
Optional<SimRailDispatchPostEntity> findByForeignIdAndServerId(@Nonnull String id, @Nonnull UUID serverId);

/**
* Finds all dispatch post entities for the given server code.
*
* @param serverCode the code of the server to get the dispatch posts of.
* @param serverId the id of the server to get the dispatch posts of.
* @return all dispatch posts that are registered for the given server code.
*/
@Nonnull
List<SimRailDispatchPostEntity> findAllByServerCode(@Nonnull String serverCode);
List<SimRailDispatchPostEntity> findAllByServerId(@Nonnull UUID serverId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void collectDispatchPostInformation() {
}

//
var registeredDispatchPostsByForeignId = this.dispatchPostRepository.findAllByServerCode(server.code())
var registeredDispatchPostsByForeignId = this.dispatchPostRepository.findAllByServerId(server.id())
.stream()
.collect(Collectors.toMap(SimRailDispatchPostEntity::getForeignId, Function.identity()));
for (var dispatchPost : dispatchPosts) {
Expand Down

0 comments on commit 2b80caa

Please sign in to comment.