package com.lesingle.creation.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 举报状态枚举
 */
@Getter
@AllArgsConstructor
public enum ReportStatusEnum {

    PENDING("pending", "待处理"),
    HANDLED("handled", "已处理"),
    IGNORED("ignored", "已忽略");

    private final String code;
    private final String desc;

    public static ReportStatusEnum getByCode(String code) {
        if (code == null) {
            return PENDING;
        }
        for (ReportStatusEnum status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return PENDING;
    }
}
