🚧 Fix user services bugs from update
This commit is contained in:
parent
f54e768fb1
commit
701df23c1e
@ -74,6 +74,6 @@ public class CustomHttpAuthenticationMechanism implements HttpAuthenticationMech
|
||||
@Override
|
||||
public Uni<ChallengeData> getChallenge(RoutingContext context)
|
||||
{
|
||||
return null;
|
||||
return Uni.createFrom().nullItem();
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import io.quarkus.panache.common.Parameters;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
@ApplicationScoped
|
||||
@ -13,16 +14,21 @@ public class UserRepo implements PanacheRepositoryBase<UserEntity, String>
|
||||
{
|
||||
public Optional<UserEntity> findOptionalByRealmAndEmail(RealmEntity realm, String email)
|
||||
{
|
||||
return find("realm = :realm AND email = :email", Parameters.with("realm", realm).and("email", email)).firstResultOptional();
|
||||
return find("realm = :realm AND email = :email", Map.ofEntries(Map.entry("realm", realm), Map.entry("email", email))).firstResultOptional();
|
||||
}
|
||||
|
||||
public List<UserEntity> findByRealm(RealmEntity realm)
|
||||
{
|
||||
return list("realm = :realm", Parameters.with("realm", realm));
|
||||
return list("realm = :realm", Map.ofEntries(Map.entry("realm", realm)));
|
||||
}
|
||||
|
||||
public UserEntity findByRealmAndId(RealmEntity realm, String id)
|
||||
{
|
||||
return find("realm = :realm AND id = :id", Parameters.with("realm", realm).and("id", id)).firstResult();
|
||||
return find("realm = :realm AND id = :id", Map.ofEntries(Map.entry("realm", realm), Map.entry("id", id))).firstResult();
|
||||
}
|
||||
|
||||
public List<UserEntity> searchByIds(List<String> ids)
|
||||
{
|
||||
return list("id IN :ids", Map.ofEntries(Map.entry("ids", ids)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,8 +68,7 @@ public class UserService
|
||||
public Map<String, User> findByIds(List<String> ids)
|
||||
{
|
||||
Map<String, User> accounts = new HashMap<>();
|
||||
List<UserEntity> users = userRepo.findByIds(ids);
|
||||
for (UserEntity userEntity : users)
|
||||
for (UserEntity userEntity : userRepo.searchByIds(ids))
|
||||
{
|
||||
accounts.put(userEntity.getId(), userMapper.map(userEntity));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user