package com.diagbot.enums;

import com.diagbot.core.KeyedNamed;
import lombok.Setter;

/**
 * @Description:提示信息展示位置
 * @Author:zhaops
 * @time: 2018/11/23 10:12
 */
public enum IntroducePositionEnum implements KeyedNamed {
    Push(1, "推送展示"),
    More(2, "更多展示"),
    CommonTreatment(3, "一般治疗展示"),
    SurgeryTreatment(4, "手术治疗展示"),
    Drug(5, "药品说明书");
    @Setter
    private Integer key;

    @Setter
    private String name;

    IntroducePositionEnum(Integer key, String name) {
        this.key = key;
        this.name = name;
    }

    public static IntroducePositionEnum getEnum(Integer key) {
        for (IntroducePositionEnum item : IntroducePositionEnum.values()) {
            if (item.key == key) {
                return item;
            }
        }
        return null;
    }

    public static String getName(Integer key) {
        IntroducePositionEnum item = getEnum(key);
        return item != null ? item.name : null;
    }

    @Override
    public int getKey() {
        return key;
    }

    @Override
    public String getName() {
        return name;
    }
}