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

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/?_=1740411162437&timestamp=1740412723534#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E4%BA%A4%E9%80%9A%E5%9C%BA%E6%99%AFOCR&api=rest%2F2.0%2Focr%2Fv1%2Fwaybill&method=post
 *
 * 快递面单识别
 */
@NoArgsConstructor
@Data
public class BWaybillResp extends BBaseResp {


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

    @NoArgsConstructor
    @Data
    public static class WordsResultDTO {
        @JsonProperty("image_info")
        private ImageInfoDTO imageInfo;
        @JsonProperty("bar_code")
        private List<BarCodeDTO> barCode;
        @JsonProperty("waybill_number")
        private List<WaybillNumberDTO> waybillNumber;
        @JsonProperty("three_segment_code")
        private List<ThreeSegmentCodeDTO> threeSegmentCode;
        @JsonProperty("recipient_name")
        private List<RecipientNameDTO> recipientName;
        @JsonProperty("sender_name")
        private List<SenderNameDTO> senderName;
        @JsonProperty("recipient_addr")
        private List<RecipientAddrDTO> recipientAddr;
        @JsonProperty("sender_addr")
        private List<SenderAddrDTO> senderAddr;
        @JsonProperty("recipient_phone")
        private List<RecipientPhoneDTO> recipientPhone;
        @JsonProperty("sender_phone")
        private List<SenderPhoneDTO> senderPhone;

        @JsonProperty("virtual_number")
        private List<SenderPhoneDTO> virtualNumber;
        @JsonProperty("virtual_number_last")
        private List<SenderPhoneDTO> virtualNumberLast;
        @JsonProperty("is_virtual_waybill")
        private List<SenderPhoneDTO> isVirtualWaybill;


        @NoArgsConstructor
        @Data
        public static class ImageInfoDTO {
            @JsonProperty("direction")
            private String direction;
        }

        @NoArgsConstructor
        @Data
        public static class BarCodeDTO {
            @JsonProperty("word")
            private String word;
        }

        @NoArgsConstructor
        @Data
        public static class WaybillNumberDTO {
            @JsonProperty("word")
            private String word;
        }

        @NoArgsConstructor
        @Data
        public static class ThreeSegmentCodeDTO {
            @JsonProperty("word")
            private String word;
        }

        @NoArgsConstructor
        @Data
        public static class RecipientNameDTO {
            @JsonProperty("word")
            private String word;
        }

        @NoArgsConstructor
        @Data
        public static class SenderNameDTO {
            @JsonProperty("word")
            private String word;
        }

        @NoArgsConstructor
        @Data
        public static class RecipientAddrDTO {
            @JsonProperty("word")
            private String word;
        }

        @NoArgsConstructor
        @Data
        public static class SenderAddrDTO {
            @JsonProperty("word")
            private String word;
        }

        @NoArgsConstructor
        @Data
        public static class RecipientPhoneDTO {
            @JsonProperty("word")
            private String word;
        }

        @NoArgsConstructor
        @Data
        public static class SenderPhoneDTO {
            @JsonProperty("word")
            private String word;
        }
    }
}
