Browse Source

REPORT-81246【运营产品化二期10.0】模板商城断网后的刷新点击无反应(联网后仍存在报错)

修改云端常量的获取方式
security/10.0
Link.Zhao 2 years ago
parent
commit
787ed070ab
  1. 147
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java
  2. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/BottomModel.java
  3. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java
  4. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java
  5. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java
  6. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  7. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java
  8. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java
  9. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java
  10. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java
  11. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java
  12. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java
  13. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java
  14. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java
  15. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java
  16. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java
  17. 4
      designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java

147
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java

@ -4,7 +4,7 @@ import com.fr.general.CloudCenter;
/** /**
* 需要从云端获取的常量单独放一起 * 需要从云端获取的常量单独放一起
* 以防AlphaFineConstants被加载时CloudCenter还没启动导致常量获取不到 * 每次获取的时候都去加载一次
* *
* @author Link * @author Link
* @version 11.0 * @version 11.0
@ -12,54 +12,149 @@ import com.fr.general.CloudCenter;
*/ */
public class AlphaFineCloudConstants { public class AlphaFineCloudConstants {
public static final String PLUGIN_SEARCH_URL = CloudCenter.getInstance().acquireUrlByKind("plugin.searchAPI"); /**
* get PluginSearchUrl
*/
public static String getPluginSearchUrl() {
return CloudCenter.getInstance().acquireUrlByKind("plugin.searchAPI");
}
public static final String PLUGIN_URL = CloudCenter.getInstance().acquireUrlByKind("af.pluginInfo"); /**
* get PLUGIN_URL
*/
public static String getPluginUrl() {
return CloudCenter.getInstance().acquireUrlByKind("af.pluginInfo");
}
public static final String REUSE_URL = CloudCenter.getInstance().acquireUrlByKind("af.reuseInfo"); /**
* get REUSE_URL
*/
public static String getReuseUrl() {
return CloudCenter.getInstance().acquireUrlByKind("af.reuseInfo");
}
public static final String DOCUMENT_DOC_URL = CloudCenter.getInstance().acquireUrlByKind("af.doc_view"); /**
* get DOCUMENT_DOC_URL
*/
public static String getDocumentDocUrl() {
return CloudCenter.getInstance().acquireUrlByKind("af.doc_view");
}
public static final String DOCUMENT_SEARCH_URL = CloudCenter.getInstance().acquireUrlByKind("af.doc_search"); /**
* get DOCUMENT_SEARCH_URL
*/
public static String getDocumentSearchUrl() {
return CloudCenter.getInstance().acquireUrlByKind("af.doc_search");
}
public static final String DOCUMENT_INFORMATION_URL = CloudCenter.getInstance().acquireUrlByKind("af.doc_info"); /**
* get DOCUMENT_INFORMATION_URL
*/
public static String getDocumentInformationUrl() {
return CloudCenter.getInstance().acquireUrlByKind("af.doc_info");
}
public static final String PLUGIN_IMAGE_URL = CloudCenter.getInstance().acquireUrlByKind("af.plugin_image"); /**
* get PLUGIN_IMAGE_URL
*/
public static String getPluginImageUrl() {
return CloudCenter.getInstance().acquireUrlByKind("af.plugin_image");
}
public static final String CLOUD_SERVER_URL = CloudCenter.getInstance().acquireUrlByKind("af.record"); /**
* get CLOUD_SERVER_URL
*/
public static String getCloudServerUrl() {
return CloudCenter.getInstance().acquireUrlByKind("af.record");
}
public static final String SEARCH_API = CloudCenter.getInstance().acquireUrlByKind("af.cloud_search"); /**
* get SEARCH_API
*/
public static String getSearchApi() {
return CloudCenter.getInstance().acquireUrlByKind("af.cloud_search");
}
public static final String SIMILAR_SEARCH_URL_PREFIX = CloudCenter.getInstance().acquireUrlByKind("af.similar_search"); /**
* get SIMILAR_SEARCH_URL_PREFIX
*/
public static String getSimilarSearchUrlPrefix() {
return CloudCenter.getInstance().acquireUrlByKind("af.similar_search");
}
public static final String COMPLEMENT_ADVICE_SEARCH_URL_PREFIX = CloudCenter.getInstance().acquireUrlByKind("af.advice_search"); /**
* get COMPLEMENT_ADVICE_SEARCH_URL_PREFIX
*/
public static String getComplementAdviceSearchUrlPrefix() {
return CloudCenter.getInstance().acquireUrlByKind("af.advice_search");
}
public static final String ALPHA_HOT_SEARCH = CloudCenter.getInstance().acquireUrlByKind("af.hot_search"); /**
* get ALPHA_HOT_SEARCH
*/
public static String getAlphaHotSearch() {
return CloudCenter.getInstance().acquireUrlByKind("af.hot_search");
}
public static final String ALPHA_GO_TO_FORUM = CloudCenter.getInstance().acquireUrlByKind("af.go_fourm"); /**
* get ALPHA_GO_TO_FORUM
*/
public static String getAlphaGoToForum() {
return CloudCenter.getInstance().acquireUrlByKind("af.go_fourm");
}
public static final String ALPHA_GO_TO_WEB = CloudCenter.getInstance().acquireUrlByKind("af.go_web"); /**
* get ALPHA_GO_TO_WEB
*/
public static String getAlphaGoToWeb() {
return CloudCenter.getInstance().acquireUrlByKind("af.go_web");
}
public static final String ALPHA_PREVIEW = CloudCenter.getInstance().acquireUrlByKind("af.preview"); /**
* get ALPHA_PREVIEW
*/
public static String getAlphaPreview() {
return CloudCenter.getInstance().acquireUrlByKind("af.preview");
}
public static final String ALPHA_CID = CloudCenter.getInstance().acquireUrlByKind("af.cid.new"); /**
* get ALPHA_CID
*/
public static String getAlphaCid() {
return CloudCenter.getInstance().acquireUrlByKind("af.cid.new");
}
public static final String ALPHA_CID_USER_GROUP_INFO = CloudCenter.getInstance().acquireUrlByKind("af.cid.user.group.info"); /**
* get ALPHA_CID_USER_GROUP_INFO
*/
public static String getAlphaCidUserGroupInfo() {
return CloudCenter.getInstance().acquireUrlByKind("af.cid.user.group.info");
}
private static final String QUICK_START_URL = CloudCenter.getInstance().acquireUrlByKind("af.help.quick.start"); /**
* get ALPHA_HELP_RECOMMEND
*/
public static String getAlphaHelpRecommend() {
String QUICK_START_URL = CloudCenter.getInstance().acquireUrlByKind("af.help.quick.start");
private static final String REPORT_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.report.learning.path"); String REPORT_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.report.learning.path");
private static final String PARAMETER_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.param.learning.path"); String PARAMETER_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.param.learning.path");
private static final String FILL_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.fill.learning.path"); String FILL_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.fill.learning.path");
private static final String API_SUMMARY = CloudCenter.getInstance().acquireUrlByKind("af.help.api.summary"); String API_SUMMARY = CloudCenter.getInstance().acquireUrlByKind("af.help.api.summary");
private static final String MONTHLY_DOCUMENT = CloudCenter.getInstance().acquireUrlByKind("af.help.monthly.document"); String MONTHLY_DOCUMENT = CloudCenter.getInstance().acquireUrlByKind("af.help.monthly.document");
private static final String DEFAULT_RECOMMEND = "[ { \"name\":\"快速入门指南\", \"link\":\"" + QUICK_START_URL + "\" }, { \"name\":\"报表应用学习路径\", \"link\":\"" + REPORT_LEARNING_PATH + "\" }, { \"name\":\"参数应用学习路径\", \"link\":\"" + PARAMETER_LEARNING_PATH + "\" }, { \"name\":\"填报学习路径\", \"link\":\"" + FILL_LEARNING_PATH + "\" }, { \"name\":\"API接口汇总\", \"link\":\"" + API_SUMMARY + "\" }, { \"name\":\"文档月刊\", \"link\":\"" + MONTHLY_DOCUMENT + "\" } ]"; String DEFAULT_RECOMMEND = "[ {\"name\":\"快速入门指南\", \"link\":\"" + QUICK_START_URL + "\"}," +
"{\"name\":\"报表应用学习路径\", \"link\":\"" + REPORT_LEARNING_PATH + "\"}," +
"{\"name\":\"参数应用学习路径\", \"link\":\"" + PARAMETER_LEARNING_PATH + "\"}," +
"{\"name\":\"填报学习路径\", \"link\":\"" + FILL_LEARNING_PATH + "\"}," +
"{\"name\":\"API接口汇总\", \"link\":\"" + API_SUMMARY + "\"}," +
"{\"name\":\"文档月刊\", \"link\":\"" + MONTHLY_DOCUMENT + "\"} ]";
public static final String ALPHA_HELP_RECOMMEND = CloudCenter.getInstance().acquireUrlByKind("af.recommend", DEFAULT_RECOMMEND); return CloudCenter.getInstance().acquireUrlByKind("af.recommend", DEFAULT_RECOMMEND);
}
} }

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/BottomModel.java

