package cn.orionsec.ops.constant.message;

import cn.orionsec.ops.constant.CnConst;
import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum ReadStatus {

    /**
     * 未读
     */
    UNREAD(1, CnConst.UNREAD),

    /**
     * 已读
     */
    READ(2, CnConst.READ),

    ;

    private final Integer status;

    private final String label;

    public static ReadStatus of(Integer status) {
        if (status == null) {
            return null;
        }
        for (ReadStatus value : values()) {
            if (value.status.equals(status)) {
                return value;
            }
        }
        return null;
    }

}
