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;

/**
 * https://console.bce.baidu.com/support/?_=1740219852952&timestamp=1740306844271#/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%2Fbankcard&method=post
 * 银行卡识别
 *
 * {
 *     "result": {
 *         "valid_date": "06/25",
 *         "bank_card_number": "6214 8557 1351 6769",
 *         "bank_card_number_location": {
 *             "top": 378,
 *             "left": 329,
 *             "width": 50,
 *             "height": 600
 *         },
 *         "bank_name": "招商银行",
 *         "bank_card_type": 1,
 *         "card_quality": {
 *             "IsComplete_probability": 0.9918179512,
 *             "IsClear": 1,
 *             "IsClear_probability": 0.5824346542,
 *             "IsComplete": 1
 *         },
 *         "holder_name": ""
 *     },
 *     "direction": 3,
 *     "log_id": "1893612771823384644"
 * }
 */
@NoArgsConstructor
@Data
public class BBankcardResp extends BBaseResp {


    @JsonProperty("result")
    private ResultDTO result;
    @JsonProperty("direction")
    private Integer direction;
    @JsonProperty("log_id")
    private String logId;

    @NoArgsConstructor
    @Data
    public static class ResultDTO {
        @JsonProperty("valid_date")
        private String validDate;
        @JsonProperty("bank_card_number")
        private String bankCardNumber;
        @JsonProperty("bank_card_number_location")
        private BankCardNumberLocationDTO bankCardNumberLocation;
        @JsonProperty("bank_name")
        private String bankName;
        @JsonProperty("bank_card_type")
        private Integer bankCardType;
        @JsonProperty("card_quality")
        private CardQualityDTO cardQuality;
        @JsonProperty("holder_name")
        private String holderName;

        @NoArgsConstructor
        @Data
        public static class BankCardNumberLocationDTO {
            @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("IsComplete_probability")
            private Double iscompleteProbability;
            @JsonProperty("IsClear")
            private Integer isClear;
            @JsonProperty("IsClear_probability")
            private Double isclearProbability;
            @JsonProperty("IsComplete")
            private Integer isComplete;
        }
    }
}
