|
|
|
@ -1,10 +1,13 @@
|
|
|
|
|
package com.fr.design.extra.exe; |
|
|
|
|
|
|
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
|
import com.fr.design.extra.PluginConstants; |
|
|
|
|
import com.fr.design.extra.Process; |
|
|
|
|
import com.fr.general.CloudCenter; |
|
|
|
|
import com.fr.general.http.HttpClient; |
|
|
|
|
import com.fr.general.http.HttpToolbox; |
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import java.util.Locale; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Created by vito on 16/5/16. |
|
|
|
@ -28,14 +31,17 @@ public class GetPluginCategoriesExecutor implements Executor {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void run(Process<String> process) { |
|
|
|
|
String url = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.category"); |
|
|
|
|
Locale locale = DesignerEnvManager.getEnvManager().getLanguage(); |
|
|
|
|
String url = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.category") + "&locale=" + locale.toString(); |
|
|
|
|
if (StringUtils.isNotEmpty(url)) { |
|
|
|
|
HttpClient httpClient = new HttpClient(url); |
|
|
|
|
result = httpClient.getResponseText(); |
|
|
|
|
} else { |
|
|
|
|
result = PluginConstants.CONNECTION_404; |
|
|
|
|
try { |
|
|
|
|
result = HttpToolbox.get(url); |
|
|
|
|
return; |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
result = PluginConstants.CONNECTION_404; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|