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 DepositDataPositionEnum {
    ORIG("ORIG", "原始"),
    AMEND("AMEND","补充"),;

    @JsonValue
    @EnumValue
    private final String key;
    private final String value;

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