package com.yeejoin.amos.boot.module.jxiop.api.Enum;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum QrcodeColorEnum {
    GREEN("绿码", "green"),
    RED("红码", "red"),
    YELLOW("黄码", "yellow");


    private String name;
    private String code;

    public static String getCode(String name) {

        for (QrcodeColorEnum qrcodeColorEnum : QrcodeColorEnum.values()) {
            if (qrcodeColorEnum.getName().equals(name)) {
                return qrcodeColorEnum.getCode();
            }
        }
        return null;
    }
    public static String getName(String code) {

        for (QrcodeColorEnum qrcodeColorEnum : QrcodeColorEnum.values()) {
            if (qrcodeColorEnum.getCode().equals(code)) {
                return qrcodeColorEnum.getName();
            }
        }
        return null;
    }
}
