- GET /api/v1/users/{userId}/posts returns Page<PostResponse> (owner sees unpublished)
- POST /api/v1/posts returns 201 with the created PostResponse and Location
- PostResponse.userLogin; userEmail kept with the same value as deprecated
- GET /api/v1/posts/{userId} and /search?city= marked deprecated; search is paged
- CORS exposes Retry-After and Location to the frontend
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
44 lines
1.4 KiB
Java
44 lines
1.4 KiB
Java
package com.krylov.refound.dto;
|
||
|
||
import com.krylov.refound.enums.PostStatus;
|
||
import com.krylov.refound.enums.PostType;
|
||
import com.krylov.refound.enums.Role;
|
||
import java.time.LocalDateTime;
|
||
import java.util.List;
|
||
import lombok.Data;
|
||
|
||
@Data
|
||
public class PostResponse {
|
||
|
||
private Long id;
|
||
private String title;
|
||
private String description;
|
||
private String category;
|
||
private String city;
|
||
private String district;
|
||
private String address;
|
||
// Координаты нужны фронту, чтобы кнопка «место на карте» открывала точку
|
||
// объявления, а не общий вид карты. Без этих полей /detail/{id} отдавал
|
||
// null, и MapView падал на дефолтный центр.
|
||
private Double latitude;
|
||
private Double longitude;
|
||
private PostType type;
|
||
private PostStatus status;
|
||
private LocalDateTime createdAt;
|
||
/** Логин автора. */
|
||
private String userLogin;
|
||
/**
|
||
* Тот же логин под старым (ошибочным) именем — для клиентов, которые ещё
|
||
* читают userEmail. Удалить после перехода фронта на userLogin.
|
||
*/
|
||
@Deprecated
|
||
private String userEmail;
|
||
private String phone;
|
||
private List<String> images;
|
||
private Long userId;
|
||
private Role userRole;
|
||
private String rulesAccepted;
|
||
private Boolean reward;
|
||
private String rewardText;
|
||
}
|