package com.face.global.enums;


import com.face.global.validator.EnumValidator;
import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
public enum WxTypeEnum implements EnumValidator {

    OFFICIAL("1"), MINI("2");

    @Getter
    private String code;

    public static WxTypeEnum getByCode(String type) {
        WxTypeEnum[] values = WxTypeEnum.values();
        for (WxTypeEnum value : values) {
            if (value.getCode().equals(type)) {
                return value;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return this.code;
    }

    @Override
    public Object getValue() {
        return this.code;
    }
}
