package com.bonus.canteen.core.android.enums;

/**
 * @author xliu
 * @date 2025/5/7 15:17
 */
public enum BasicSettingsEnum {

    HOME_TITLE("home_title", "首页标题"),

    LOGIN_TYPE("login_type", "登录方式");

    private final String key;
    private final String value;

    BasicSettingsEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public static String getValue(String key) {
        for (BasicSettingsEnum basicSettings : BasicSettingsEnum.values()) {
            if (basicSettings.key.equals(key)) {
                return basicSettings.value;
            }
        }
        return null;
    }

    public static String getKey(String value) {
        for (BasicSettingsEnum basicSettings : BasicSettingsEnum.values()) {
            if (basicSettings.value.equals(value)) {
                return basicSettings.key;
            }
        }
        return null;
    }

    public String getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

    public static void main(String[] args) {
//        System.out.println(BasicSettingsEnum.getValue("home_title"));
        System.out.println(BasicSettingsEnum.getKey("首页标题1"));
    }


}


