package cd.casic.plugin.constants;

import lombok.Data;
import lombok.experimental.UtilityClass;

/**
 * @Classname PluginConstants
 * @Description 常量
 * @Date 2025/5/8 14:51
 * @Created by mianbin
 */
@Data
@UtilityClass
public class PluginConstants {

    /**
     * 插件静态资源目录
     */
    public static final String PLUGINS_RESOURCES_DIR = "ops-module-plugins/ops-module-plugins-example-web/src/main/resources/static";
    /**
     * 角色：管理员
     */
    public static final String ROLE_ADMIN = "admin";
    /**
     * 角色：用户
     */
    public static final String ROLE_USER = "user";
    /**
     * 角色：编辑
     */
    public static final String ROLE_EDITOR = "editor";

    /**
     * Plugin metadata labels key.
     */
    String PLUGIN_NAME_LABEL_NAME = "plugin.ops/plugin-name";

    String SYSTEM_PLUGIN_NAME = "system";

    String RELOAD_ANNO = "plugin.ops/reload";

    String REQUEST_TO_UNLOAD_LABEL = "plugin.ops/request-to-unload";

    String PLUGIN_PATH = "plugin.ops/plugin-path";
    // 模式这边后面要考虑下dev\prod， 目前作为现在的情况，这两种就够了
    String RUNTIME_MODE_ANNO = "plugin.ops/runtime-mode";

    String assetsRoutePrefix(String pluginName) {
        return "/plugins/" + pluginName + "/assets/";
    }


    public static class Suffix {

        private Suffix() { throw new IllegalStateException();
        }

        public static final String JAR = "jar";
        public static final String ZIP = "zip";
    }
}
