三方登录:支持 saas 多租户配置

This commit is contained in:
YunaiV
2023-11-04 22:10:58 +08:00
parent f353011d96
commit 77e98bbb2d
26 changed files with 759 additions and 44 deletions

View File

@@ -224,10 +224,14 @@ public class CollectionUtils {
}
public static <T> T findFirst(List<T> from, Predicate<T> predicate) {
return findFirst(from, predicate, Function.identity());
}
public static <T, U> U findFirst(List<T> from, Predicate<T> predicate, Function<T, U> func) {
if (CollUtil.isEmpty(from)) {
return null;
}
return from.stream().filter(predicate).findFirst().orElse(null);
return from.stream().filter(predicate).findFirst().map(func).orElse(null);
}
public static <T, V extends Comparable<? super V>> V getMaxValue(Collection<T> from, Function<T, V> valueFunc) {