Browse Source

REPORT-45460 帆软市场国际化标签设计器适配

feature/big-screen
Lanlan 4 years ago
parent
commit
acab6692f6
  1. 7
      designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java
  2. 11
      designer-base/src/main/java/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java

7
designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java

@ -128,6 +128,10 @@ public class PluginOperateUtils {
} }
public static void dealParams(StringBuilder url, String category, String seller, String fee, String scope) { public static void dealParams(StringBuilder url, String category, String seller, String fee, String scope) {
dealParams(url, category, seller, fee, StringUtils.EMPTY);
}
public static void dealParams(StringBuilder url, String category, String seller, String fee, String scope, String language) {
if (StringUtils.isNotBlank(category)) { if (StringUtils.isNotBlank(category)) {
url.append("cid=").append(category.split("-")[1]); url.append("cid=").append(category.split("-")[1]);
} else { } else {
@ -169,6 +173,9 @@ public class PluginOperateUtils {
url.append("&scope=").append(StringUtils.EMPTY); url.append("&scope=").append(StringUtils.EMPTY);
} }
} }
if (StringUtils.isNotBlank(language)) {
url.append("&language=").append(language.split("-")[1]);
}
} }
public static void getLoginInfo(JSCallback jsCallback, UILabel uiLabel) { public static void getLoginInfo(JSCallback jsCallback, UILabel uiLabel) {

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

@ -21,19 +21,26 @@ public class GetPluginFromStoreExecutor implements Executor {
private String seller; private String seller;
private String fee; private String fee;
private String scope; private String scope;
private String language;
public GetPluginFromStoreExecutor(JSONObject info) { public GetPluginFromStoreExecutor(JSONObject info) {
this.category = info.optString("categories"); this.category = info.optString("categories");
this.fee = info.optString("fee"); this.fee = info.optString("fee");
this.seller = info.optString("seller"); this.seller = info.optString("seller");
this.scope = info.optString("scope"); this.scope = info.optString("scope");
this.language = info.optString("language");
} }
public GetPluginFromStoreExecutor(String category, String seller, String fee, String scope) { public GetPluginFromStoreExecutor(String category, String seller, String fee, String scope) {
this(category, seller, fee, scope, StringUtils.EMPTY);
}
public GetPluginFromStoreExecutor(String category, String seller, String fee, String scope, String language) {
this.category = category; this.category = category;
this.seller = seller; this.seller = seller;
this.fee = fee; this.fee = fee;
this.scope = scope; this.scope = scope;
this.language = language;
} }
@Override @Override
@ -53,7 +60,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) & StringUtils.isEmpty(language);
if (getRecommend) { if (getRecommend) {
result = PluginOperateUtils.getRecommendPlugins(); result = PluginOperateUtils.getRecommendPlugins();
return; return;
@ -62,7 +69,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).append("?"); url.append(plistUrl).append("?");
PluginOperateUtils.dealParams(url, category, seller, fee, scope); PluginOperateUtils.dealParams(url, category, seller, fee, scope, language);
try { try {
HttpClient httpClient = new HttpClient(url.toString()); HttpClient httpClient = new HttpClient(url.toString());
httpClient.asGet(); httpClient.asGet();

Loading…
Cancel
Save