added posts on feed and posts on map

This commit is contained in:
SlimusMinus
2026-09-29 01:03:54 +03:00
parent a44ca00222
commit 870739f45f
22 changed files with 639 additions and 44 deletions

View File

@@ -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;

View 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() {
}
}