package com.zcloud.safetyDutyList.domain.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 反馈状态枚举
 * <p>
 * 定义任务详情的反馈状态：
 *   1-正常：反馈正常
 *   2-异常：反馈异常
 */
@Getter
@AllArgsConstructor
public enum FeedbackStatusEnum {
    NORMAL(1, "正常"),
    ABNORMAL(2, "异常");

    private final Integer code;
    private final String name;

    public static String getNameByCode(Integer code) {
        if (code == null) return null;
        for (FeedbackStatusEnum e : values()) {
            if (e.getCode().equals(code)) return e.getName();
        }
        return null;
    }
}
