2025-12-22 14:07:44 +07:00
|
|
|
package ru.soune.nocopy.dto.file;
|
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
|
|
import lombok.Data;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
@Data
|
|
|
|
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
|
|
|
|
public class YandexSearchResponse {
|
|
|
|
|
|
|
|
|
|
@JsonProperty("images")
|
|
|
|
|
private List<ImageResult> images;
|
|
|
|
|
|
2026-01-29 20:13:10 +07:00
|
|
|
@JsonProperty("images")
|
|
|
|
|
public void setImages(List<ImageResult> images) {
|
|
|
|
|
if (images != null && images.size() > 5) {
|
|
|
|
|
this.images = images.subList(0, 5);
|
|
|
|
|
} else {
|
|
|
|
|
this.images = images;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-12-22 14:07:44 +07:00
|
|
|
@Data
|
|
|
|
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
|
|
|
|
public static class ImageResult {
|
|
|
|
|
@JsonProperty("url")
|
|
|
|
|
private String url;
|
|
|
|
|
|
|
|
|
|
@JsonProperty("pageUrl")
|
|
|
|
|
private String pageUrl;
|
|
|
|
|
|
|
|
|
|
@JsonProperty("pageTitle")
|
|
|
|
|
private String pageTitle;
|
|
|
|
|
|
|
|
|
|
@JsonProperty("width")
|
|
|
|
|
private Integer width;
|
|
|
|
|
|
|
|
|
|
@JsonProperty("height")
|
|
|
|
|
private Integer height;
|
|
|
|
|
|
|
|
|
|
@JsonProperty("host")
|
|
|
|
|
private String host;
|
|
|
|
|
}
|
|
|
|
|
}
|