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


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=1740302247547#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E5%8D%A1%E8%AF%81OCR&api=rest%2F2.0%2Focr%2Fv1%2Fmulti_idcard&method=post
 *
 *身份证混贴识别
 *
 *
 *
 */
@NoArgsConstructor
@Data
public class BMultiIdcardResp extends BBaseResp {

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

    @NoArgsConstructor
    @Data
    public static class WordsResultDTO {
        @JsonProperty("card_info")
        private CardInfoDTO cardInfo;
        @JsonProperty("card_result")
        private CardResultDTO cardResult;

        @NoArgsConstructor
        @Data
        public static class CardInfoDTO {
            @JsonProperty("card_location")
            private CardLocationDTO cardLocation;
            @JsonProperty("risk_type")
            private String riskType;
            @JsonProperty("photo_location")
            private PhotoLocationDTO photoLocation;
            @JsonProperty("photo")
            private String photo;
            @JsonProperty("idcard_number_type")
            private Integer idcardNumberType;
            @JsonProperty("card_quality")
            private CardQualityDTO cardQuality;
            @JsonProperty("edit_tool")
            private String editTool;
            @JsonProperty("image_status")
            private String imageStatus;
            @JsonProperty("card_type")
            private String cardType;
            @JsonProperty("card_image")
            private String cardImage;
            @JsonProperty("direction")
            private Integer direction;

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

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

            @NoArgsConstructor
            @Data
            public static class CardQualityDTO {
                @JsonProperty("IsClear_propobility")
                private Double isclearPropobility;
                @JsonProperty("IsNoCover")
                private Integer isNoCover;
                @JsonProperty("IsClear")
                private Integer isClear;
                @JsonProperty("IsNoCover_propobility")
                private Double isnocoverPropobility;
                @JsonProperty("IsComplete_propobility")
                private Double iscompletePropobility;
                @JsonProperty("IsComplete")
                private Integer isComplete;
            }
        }

        @NoArgsConstructor
        @Data
        public static class CardResultDTO {
            @JsonProperty("姓名")
            private RealNameDTO 姓名;
            @JsonProperty("民族")
            private NationalityDTO 民族;
            @JsonProperty("住址")
            private AddressDTO 住址;
            @JsonProperty("公民身份号码")
            private IDCardNumberDTO 公民身份号码;
            @JsonProperty("出生")
            private BirthDTO 出生;
            @JsonProperty("性别")
            private GenderDTO 性别;

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

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

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

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

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

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

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

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

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

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

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

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