package com.ruoyi.info.quicklink.enums;

import com.ruoyi.common.enums.IIntegerEnum;
import java.util.Objects;

public enum JumpType implements IIntegerEnum<Integer> {

    INNER(0, "内部页面"),
    OUTER(1, "外部链接"),
    INNER_RESOURCE(2, "内部资源模型"),

    ;



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

    private Integer code;

    private String msg;

    @Override
    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static JumpType getByCode(int code) {
        for (JumpType value : JumpType.values()) {
            if (Objects.equals(code, value.getCode())) {
                return value;
            }
        }
        return null;
    }

}
