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.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

import java.util.Map;

@Getter
@AllArgsConstructor
public enum DepositDataStateEnum {
    NORMAL("NORMAL", "正常"),
    AMEND("AMEND", "补充"),
    WAIT_REVIEW("WAIT_REVIEW", "待复核"),
    REVIEW("REVIEW", "复核"),
    ;

    @JsonValue
    @EnumValue
    private final String key;
    private final String 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 "";
    }
}
