Compare commits

..

No commits in common. 'master' and 'master' have entirely different histories.

  1. 4
      pom.xml
  2. 23
      src/main/java/com/fanruan/api/conf/MarketConfigKit.java
  3. 50
      src/main/java/com/fanruan/api/design/DesignKit.java
  4. 9
      src/main/java/com/fanruan/api/macro/ProductConstants.java
  5. 60
      src/main/java/com/fanruan/api/net/http/HttpKit.java
  6. 9
      src/main/java/com/fanruan/api/runtime/EnvKit.java

4
pom.xml

@ -176,7 +176,7 @@
<repository>
<id>fanruan</id>
<name>fanruan</name>
<url>https://mvn.fanruan.com/repository/maven-public/</url>
<url>http://mvn.finedevelop.com/repository/maven-public/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
@ -188,7 +188,7 @@
<pluginRepository>
<id>fanruan</id>
<name>fanruan</name>
<url>https://mvn.fanruan.com/repository/maven-public/</url>
<url>http://mvn.finedevelop.com/repository/maven-public/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>

23
src/main/java/com/fanruan/api/conf/MarketConfigKit.java

@ -1,23 +0,0 @@
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 long getUserId() {
return MarketConfig.getInstance().getBbsUid();
}
}

50
src/main/java/com/fanruan/api/design/DesignKit.java

@ -1,8 +1,5 @@
package com.fanruan.api.design;
import com.fr.base.io.BaseBook;
import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.JTemplateProvider;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.base.TableData;
import com.fr.design.DesignModelAdapter;
@ -15,7 +12,6 @@ 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;
@ -68,43 +64,6 @@ public class DesignKit {
return HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
}
/**
* 获取当前正在编辑的模板的ID
*
* @return 正在编辑的模板的ID
*/
public static String getCurrentEditingTemplateId() {
return getCurrentEditingTemplate().getTarget().getTemplateID();
}
/**
* 获取指定模板的ID
*
* @param template 指定模板
* @return 模板ID
*/
public static String getTemplateId(JTemplateProvider template) {
return ((BaseBook) template.getTarget()).getTemplateID();
}
/**
* 获取设计器ID
*
* @return 设计器ID
*/
public static String getDesignerId() {
return DesignerEnvManager.getEnvManager().getUUID();
}
/**
* 获取注册码
*
* @return 注册码
*/
public static String getActivationKey() {
return DesignerEnvManager.getEnvManager().getActivationKey();
}
/**
* 根据名字获取已经定义的bean对象
*
@ -138,13 +97,4 @@ 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,13 +16,4 @@ 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();
}
}

60
src/main/java/com/fanruan/api/net/http/HttpKit.java

@ -1,12 +1,20 @@
package com.fanruan.api.net.http;
import com.fanruan.api.log.LogKit;
import com.fanruan.api.macro.EncodeConstants;
import com.fanruan.api.log.LogKit;
import com.fanruan.api.net.http.rs.BaseHttpResponseHandle;
import com.fanruan.api.net.http.rs.HttpRequest;
import com.fanruan.api.net.http.rs.*;
import com.fr.json.JSONObject;
import com.fanruan.api.net.http.rs.HttpRequestType;
import com.fanruan.api.net.http.rs.HttpResponseType;
import com.fanruan.api.net.http.rs.StreamResponseHandle;
import com.fanruan.api.net.http.rs.TextResponseHandle;
import com.fanruan.api.net.http.rs.UploadResponseHandle;
import com.fr.third.guava.collect.Maps;
import com.fr.third.org.apache.http.*;
import com.fr.third.org.apache.http.HttpEntity;
import com.fr.third.org.apache.http.HttpEntityEnclosingRequest;
import com.fr.third.org.apache.http.HttpHost;
import com.fr.third.org.apache.http.NameValuePair;
import com.fr.third.org.apache.http.NoHttpResponseException;
import com.fr.third.org.apache.http.client.HttpRequestRetryHandler;
import com.fr.third.org.apache.http.client.config.RequestConfig;
import com.fr.third.org.apache.http.client.entity.UrlEncodedFormEntity;
@ -23,7 +31,6 @@ import com.fr.third.org.apache.http.conn.socket.LayeredConnectionSocketFactory;
import com.fr.third.org.apache.http.conn.socket.PlainConnectionSocketFactory;
import com.fr.third.org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import com.fr.third.org.apache.http.entity.FileEntity;
import com.fr.third.org.apache.http.entity.StringEntity;
import com.fr.third.org.apache.http.entity.mime.HttpMultipartMode;
import com.fr.third.org.apache.http.entity.mime.MultipartEntityBuilder;
import com.fr.third.org.apache.http.impl.client.CloseableHttpClient;
@ -38,13 +45,20 @@ import org.jetbrains.annotations.Nullable;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLHandshakeException;
import java.io.*;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLEncoder;
import java.net.UnknownHostException;
import java.nio.charset.Charset;
import java.util.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import static com.fanruan.api.net.http.rs.HttpRequestType.POST;
@ -191,30 +205,6 @@ public class HttpKit {
});
}
/**
* 发起POST JSON请求并获取返回的文本
*
* @param url 响应请求的的服务器地址
* @param params POST请求的参数
* @return 服务器返回的文本内容
*/
public static String postJSON(String url, JSONObject params, Map<String, String> headers) throws IOException {
StringEntity jsonEntity = new StringEntity(params.toString(), "UTF-8");
jsonEntity.setContentEncoding("UTF-8");
if (headers != null) {
headers.put("Content-Type", "application/json");
} else {
headers = new HashMap<>();
headers.put("Content-Type", "application/json");
}
return executeAndParse(HttpRequest
.custom()
.headers(headers)
.url(url)
.post(jsonEntity)
.build());
}
/**
* 发起POST请求并获取返回的文本
*
@ -448,7 +438,6 @@ public class HttpKit {
/**
* 从指定的地址下载文件
*
* @param url 文件下载地址
* @return 文件的字节流
* @throws IOException 下载过程中出现错误则抛出此异常
@ -459,11 +448,10 @@ public class HttpKit {
/**
* 从指定的地址下载文件
*
* @param url 文件下载地址
* @param params 参数对
* @param url 文件下载地址
* @param params 参数对
* @param responseEncoding 响应的文件编码
* @param headers 请求头
* @param headers 请求头
* @return 文件的字节流
* @throws IOException 下载过程中出现错误则抛出此异常
*/

9
src/main/java/com/fanruan/api/runtime/EnvKit.java

@ -48,13 +48,4 @@ public class EnvKit {
public static void checkout() {
SimpleWork.checkOut();
}
/**
* 判断工作目录是否是本地
*
* @return isLocal
*/
public static boolean isLocal() {
return WorkContext.getCurrent().isLocal();
}
}

Loading…
Cancel
Save