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

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

@Getter
@AllArgsConstructor
public enum HhFaceResultConfigEnum {

    RESULT_PAGE_TEMPLATE("RESULT_PAGE_TEMPLATE", "模版类型"),
    COMPARE_SILENT_DISPLAY("COMPARE_SILENT_DISPLAY", "刷脸失败是否静默显示"),
    SUCCESS_PAGE_TIME("SUCCESS_PAGE_TIME", "默认成功结果页时长(s)"),
    SUC_TEXT("SUC_TEXT", "成功默认标题"),
    SUC_VOICE("SUC_VOICE", "成功默认语音"),
    SHOW_DISPLAY_TIME_BY_OPEN_TIMES_SWITCH("SHOW_DISPLAY_TIME_BY_OPEN_TIMES_SWITCH", "是否根据开门次数决定显示时长"),
    FAIL_PAGE_TIME("FAIL_PAGE_TIME", "默认刷脸失败结果页时长(s)"),
    FAIL_TEXT("FAIL_TEXT", "刷脸失败默认标题"),
    FAIL_VOICE("FAIL_VOICE", "刷脸失败默认语音"),
    SINGLE_PAGE_TIME("SINGLE_PAGE_TIME", "默认单选页时长(s)"),
    MULTI_PAGE_TIME("MULTI_PAGE_TIME", "默认多选页时长(s)"),
    WAIT_PAGE_TIME("WAIT_PAGE_TIME","默认等待页时长(s)"),
    ONE_TO_ONE_TIPS_SWITCH("ONE_TO_ONE_TIPS_SWITCH", "1:1比对是否显示提醒页"),
    SHOW_TOP_BAR("SHOW_TOP_BAR", "是否显示通行统计"),
    ;

    private String code;
    private String desc;

    public static HhFaceResultConfigEnum findByCode(String code) {
        if (Preconditions.isBlank(code)) {
            return null;
        }
        for (HhFaceResultConfigEnum enumObject : values()) {
            if (enumObject.code.equals(code)) {
                return enumObject;
            }
        }
        return null;
    }

}
