package com.heyu.api.baidu.response.common;


import com.fasterxml.jackson.annotation.JsonProperty;
import com.heyu.api.baidu.response.BBaseResp;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * https://console.bce.baidu.com/support/?_=1740219852952&timestamp=1740299353970#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E9%80%9A%E7%94%A8%E5%9C%BA%E6%99%AFOCR&api=rest%2F2.0%2Focr%2Fv1%2Fnumbers&method=post
 *
 * 数字识别
 *
 * {
 *     "log_id": 620759800,
 *     "words_result": [
 *         {
 *             "location": {
 *                 "left": 56,
 *                 "top": 0,
 *                 "width": 21,
 *                 "height": 210
 *             },
 *             "words": "3"
 *         }
 *     ],
 *     "words_result_num": 1
 * }
 */
@NoArgsConstructor
@Data
public class ANumbersResp extends BBaseResp {


    @JsonProperty("log_id")
    private Long logId;
    @JsonProperty("words_result")
    private List<WordsResultDTO> wordsResult;
    @JsonProperty("words_result_num")
    private Integer wordsResultNum;

    @NoArgsConstructor
    @Data
    public static class WordsResultDTO {
        @JsonProperty("location")
        private LocationDTO location;
        @JsonProperty("words")
        private String words;

        @NoArgsConstructor
        @Data
        public static class LocationDTO {
            @JsonProperty("left")
            private Integer left;
            @JsonProperty("top")
            private Integer top;
            @JsonProperty("width")
            private Integer width;
            @JsonProperty("height")
            private Integer height;
        }
    }
}
