Browse Source

Merge branch 'release/10.0' of https://code.fineres.com/scm/~kerry/design_10.0 into release/10.0

feature/big-screen
kerry 5 years ago
parent
commit
43d4523e17
  1. 3
      designer-base/src/main/java/com/fr/design/extra/exe/GetPluginCategoriesExecutor.java
  2. 4
      designer-base/src/main/java/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java
  3. 10
      designer-base/src/main/java/com/fr/design/extra/exe/SearchOnlineExecutor.java

3
designer-base/src/main/java/com/fr/design/extra/exe/GetPluginCategoriesExecutor.java

@ -4,6 +4,7 @@ import com.fr.design.extra.PluginConstants;
import com.fr.design.extra.Process; import com.fr.design.extra.Process;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
import com.fr.stable.StringUtils;
/** /**
* Created by vito on 16/5/16. * Created by vito on 16/5/16.
@ -28,7 +29,7 @@ public class GetPluginCategoriesExecutor implements Executor {
@Override @Override
public void run(Process<String> process) { public void run(Process<String> process) {
String url = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.category"); String url = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.category");
if (url != null) { if (StringUtils.isNotEmpty(url)) {
HttpClient httpClient = new HttpClient(url); HttpClient httpClient = new HttpClient(url);
result = httpClient.getResponseText(); result = httpClient.getResponseText();
} else { } else {

4
designer-base/src/main/java/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java

@ -52,7 +52,7 @@ public class GetPluginFromStoreExecutor implements Executor {
@Override @Override
public void run(Process<String> process) { public void run(Process<String> process) {
String plistUrl = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.plist") + "?"; String plistUrl = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.plist");
boolean getRecommend = StringUtils.isEmpty(category) && StringUtils.isEmpty(seller) && StringUtils.isEmpty(fee) && StringUtils.isEmpty(scope); boolean getRecommend = StringUtils.isEmpty(category) && StringUtils.isEmpty(seller) && StringUtils.isEmpty(fee) && StringUtils.isEmpty(scope);
if (getRecommend) { if (getRecommend) {
result = PluginOperateUtils.getRecommendPlugins(); result = PluginOperateUtils.getRecommendPlugins();
@ -61,7 +61,7 @@ public class GetPluginFromStoreExecutor implements Executor {
if (StringUtils.isNotBlank(plistUrl)) { if (StringUtils.isNotBlank(plistUrl)) {
StringBuilder url = new StringBuilder(); StringBuilder url = new StringBuilder();
url.append(plistUrl); url.append(plistUrl).append("?");
PluginOperateUtils.dealParams(url, category, seller, fee, scope); PluginOperateUtils.dealParams(url, category, seller, fee, scope);
try { try {
HttpClient httpClient = new HttpClient(url.toString()); HttpClient httpClient = new HttpClient(url.toString());

10
designer-base/src/main/java/com/fr/design/extra/exe/SearchOnlineExecutor.java

@ -14,8 +14,8 @@ import com.fr.stable.StringUtils;
* Created by vito on 16/4/18. * Created by vito on 16/4/18.
*/ */
public class SearchOnlineExecutor implements Executor { public class SearchOnlineExecutor implements Executor {
private String result = StringUtils.EMPTY; private String result = JSONArray.create().toString();
private String keyword; private final String keyword;
public SearchOnlineExecutor(String keyword) { public SearchOnlineExecutor(String keyword) {
this.keyword = keyword; this.keyword = keyword;
@ -42,7 +42,11 @@ public class SearchOnlineExecutor implements Executor {
result = PluginOperateUtils.getRecommendPlugins(); result = PluginOperateUtils.getRecommendPlugins();
return; return;
} }
HttpClient httpClient = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("shop.plugin.store") + "&keyword=" + keyword); String url = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.store");
if (StringUtils.isEmpty(url)) {
return;
}
HttpClient httpClient = new HttpClient(url + "&keyword=" + keyword);
httpClient.asGet(); httpClient.asGet();
String responseText = httpClient.getResponseText(); String responseText = httpClient.getResponseText();
JSONObject jsonObject = new JSONObject(responseText); JSONObject jsonObject = new JSONObject(responseText);

Loading…
Cancel
Save