package com.zm.order.tool.server.enums;

import java.util.Objects;

/**
 * 商品评价内容格式
 *
 * @author zhuxiaofeng
 * @ClassName CommentContentEnum
 * @date
 */
public enum CommentContentEnum {

    /**
     * 无内容
     */
    NULL(0, "无内容"),

    /**
     * 文字评价
     */
    TEXT(1, "文字"),

    /**
     * 图文
     */
    TEXT_ANG_IMAGE(2, "图文"),
    ;

    private final Integer type;

    private final String desc;

    CommentContentEnum(final Integer type, final String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    public static CommentContentEnum getValue(Integer type) {
        for (CommentContentEnum typeEnum : values()) {
            if (Objects.equals(typeEnum.getType(), type)) {
                return typeEnum;
            }
        }
        return null;
    }
}
