package com.fuyuanshen.equipment.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum RepairImageType {
    BEFORE(1, "维修前"),
    AFTER(2, "维修后");

    private final int code;
    private final String desc;

    public static RepairImageType of(Integer code) {
        return Arrays.stream(values())
                .filter(e -> e.getCode() == code)
                .findFirst()
                .orElse(null);
    }
}
