Posts API stage 2: /posts/{id} is one post, drop userEmail and /posts/search

- GET /api/v1/posts/{id} returns a single post (owner-only for unpublished);
  /detail/{id} stays as an alias; user posts live at /api/v1/users/{userId}/posts
- POST /api/v1/posts Location points to /api/v1/posts/{id}
- PostResponse.userEmail removed (use userLogin); unused DialogResponse removed
- GET /api/v1/posts/search?city= removed (same filter: GET /api/v1/posts?city=)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SlimusMinus
2026-10-21 00:03:39 +03:00
parent 13d09d0073
commit d782bee645
10 changed files with 59 additions and 112 deletions

View File

@@ -20,7 +20,6 @@ public interface PostMapper {
@Mapping(source = "user.id", target = "userId")
@Mapping(source = "user.login", target = "userLogin")
@Mapping(source = "user.login", target = "userEmail")
@Mapping(source = "images", target = "images", qualifiedByName = "imagesToUrls")
// Категория необязательна: без проверки на null пост без категории ронял ленту с 500
@Mapping(target = "category", expression = "java(post.getCategory() == null ? null : post.getCategory().getDisplayName())")