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


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/?_=1740575657628&timestamp=1740630425717#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E6%95%99%E8%82%B2%E5%9C%BA%E6%99%AFOCR&api=rest%2F2.0%2Focr%2Fv1%2Fpen&method=post
 */
@NoArgsConstructor
@Data
public class BPenResp extends BBaseResp {


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

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

        @NoArgsConstructor
        @Data
        public static class ProbabilityDTO {
            @JsonProperty("average")
            private Double average;
            @JsonProperty("min")
            private Double min;
            @JsonProperty("variance")
            private Double variance;
        }

        @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;
        }
    }
}
