From d7b8d629960cc91522c7c84c004b76f67da76743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 23 Apr 2021 17:54:04 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-50207=20=E5=9F=8B=E7=82=B9=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E9=9C=80=E8=A6=81=E7=94=A8=E5=88=B0=E7=9A=84=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E5=90=8E=E5=8F=B0=E6=96=B9=E6=B3=95=E5=B0=81=E8=A3=85?= =?UTF-8?q?=E5=88=B0Finekit=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fanruan/api/conf/MarketConfigKit.java | 23 +++++++++++++++++++ .../com/fanruan/api/design/DesignKit.java | 19 +++++++++++++++ .../fanruan/api/macro/ProductConstants.java | 9 ++++++++ .../java/com/fanruan/api/runtime/EnvKit.java | 9 ++++++++ 4 files changed, 60 insertions(+) create mode 100644 src/main/java/com/fanruan/api/conf/MarketConfigKit.java diff --git a/src/main/java/com/fanruan/api/conf/MarketConfigKit.java b/src/main/java/com/fanruan/api/conf/MarketConfigKit.java new file mode 100644 index 0000000..998b71b --- /dev/null +++ b/src/main/java/com/fanruan/api/conf/MarketConfigKit.java @@ -0,0 +1,23 @@ +package com.fanruan.api.conf; + +import com.fr.config.MarketConfig; + +public class MarketConfigKit { + /** + * 获取服务器appId + * + * @return appId + */ + public static String getAppId() { + return MarketConfig.getInstance().getCloudOperationMaintenanceId(); + } + + /** + * 获取已登录帆软市场的用户名 + * + * @return userId + */ + public static String getUserId() { + return MarketConfig.getInstance().getBbsUsername(); + } +} diff --git a/src/main/java/com/fanruan/api/design/DesignKit.java b/src/main/java/com/fanruan/api/design/DesignKit.java index 4b95d64..ef1a061 100644 --- a/src/main/java/com/fanruan/api/design/DesignKit.java +++ b/src/main/java/com/fanruan/api/design/DesignKit.java @@ -15,6 +15,7 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerFrame; import com.fr.design.mainframe.HyperlinkGroupPaneActionImpl; import com.fr.design.mainframe.JTemplate; +import com.fr.module.ModuleContext; import javax.swing.JComponent; @@ -95,6 +96,15 @@ public class DesignKit { return DesignerEnvManager.getEnvManager().getUUID(); } + /** + * 获取注册码 + * + * @return 注册码 + */ + public static String getActivationKey() { + return DesignerEnvManager.getEnvManager().getActivationKey(); + } + /** * 根据名字获取已经定义的bean对象 * @@ -128,4 +138,13 @@ public class DesignKit { public static JComponent getWidgetComponent() { return (JComponent) (WidgetPropertyPane.getInstance().getEditingFormDesigner().getSelectionModel().getSelection().getSelectedCreator()).getComponent(0); } + + /** + * 设计器是否启动 + * + * @return isStartup + */ + public static boolean isStartup() { + return ModuleContext.isDesignerStartup(); + } } diff --git a/src/main/java/com/fanruan/api/macro/ProductConstants.java b/src/main/java/com/fanruan/api/macro/ProductConstants.java index ed1637a..4edd462 100644 --- a/src/main/java/com/fanruan/api/macro/ProductConstants.java +++ b/src/main/java/com/fanruan/api/macro/ProductConstants.java @@ -16,4 +16,13 @@ public class ProductConstants { * 大的版本号 */ public static final String MAIN_VERSION = com.fr.stable.ProductConstants.MAIN_VERSION; + + /** + * 获取env路径 + * + * @return env路径 + */ + public static String getEnvHome() { + return com.fr.stable.ProductConstants.getEnvHome(); + } } diff --git a/src/main/java/com/fanruan/api/runtime/EnvKit.java b/src/main/java/com/fanruan/api/runtime/EnvKit.java index 95e6ef2..c36d7c7 100644 --- a/src/main/java/com/fanruan/api/runtime/EnvKit.java +++ b/src/main/java/com/fanruan/api/runtime/EnvKit.java @@ -48,4 +48,13 @@ public class EnvKit { public static void checkout() { SimpleWork.checkOut(); } + + /** + * 判断工作目录是否是本地 + * + * @return isLocal + */ + public static boolean isLocal() { + return WorkContext.getCurrent().isLocal(); + } }