From 908d71ad7ead9b6f1e3bb11df11c728142a524c3 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Tue, 27 Jun 2017 19:28:27 +0800 Subject: [PATCH] =?UTF-8?q?bug=20fix=20=E4=BB=A3=E7=A0=81=E8=B4=A8?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/AlphaFineConstants.java | 9 ++-- .../alphafine/cell/model/MoreModel.java | 41 ++----------------- .../alphafine/component/AlphaFineDialog.java | 4 +- .../manager/RecommendSearchManager.java | 5 +-- 4 files changed, 13 insertions(+), 46 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/AlphaFineConstants.java b/designer/src/com/fr/design/mainframe/alphafine/AlphaFineConstants.java index 4e7c817c4a..d5b4ed2981 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/AlphaFineConstants.java +++ b/designer/src/com/fr/design/mainframe/alphafine/AlphaFineConstants.java @@ -81,9 +81,12 @@ public class AlphaFineConstants { public static final String PLUGIN_IMAGE_URL = "http://shopres.finereport.com/"; - public static final String SERVER_URL = "http://cloud.fanruan.com/api/monitor/record_of_afsearch/single"; + public static final String CLOUD_SERVER_URL = "http://cloud.fanruan.com/api/monitor/record_of_afsearch/single"; - //TODO:先用本地服务器测试一下,避免影响云中心正常信息收集 - public static final String CLOUD_TEST_URL = "http://localhost:8080/cloud/monitor/record_of_afsearch/single"; + public static final String SEARCHAPI = "http://lcloud.fanruan.com/api/intelligence/search/recommend?searchKey="; + + //private static final String SEARCHAPI = "http://localhost:8080/cloud/intelligence/search/recommend?searchKey="; + + //public static final String CLOUD_TEST_URL = "http://localhost:8080/cloud/monitor/record_of_afsearch/single"; } diff --git a/designer/src/com/fr/design/mainframe/alphafine/cell/model/MoreModel.java b/designer/src/com/fr/design/mainframe/alphafine/cell/model/MoreModel.java index e11f45cb43..1257c6aaeb 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/cell/model/MoreModel.java +++ b/designer/src/com/fr/design/mainframe/alphafine/cell/model/MoreModel.java @@ -8,43 +8,24 @@ import com.fr.json.JSONObject; * Created by XiaXiang on 2017/4/20. */ public class MoreModel extends AlphaCellModel { - private String name; private boolean needMore; - private String content; - private CellType type; private boolean isLoading; public MoreModel(String name, String content, boolean needMore, CellType type) { - this.name = name; + super(name, content, type); this.needMore = needMore; - this.content = content; - this.type = type; } public MoreModel(String name, CellType type) { - this.name = name; + super(name, null, type); this.needMore = false; - this.type = type; - } - - public MoreModel(String name) { - this.name = name; - this.isLoading = true; } public MoreModel(String name, boolean isLoading) { - this.name = name; + super(name, null); this.isLoading = isLoading; } - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - public boolean isNeedMore() { return needMore; } @@ -53,14 +34,6 @@ public class MoreModel extends AlphaCellModel { this.needMore = needMore; } - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - @Override public JSONObject ModelToJson() throws JSONException { return null; @@ -76,14 +49,6 @@ public class MoreModel extends AlphaCellModel { } - public CellType getType() { - return type; - } - - public void setType(CellType type) { - this.type = type; - } - public boolean isLoading() { return isLoading; } diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index edf5c3fe98..4f2d9f0cda 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -257,7 +257,7 @@ public class AlphaFineDialog extends UIDialog { */ private void initSearchResultComponents() { searchResultList = new AlphaFineList(); - //searchResultList.setFixedCellHeight(AlphaFineConstants.CELL_HEIGHT); + searchResultList.setFixedCellHeight(AlphaFineConstants.CELL_HEIGHT); searchListModel = new SearchListModel(new SearchResult()); searchResultList.setModel(searchListModel); searchResultPane = new JPanel(); @@ -686,7 +686,7 @@ public class AlphaFineDialog extends UIDialog { String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime()); para.put("token", CodeUtils.md5Encode(date, "", "MD5")); para.put("content", object.toString()); - HttpClient httpClient = new HttpClient(AlphaFineConstants.CLOUD_TEST_URL, para, true); + HttpClient httpClient = new HttpClient(AlphaFineConstants.CLOUD_SERVER_URL, para, true); httpClient.setTimeout(5000); httpClient.asGet(); if (!httpClient.isServerAlive()) { diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java index d5ffd61e55..4f7051bc01 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.alphafine.search.manager; import com.fr.design.DesignerEnvManager; +import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.CellType; import com.fr.design.mainframe.alphafine.cell.CellModelHelper; @@ -24,8 +25,6 @@ import java.util.List; * Created by XiaXiang on 2017/3/31. */ public class RecommendSearchManager implements AlphaFineSearchProcessor { - //todo:for test - private static final String SEARCHAPI = "http://localhost:8080/cloud/intelligence/search/recommend?searchKey="; private static RecommendSearchManager recommendSearchManager = null; private SearchResult modelList; private List recommendModelList = new ArrayList<>(); @@ -43,7 +42,7 @@ public class RecommendSearchManager implements AlphaFineSearchProcessor { this.recommendModelList = new ArrayList<>(); if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainRecommend()) { String result; - HttpClient httpClient = new HttpClient(SEARCHAPI + CodeUtils.cjkEncode(searchText)); + HttpClient httpClient = new HttpClient(AlphaFineConstants.SEARCHAPI + CodeUtils.cjkEncode(searchText)); httpClient.asGet(); httpClient.setTimeout(5000); if (!httpClient.isServerAlive()) {