package com.zfire.mall.manager.enums;

import cn.hutool.core.util.EnumUtil;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

import java.util.Map;

@Getter
public enum ExamineStatusEnum {
    SAVE("SAVE","保存"),
    WAIT("WAIT","待审核"),
    OK_ONE("OK_ONE","初审通过"),
    FAIL_ONE("FAIL_ONE","初审不通过"),
    OK("OK","审核通过"),
    FAIL("FAIL","审核不通过"),
    ABANDON("ABANDON","弃审"),
    REJECT("REJECT","驳回"),
    OK_ONE_AND_CONFIRM("OK_ONE_AND_CONFIRM","已确认未复核"),
    CLOSE("CLOSE","关闭"),
    ;
    @JsonValue
    @EnumValue
    private String key;
    private String value;

    ExamineStatusEnum(String key,String value){
        this.key=key;
        this.value = value;
    }

    public static String getMsg(String examineStatus) {
        if (StringUtils.isNotBlank(examineStatus)) {
            Map<String, Object> enumMap = EnumUtil.getNameFieldMap(ExamineStatusEnum.class, "value");
            return enumMap.get(examineStatus).toString();
        }
        return "";
    }
}