@ -48,7 +48,7 @@ public class BottomModel extends AlphaCellModel {
@Override @Override
public void doAction() { public void doAction() {
try { try {
Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.ALPHA_GO_TO_FORUM)); Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.getAlphaGoToForum()));
} catch (IOException | URISyntaxException e) { } catch (IOException | URISyntaxException e) {
FineLoggerFactory.getLogger().error(e.getMessage()); FineLoggerFactory.getLogger().error(e.getMessage());
} }

4
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java

@ -26,8 +26,8 @@ public class DocumentModel extends AlphaCellModel {
public DocumentModel(String name, String content, int documentId) { public DocumentModel(String name, String content, int documentId) {
super(name, content, CellType.DOCUMENT); super(name, content, CellType.DOCUMENT);
this.documentId = documentId; this.documentId = documentId;
this.informationUrl = AlphaFineCloudConstants.DOCUMENT_INFORMATION_URL + documentId; this.informationUrl = AlphaFineCloudConstants.getDocumentInformationUrl() + documentId;
this.documentUrl = AlphaFineCloudConstants.DOCUMENT_DOC_URL + documentId + ".html"; this.documentUrl = AlphaFineCloudConstants.getDocumentDocUrl() + documentId + ".html";
} }
public DocumentModel(String name, String content, int documentId, int searchCount) { public DocumentModel(String name, String content, int documentId, int searchCount) {

4
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java

@ -36,9 +36,9 @@ public class PluginModel extends AlphaCellModel {
this.price = price; this.price = price;
this.pluginId = pluginId; this.pluginId = pluginId;
if (getType() == CellType.PLUGIN) { if (getType() == CellType.PLUGIN) {
this.informationUrl = AlphaFineCloudConstants.PLUGIN_URL + id; this.informationUrl = AlphaFineCloudConstants.getPluginUrl() + id;
} else { } else {
this.informationUrl = AlphaFineCloudConstants.REUSE_URL + id; this.informationUrl = AlphaFineCloudConstants.getReuseUrl() + id;
} }
} }

4
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java

@ -47,7 +47,7 @@ public class RobotModel extends AlphaCellModel {
public static String getContent(String titleStr) { public static String getContent(String titleStr) {
String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + titleStr); String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + titleStr);
String url = AlphaFineCloudConstants.ALPHA_GO_TO_WEB + titleStr + "&token=" + token; String url = AlphaFineCloudConstants.getAlphaGoToWeb() + titleStr + "&token=" + token;
try { try {
String result = HttpToolbox.get(url); String result = HttpToolbox.get(url);
@ -84,7 +84,7 @@ public class RobotModel extends AlphaCellModel {
@Override @Override
public void doAction() { public void doAction() {
try { try {
Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.ALPHA_PREVIEW + URLEncoder.encode(super.getName(), EncodeConstants.ENCODING_UTF_8))); Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.getAlphaPreview() + URLEncoder.encode(super.getName(), EncodeConstants.ENCODING_UTF_8)));
} catch (IOException e) { } catch (IOException e) {
FineLoggerFactory.getLogger().error(e.getMessage()); FineLoggerFactory.getLogger().error(e.getMessage());
} catch (URISyntaxException e) { } catch (URISyntaxException e) {

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

@ -969,7 +969,7 @@ public class AlphaFineDialog extends UIDialog {
String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime()); String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime());
para.put("token", CodeUtils.md5Encode(date, StringUtils.EMPTY, "MD5")); para.put("token", CodeUtils.md5Encode(date, StringUtils.EMPTY, "MD5"));
para.put("content", object.toString()); para.put("content", object.toString());
HttpClient httpClient = new HttpClient(AlphaFineCloudConstants.CLOUD_SERVER_URL, para, true); HttpClient httpClient = new HttpClient(AlphaFineCloudConstants.getCloudServerUrl(), para, true);
httpClient.asGet(); httpClient.asGet();
if (!httpClient.isServerAlive()) { if (!httpClient.isServerAlive()) {
FineLoggerFactory.getLogger().error("Failed to sent data to server!"); FineLoggerFactory.getLogger().error("Failed to sent data to server!");

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java

@ -98,7 +98,7 @@ public class HelpDocumentNoResultPane extends JPanel {
private Map<String, String> generateMap() { private Map<String, String> generateMap() {
JSONArray jsonArray = JSONFactory.createJSON(JSON.ARRAY, AlphaFineCloudConstants.ALPHA_HELP_RECOMMEND); JSONArray jsonArray = JSONFactory.createJSON(JSON.ARRAY, AlphaFineCloudConstants.getAlphaHelpRecommend());
Map<String, String> linkMap = new LinkedHashMap<>(); Map<String, String> linkMap = new LinkedHashMap<>();
for (int i = 0, len = jsonArray.size(); i < len; i++) { for (int i = 0, len = jsonArray.size(); i < len; i++) {
JSONObject json = jsonArray.getJSONObject(i); JSONObject json = jsonArray.getJSONObject(i);

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java

@ -33,7 +33,7 @@ public class NoResultWithLinkPane extends NoResultPane {
String[] para1 = title.split(TAG_A_START); String[] para1 = title.split(TAG_A_START);
String[] para2 = para1[1].split(TAG_A_END); String[] para2 = para1[1].split(TAG_A_END);
MessageWithLink messageWithLink = new MessageWithLink(para1[0], para2[0], AlphaFineCloudConstants.ALPHA_GO_TO_FORUM, para2[1], Color.WHITE, DesignUtils.getDefaultGUIFont().applySize(14), AlphaFineConstants.MEDIUM_GRAY) { MessageWithLink messageWithLink = new MessageWithLink(para1[0], para2[0], AlphaFineCloudConstants.getAlphaGoToForum(), para2[1], Color.WHITE, DesignUtils.getDefaultGUIFont().applySize(14), AlphaFineConstants.MEDIUM_GRAY) {
@Override @Override
protected void initListener(String link) { protected void initListener(String link) {

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java

@ -61,7 +61,7 @@ public class RobotPreviewPane extends JPanel {
.replaceAll("\\('", StringUtils.EMPTY) .replaceAll("\\('", StringUtils.EMPTY)
.replaceAll("'\\)", StringUtils.EMPTY); .replaceAll("'\\)", StringUtils.EMPTY);
try { try {
Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.ALPHA_PREVIEW + URLEncoder.encode(s, EncodeConstants.ENCODING_UTF_8))); Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.getAlphaPreview() + URLEncoder.encode(s, EncodeConstants.ENCODING_UTF_8)));
} catch (IOException | URISyntaxException e1) { } catch (IOException | URISyntaxException e1) {
FineLoggerFactory.getLogger().error(e1.getMessage()); FineLoggerFactory.getLogger().error(e1.getMessage());
} }

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java

@ -41,7 +41,7 @@ public class ComplementAdviceManager {
SearchResult searchResult = new SearchResult(); SearchResult searchResult = new SearchResult();
for (int j = 0; j < searchText.length; j++) { for (int j = 0; j < searchText.length; j++) {
String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + searchText[j]); String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + searchText[j]);
String url = AlphaFineCloudConstants.COMPLEMENT_ADVICE_SEARCH_URL_PREFIX + "msg=" + searchText[j] + "&token=" + token; String url = AlphaFineCloudConstants.getComplementAdviceSearchUrlPrefix() + "msg=" + searchText[j] + "&token=" + token;
try { try {
String result = HttpToolbox.get(url); String result = HttpToolbox.get(url);
AlphaFineHelper.checkCancel(); AlphaFineHelper.checkCancel();

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java

@ -70,7 +70,7 @@ public class DocumentSearchManager implements AlphaFineSearchProvider {
searchResult = new SearchResult(); searchResult = new SearchResult();
for (int j = 0; j < searchText.length; j++) { for (int j = 0; j < searchText.length; j++) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
String url = AlphaFineCloudConstants.DOCUMENT_SEARCH_URL + searchText[j]; String url = AlphaFineCloudConstants.getDocumentSearchUrl() + searchText[j];
try { try {
String result = HttpToolbox.get(url); String result = HttpToolbox.get(url);
AlphaFineHelper.checkCancel(); AlphaFineHelper.checkCancel();

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java

@ -75,7 +75,7 @@ public class HotIssuesManager {
public String[][] getHotIssues() { public String[][] getHotIssues() {
try { try {
String result = HttpToolbox.get(AlphaFineCloudConstants.ALPHA_HOT_SEARCH); String result = HttpToolbox.get(AlphaFineCloudConstants.getAlphaHotSearch());
JSONArray jsonArray = JSONFactory.createJSON(JSON.ARRAY, result); JSONArray jsonArray = JSONFactory.createJSON(JSON.ARRAY, result);
if(jsonArray != null){ if(jsonArray != null){
for (int i = 0; i < HOT_ITEM_NUM; i++) { for (int i = 0; i < HOT_ITEM_NUM; i++) {

4
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java

@ -60,7 +60,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider {
int searchCount = object.optInt("searchCount"); int searchCount = object.optInt("searchCount");
String imageUrl = null; String imageUrl = null;
try { try {
imageUrl = isFromCloud ? AlphaFineCloudConstants.PLUGIN_IMAGE_URL + URLEncoder.encode(object.optString("pic").toString().substring(AlphaFineCloudConstants.PLUGIN_IMAGE_URL.length()), "utf8") : object.optString("pic"); imageUrl = isFromCloud ? AlphaFineCloudConstants.getPluginImageUrl() + URLEncoder.encode(object.optString("pic").toString().substring(AlphaFineCloudConstants.getPluginImageUrl().length()), "utf8") : object.optString("pic");
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
FineLoggerFactory.getLogger().error("plugin icon error: " + e.getMessage()); FineLoggerFactory.getLogger().error("plugin icon error: " + e.getMessage());
} }
@ -112,7 +112,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider {
for (int j = 0; j < searchText.length; j++) { for (int j = 0; j < searchText.length; j++) {
try { try {
String encodedKey = URLEncoder.encode(searchText[j], EncodeConstants.ENCODING_UTF_8); String encodedKey = URLEncoder.encode(searchText[j], EncodeConstants.ENCODING_UTF_8);
String url = AlphaFineCloudConstants.PLUGIN_SEARCH_URL + "?keyword=" + encodedKey; String url = AlphaFineCloudConstants.getPluginSearchUrl() + "?keyword=" + encodedKey;
String result = HttpToolbox.get(url); String result = HttpToolbox.get(url);
AlphaFineHelper.checkCancel(); AlphaFineHelper.checkCancel();
JSONObject jsonObject = new JSONObject(result); JSONObject jsonObject = new JSONObject(result);

4
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java

@ -82,7 +82,7 @@ public class ProductNewsSearchManager {
public List<ProductNews> getProductNewsList() throws Exception { public List<ProductNews> getProductNewsList() throws Exception {
productNewsList = new ArrayList<>(); productNewsList = new ArrayList<>();
idSet = new HashSet<>(); idSet = new HashSet<>();
String jsonStr = HttpToolbox.get(AlphaFineCloudConstants.ALPHA_CID); String jsonStr = HttpToolbox.get(AlphaFineCloudConstants.getAlphaCid());
AlphaFineHelper.checkCancel(); AlphaFineHelper.checkCancel();
JSONObject cidJSON = JSONFactory.createJSON(JSON.OBJECT, jsonStr); JSONObject cidJSON = JSONFactory.createJSON(JSON.OBJECT, jsonStr);
JSONArray jsonArray = cidJSON.getJSONArray("data"); JSONArray jsonArray = cidJSON.getJSONArray("data");
@ -150,7 +150,7 @@ public class ProductNewsSearchManager {
* 根据用户组id查询用户组信息改用户组中的所有设计器id * 根据用户组id查询用户组信息改用户组中的所有设计器id
* */ * */
private Set<String> searchUserGroupInfo(String userGroupId) { private Set<String> searchUserGroupInfo(String userGroupId) {
String url = AlphaFineCloudConstants.ALPHA_CID_USER_GROUP_INFO + AlphaFineConstants.SEARCH_BY_ID + userGroupId; String url = AlphaFineCloudConstants.getAlphaCidUserGroupInfo() + AlphaFineConstants.SEARCH_BY_ID + userGroupId;
Set<String> idSet = new HashSet<>(); Set<String> idSet = new HashSet<>();
try { try {
String jsonStr = HttpToolbox.get(url); String jsonStr = HttpToolbox.get(url);

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java

@ -60,7 +60,7 @@ public class RecommendSearchManager implements AlphaFineSearchProvider {
for (int j = 0; j < searchText.length; j++) { for (int j = 0; j < searchText.length; j++) {
searchText[j] = searchText[j].replaceAll(StringUtils.BLANK, StringUtils.EMPTY); searchText[j] = searchText[j].replaceAll(StringUtils.BLANK, StringUtils.EMPTY);
try { try {
String url = AlphaFineCloudConstants.SEARCH_API + CodeUtils.cjkEncode(searchText[j]); String url = AlphaFineCloudConstants.getSearchApi() + CodeUtils.cjkEncode(searchText[j]);
String result = HttpToolbox.get(url); String result = HttpToolbox.get(url);
AlphaFineHelper.checkCancel(); AlphaFineHelper.checkCancel();
JSONObject jsonObject = new JSONObject(result); JSONObject jsonObject = new JSONObject(result);

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java

@ -48,7 +48,7 @@ public class SimilarSearchManager implements AlphaFineSearchProvider {
SearchResult allModelList = new SearchResult(); SearchResult allModelList = new SearchResult();
for (int j = 0; j < searchText.length; j++) { for (int j = 0; j < searchText.length; j++) {
String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + searchText[j]); String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + searchText[j]);
String url = AlphaFineCloudConstants.SIMILAR_SEARCH_URL_PREFIX + "msg=" + searchText[j] + "&token=" + token; String url = AlphaFineCloudConstants.getSimilarSearchUrlPrefix() + "msg=" + searchText[j] + "&token=" + token;
try { try {
String result = HttpToolbox.get(url); String result = HttpToolbox.get(url);
AlphaFineHelper.checkCancel(); AlphaFineHelper.checkCancel();

4
designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java

@ -14,8 +14,8 @@ public class ModelTest {
Assert.assertEquals("name", documentModel.getName()); Assert.assertEquals("name", documentModel.getName());
Assert.assertEquals("content", documentModel.getContent()); Assert.assertEquals("content", documentModel.getContent());
Assert.assertEquals(1, documentModel.getDocumentId()); Assert.assertEquals(1, documentModel.getDocumentId());
Assert.assertEquals(AlphaFineCloudConstants.DOCUMENT_DOC_URL + documentModel.getDocumentId() + ".html", documentModel.getDocumentUrl()); Assert.assertEquals(AlphaFineCloudConstants.getDocumentDocUrl() + documentModel.getDocumentId() + ".html", documentModel.getDocumentUrl());
Assert.assertEquals(AlphaFineCloudConstants.DOCUMENT_INFORMATION_URL + documentModel.getDocumentId(), documentModel.getInformationUrl()); Assert.assertEquals(AlphaFineCloudConstants.getDocumentInformationUrl() + documentModel.getDocumentId(), documentModel.getInformationUrl());
Assert.assertEquals(documentModel.getStoreInformation(), documentModel.getInformationUrl()); Assert.assertEquals(documentModel.getStoreInformation(), documentModel.getInformationUrl());
Assert.assertEquals(CellType.DOCUMENT, documentModel.getType()); Assert.assertEquals(CellType.DOCUMENT, documentModel.getType());
Assert.assertEquals(true, documentModel.hasAction()); Assert.assertEquals(true, documentModel.hasAction());

Loading…
Cancel
Save