|
|
@@ -6,6 +6,7 @@ import com.izouma.nineth.annotations.Debounce;
|
|
|
import com.izouma.nineth.config.GeneralProperties;
|
|
|
import com.izouma.nineth.config.RedisKeys;
|
|
|
import com.izouma.nineth.converter.LongArrayConverter;
|
|
|
+import com.izouma.nineth.converter.StringArrayConverter;
|
|
|
import com.izouma.nineth.domain.Collection;
|
|
|
import com.izouma.nineth.domain.*;
|
|
|
import com.izouma.nineth.dto.*;
|
|
|
@@ -104,6 +105,22 @@ public class CollectionService {
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // 筛选去除指定名称不展示
|
|
|
+ if (query.containsKey("notLike")) {
|
|
|
+ String notLike = Convert.toStr(query.get("notLike"));
|
|
|
+ query.remove("notLike");
|
|
|
+ StringArrayConverter converter = new StringArrayConverter();
|
|
|
+ List<String> notLikes = converter.convertToEntityAttribute(notLike);
|
|
|
+ specification = specification.and((Specification<Collection>) (root, criteriaQuery, criteriaBuilder) -> {
|
|
|
+ List<Predicate> and = new ArrayList<>();
|
|
|
+ notLikes.forEach( str -> {
|
|
|
+ and.add(criteriaBuilder.notLike(root.get("name"), str));
|
|
|
+ });
|
|
|
+ return criteriaBuilder.and(and.toArray(new Predicate[0]));
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
// if (pageRequest.getSort().stream().noneMatch(order -> order.getProperty().equals("createdAt"))) {
|
|
|
// pageRequest = PageRequest.of(pageRequest.getPageNumber(), pageQuery.getSize(),
|
|
|
// pageRequest.getSort().and(Sort.by("createdAt").descending()));
|