package com.face.global.enums;


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

@AllArgsConstructor
public enum WxConfigTypeEnum implements EnumValidator {

    CUSTOMER("customer"), SYS_USER("sysUser");

    @Getter
    private String code;

    public static WxConfigTypeEnum getByCode(String type) {
        WxConfigTypeEnum[] values = WxConfigTypeEnum.values();
        for (WxConfigTypeEnum 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;
    }
}
