package com.ruoyi.info.quicklink.enums;

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

/**
 * 内部资源具体模型
 */
public enum ResourceModel implements IIntegerEnum<Integer> {

    NO(0, "无"),
    NOTICE(1, "公告"),
    PRODUCT(2, "积分商品"),
    BUSINESS(3, "景区"),
    ;



    ResourceModel(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 ResourceModel getByCode(int code) {
        for (ResourceModel value : ResourceModel.values()) {
            if (Objects.equals(code, value.getCode())) {
                return value;
            }
        }
        return null;
    }
}
