package cn.hanghui.outapi.platform.tenant.entity.enums;

import cn.hanghui.outapi.platform.common.utils.Preconditions;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author shisl
 * @package cn.hanghui.outapi.platform.tenant.entity.enums
 * @class LiveTypeEnum
 * @date 2024/7/1 下午2:26
 * @description 活体检测模式
 */
@Getter
@AllArgsConstructor
public enum LiveTypeEnum {

    RGB(1, "RGB"),
    RGB_NIR(2, "RGB+NIR"),
    RGB_DEPTH(3, "RGB+DEPTH"),
    RGB_NIR_DEPTH(4, "RGB+NIR+DEPTH");

    private Integer code;
    private String desc;

    public static LiveTypeEnum findByCode(Integer code) {
        if (Preconditions.isBlank(code)) {
            return null;
        }
        for (LiveTypeEnum enumObject : values()) {
            if (enumObject.code == code.intValue()) {
                return enumObject;
            }
        }
        return null;
    }

}
