package com.face.global.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

@AllArgsConstructor
public enum TransDirectEnum {
    INCOME("1","收入"), OUTLAY("2","支出");

    @Getter
    private String key;

    @Getter
    private String desc;

    public static TransDirectEnum getByCode(String code) {
        return Arrays.stream(TransDirectEnum.values()).filter(e -> e.getKey().equals(code)).findFirst().orElse(null);
    }

}
