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=1740295596188#/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%2Fhandwriting&method=post
 * 手写文字识别
 *
 * {
 *     "words_result": [
 *         {
 *             "location": {
 *                 "top": 212,
 *                 "left": 26,
 *                 "width": 720,
 *                 "height": 260
 *             },
 *             "words": "家国天下"
 *         }
 *     ],
 *     "words_result_num": 1,
 *     "log_id": "1893571806368059788"
 * }
 */
@NoArgsConstructor
@Data
public class AHandwritingResp  extends BBaseResp {


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

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

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