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

import java.util.Objects;

/**
 * 评价详情表：commentType映射
 *
 * @author nianchang
 * @ClassName CommentDetailsTypeEnum
 * @date 2021/07/23 5:27 下午
 */
public enum CommentDetailsTypeEnum {

    /**
     * 商品评分
     */
    ITEM_SCORE(1, "商品"),

    /**
     * 口味评分
     */
    TASTES_SCORE(2, "口味"),

    /**
     * 服务评分
     */
    SERVE_SCORE(4, "服务"),

    /**
     * 环境评分
     */
    ENV_SCORE(6, "环境"),

    /**
     * 配送评分
     */
    DELIVERY_SCORE(8, "配送"),

    /**
     * 性价比评分
     */
    COST_PERFORMANCE_SCORE(10, "性价比"),

    /**
     * 包装评分
     */
    PACK_SCORE(12, "包装"),

    /**
     * 总评分
     */
    OVERALL_SCORE(100, "总评分"),

    ;

    private final Integer type;

    private final String desc;

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

    public Integer getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

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