Browse Source

Pull request #47: REPORT-50207 埋点插件需要用到的一些后台方法封装到Finekit中

Merge in TC/finekit from ~FANGLEI/finekit:master to master

* commit 'd7b8d629960cc91522c7c84c004b76f67da76743':
  REPORT-50207 埋点插件需要用到的一些后台方法封装到Finekit中
pull/12/head
fanglei 4 years ago
parent
commit
e2e8e2ae9b
  1. 23
      src/main/java/com/fanruan/api/conf/MarketConfigKit.java
  2. 19
      src/main/java/com/fanruan/api/design/DesignKit.java
  3. 9
      src/main/java/com/fanruan/api/macro/ProductConstants.java
  4. 9
      src/main/java/com/fanruan/api/runtime/EnvKit.java

23
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();
}
}

19
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();
}
}

9
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();
}
}

9
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();
}
}

Loading…
Cancel
Save