package com.cool.store.enums;

import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * @author zhangchenbiao
 * @FileName: PlatFormTypeEnum
 * @Description:
 * @date 2023-06-08 16:43
 */
public enum PlatFormTypeEnum {

    /**
     * 菜单类型
     */
    PC("PC","pc端菜单"),
    ;

    private String code;
    private String msg;

    protected static final Map<String, PlatFormTypeEnum> map = Arrays.stream(values()).collect(
            Collectors.toMap(PlatFormTypeEnum::getCode, Function.identity()));

    PlatFormTypeEnum(String code, String msg){
        this.code=code;
        this.msg=msg;
    }

    public String getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
    public static PlatFormTypeEnum getByCode(String code) {
        return map.get(code);
    }
}
