package com.sckw.core.model.enums;

import lombok.Getter;

/**
 * @author czh
 * @desc 证照类型枚举
 * @date 2023/6/15
 */
@Getter
public enum CertificateTypeEnum {

    //联系人身份证
    CONTACTS_IDCARD(1, "联系人身份证"),
    //法人身份证
    CORPORATION_IDCARD(2, "法人身份证"),
    //营业执照
    BUSINESSLICENSE(3, "营业执照"),
    //道路运输许可证
    ROADLICENSE(4, "道路运输许可证"),
    //开户许可证号
    ACCOUNT(5, "开户许可证号"),
    //授权证书
    AUTHORIZE(6, "授权证书"),
    //电子签章授权书
    SIGNATURES(7, "电子签章授权书");

    private final int code;

    private final String name;

    CertificateTypeEnum(int code, String name){
        this.code = code;
        this.name = name;
    }

    public static CertificateTypeEnum getName(int code){
        for (CertificateTypeEnum certificateTypeEnum : values()) {
            if (certificateTypeEnum.getCode() == code) {
                return certificateTypeEnum;
            }
        }
        return null;
    }
}
