package com.ruoyi.project.business.enums;

import com.ruoyi.common.exception.ServiceErrorException;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author jubs
 */

@AllArgsConstructor
@Getter
public enum ReadStatusEnum {

    /**
     * 未读
     */
    UN_READ("0", "未读"),
    READ("1", "已读");

    private String value;
    private String desc;

    public static ReadStatusEnum from(String value) {
        for (ReadStatusEnum readStatusEnum : values()) {
            if (readStatusEnum.getValue().equals(value)) {
                return readStatusEnum;
            }
        }
        throw new ServiceErrorException("非法的已读状态类型");
    }
}
