added posts on feed and posts on map
This commit is contained in:
@@ -18,13 +18,6 @@ public class PostSpecification {
|
||||
};
|
||||
}
|
||||
|
||||
public static Specification<Post> hasType(String type) {
|
||||
return (root, query, cb) -> {
|
||||
if (type == null || type.isBlank()) return cb.conjunction();
|
||||
return cb.equal(cb.lower(root.get("type")), type.toLowerCase());
|
||||
};
|
||||
}
|
||||
|
||||
public static Specification<Post> cityOrDistrictLike(String query) {
|
||||
if (!StringUtils.hasText(query)) {
|
||||
return null;
|
||||
|
||||
15
src/main/java/com/krylov/refound/util/PostVisibility.java
Normal file
15
src/main/java/com/krylov/refound/util/PostVisibility.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.krylov.refound.util;
|
||||
|
||||
import com.krylov.refound.enums.PostStatus;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Set;
|
||||
|
||||
public final class PostVisibility {
|
||||
|
||||
// Статусы, видимые всем: в публичной ленте и на карте. MODERATION и REJECTED
|
||||
// видны только владельцу поста (getPostsByUserId, getPostOnMapById в PostService)
|
||||
public static final Set<PostStatus> FEED_VISIBLE_STATUSES = EnumSet.of(PostStatus.ACTIVE, PostStatus.CLOSED);
|
||||
|
||||
private PostVisibility() {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user