package com.mortals.xhx.common.code;

import java.util.HashMap;
import java.util.Map;


public enum OperTypeEnum {

    SAVE(0, "添加"),
    UPDATE(1, "更新"),
    DELETE(2, "删除"),
    SEARCH(3, "查询"),
    OTHER(-1, "其它");

    private int value;
    private String msg;

    private OperTypeEnum(int value, String msg) {
        this.value = value;
        this.msg = msg;
    }

    public int getValue() {
        return this.value;
    }

    public static Map<String, String> getEnumMap() {
        Map<String, String> resultMap = new HashMap<>();
        OperTypeEnum[] operTypeEnum = OperTypeEnum.values();
        for (OperTypeEnum typeEnum : operTypeEnum) {
            resultMap.put(String.valueOf(typeEnum.value), typeEnum.msg);
        }
        return resultMap;
    }
}
