package com.qunzhixinxi.hnqz.admin.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * {@code CertStatus}
 * <p>
 * 易联数科签约状态枚举
 *
 * @author Hengchen.Sun
 * @author lixuesong
 * @version 1.0.0
 * @date 2022/03/09 22:21
 */
@Getter
@AllArgsConstructor
public enum OladingCertStatus {

	// 签约状态
    UN_SIGNED("0", "未签约"),
	CERT("1", "已认证"),
    SIGNED("2", "已签约"),
	SIGNING("3", "签约中"),
	UN_CERT("4", "未认证");

    private final String code;

    private final String message;

    /**
     * 根据枚举编码获取枚举对象
     *
     * @param code 枚举编码
     * @return 如果存在返回枚举，否则返回 {@code null}
     */
    public static OladingCertStatus resolve(final String code) {
        for (OladingCertStatus oladingCertStatus : OladingCertStatus.values()) {
            if (oladingCertStatus.getCode().equals(code)) {
                return oladingCertStatus;
            }
        }
        return UN_SIGNED;

    }
}