【仅供内部供应商使用,不提供对外解答和培训】

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

我们以主题插件开发为示例:注解Authorize用来描述这是一个付费的插件,而代码

Code Block
PluginLicense pluginLicense = PluginLicenseManager.getInstance().getPluginLicenseByID(Constants.PLUGIN_ID);
if (pluginLicenseif (PluginContexts.currentContext().isAvailable()) {
    // 做认证通过的事情
} else {
    // 做认证未通过的事情
} 

...

Code Block
title主题示例实现
collapsetrue
@Authorize(callSignKey = Constants.PLUING_ID)
public class ThemeGreen extends AbstractThemeVariousProvider {

    @Override
    public String name() {
        return "AcrossGreen";
    }

    @Override
    public String text() {
        return "横向目录";
    }

    @Override
    public String coverPath() {
        return "/com/fr/solution/theme/green/files/cover.png";
    }

    @Override
    public String scriptPath() {
        PluginLicense pluginLicense = PluginLicenseManager.getInstance().getPluginLicenseByID(MongoConstants.PLUGIN_ID);
        if (pluginLicenseif (PluginContexts.currentContext().isAvailable()) {
            return "/com/fr/solution/theme/green/files/theme.js";
        } else {
            return "";
        }
    }

    @Override
    public String stylePath() {
        PluginLicense pluginLicense = PluginLicenseManager.getInstance().getPluginLicenseByID(MongoConstants.PLUGIN_ID);
        if (pluginLicenseif (PluginContexts.currentContext().isAvailable()) {
            return "/com/fr/solution/theme/green/files/style.css";
        } else {
            return "";
        }
    }
}

...