mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-14 11:48:16 +00:00
[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:
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user