package com.ruoyi.common.core.domain.entity;

import java.util.List;
import java.util.Map;

public class MenuExtInfo {

    public static class ConfigExtends {
        Map<String, Object> meta;
        String operation; // AND/OR for satisfyAny, default as AND
        List<ConfigItem> items; // items for satisfyStoreGetters

        public Map<String, Object> getMeta() {
            return meta;
        }

        public void setMeta(Map<String, Object> meta) {
            this.meta = meta;
        }

        public String getOperation() {
            return operation;
        }

        public void setOperation(String operation) {
            this.operation = operation;
        }

        public List<ConfigItem> getItems() {
            return items;
        }

        public void setItems(List<ConfigItem> items) {
            this.items = items;
        }
    }

    public static class Meta {
        private String title;
        private String icon;
        private boolean noCache;
        private boolean isWideScreen;

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public String getIcon() {
            return icon;
        }

        public void setIcon(String icon) {
            this.icon = icon;
        }

        public boolean isNoCache() {
            return noCache;
        }

        public void setNoCache(boolean noCache) {
            this.noCache = noCache;
        }

        public boolean isWideScreen() {
            return isWideScreen;
        }

        public void setWideScreen(boolean wideScreen) {
            isWideScreen = wideScreen;
        }
    }

    public static class ConfigItem {
        boolean enabled;
        String key;
        boolean useOpposite;
        String label;
        String labelOpposite;
        String minVersion;
        String maxVersion;

        public ConfigItem() {

        }

        public ConfigItem(boolean useOpposite, String key) {
            this.useOpposite = useOpposite;
            this.key = key;
        }

        public String toKeyName() {
            return useOpposite ? "!" + key : key;
        }

        public boolean isEnabled() {
            return enabled;
        }

        public void setEnabled(boolean enabled) {
            this.enabled = enabled;
        }

        public String getKey() {
            return key;
        }

        public void setKey(String key) {
            this.key = key;
        }

        public boolean isUseOpposite() {
            return useOpposite;
        }

        public void setUseOpposite(boolean useOpposite) {
            this.useOpposite = useOpposite;
        }

        public String getLabel() {
            return label;
        }

        public void setLabel(String label) {
            this.label = label;
        }

        public String getLabelOpposite() {
            return labelOpposite;
        }

        public void setLabelOpposite(String labelOpposite) {
            this.labelOpposite = labelOpposite;
        }

        public String getMinVersion() {
            return minVersion;
        }

        public void setMinVersion(String minVersion) {
            this.minVersion = minVersion;
        }

        public String getMaxVersion() {
            return maxVersion;
        }

        public void setMaxVersion(String maxVersion) {
            this.maxVersion = maxVersion;
        }
    }
}
