[AB-275] fixing channel groups not being able to be found, because of upper/lowercase

adding performance improvements for experience listener
adding logging to when a user gains a level
fixing creating a user experience instance in the join listener, which was not persisted
This commit is contained in:
Sheldan
2021-05-29 01:09:14 +02:00
parent f3bb9b9a69
commit 148c25da4c
7 changed files with 33 additions and 17 deletions

View File

@@ -15,7 +15,7 @@ public interface ChannelGroupRepository extends JpaRepository<AChannelGroup, Lon
Optional<AChannelGroup> findByGroupNameIgnoreCaseAndServer(String name, AServer server);
Optional<AChannelGroup> findByGroupNameAndServerAndChannelGroupType_GroupTypeKey(String name, AServer server, String groupTyeKey);
Optional<AChannelGroup> findByGroupNameIgnoreCaseAndServerAndChannelGroupType_GroupTypeKey(String name, AServer server, String groupTyeKey);
List<AChannelGroup> findByServerAndChannelGroupType_GroupTypeKey(AServer server, String groupTyeKey);

View File

@@ -139,14 +139,13 @@ public class ChannelGroupManagementServiceBean implements ChannelGroupManagement
@Override
public AChannelGroup findByNameAndServerAndType(String name, AServer server, String expectedType) {
String lowerName = name.toLowerCase();
Optional<AChannelGroup> channelOptional = channelGroupRepository.findByGroupNameAndServerAndChannelGroupType_GroupTypeKey(lowerName, server, expectedType);
Optional<AChannelGroup> channelOptional = channelGroupRepository.findByGroupNameIgnoreCaseAndServerAndChannelGroupType_GroupTypeKey(name, server, expectedType);
return channelOptional.orElseThrow(() -> {
if(channelGroupRepository.existsByGroupNameIgnoreCaseAndServer(lowerName, server)) {
return new ChannelGroupIncorrectTypeException(name.toLowerCase(), expectedType);
if(channelGroupRepository.existsByGroupNameIgnoreCaseAndServer(name, server)) {
return new ChannelGroupIncorrectTypeException(name, expectedType);
} else {
List<String> channelGroupNames = extractChannelGroupNames(findAllInServerWithType(server.getId(), expectedType));
return new ChannelGroupNotFoundException(name.toLowerCase(), channelGroupNames);
return new ChannelGroupNotFoundException(name, channelGroupNames);
}
});
}