From 9717e6af3b6548bce6c36af64b0d7c936f74400f Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 3 Dec 2020 10:20:49 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-44390=20alpha-fine=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=B8=AE=E5=8A=A9=E6=96=87=E6=A1=A3=EF=BC=8C=E5=8F=B3=E4=BE=A7?= =?UTF-8?q?=E4=B8=8D=E5=B1=95=E7=A4=BA=E8=AF=A6=E7=BB=86=E5=86=85=E5=AE=B9?= =?UTF-8?q?=EF=BC=8C=E5=8F=AA=E6=98=BE=E7=A4=BA=E6=96=87=E6=A1=A3=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=E3=80=91=E4=B9=8B=E5=89=8D=E7=9A=84=E6=90=9C=E7=B4=A2=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=9C=89=E5=8F=98=E5=8C=96=EF=BC=8C=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E7=BB=93=E6=9E=9C=E9=87=8C=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E8=AF=A6=E6=83=85=E7=9A=84key=E5=80=BC?= =?UTF-8?q?=E4=B9=9F=E5=8F=98=E5=8C=96=E4=BA=86(summary=20=E2=86=92=20cont?= =?UTF-8?q?ent)=EF=BC=8C=E7=84=B6=E5=90=8E=E4=BF=AE=E6=94=B9=E8=BF=87?= =?UTF-8?q?=E7=A8=8B=E4=B8=AD=E5=8F=91=E7=8E=B0"=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E5=B8=B8=E7=94=A8"=E4=B9=9F=E4=B8=8D=E4=BC=9A=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=96=87=E6=A1=A3=E8=AF=A6=E6=83=85=EF=BC=8C=E5=9B=A0?= =?UTF-8?q?=E4=B8=BA=E4=BF=9D=E5=AD=98=E5=88=B0=E6=9C=AC=E5=9C=B0=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=E8=BD=ACjson=E7=9A=84key=E5=80=BC=E9=94=99?= =?UTF-8?q?=E4=BA=86=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF?= =?UTF-8?q?=E3=80=91=E5=B0=86key=E4=BF=AE=E6=94=B9=E4=B8=BA=E7=8E=B0?= =?UTF-8?q?=E5=9C=A8=E4=BD=BF=E7=94=A8=E7=9A=84"content"=EF=BC=8C=E7=84=B6?= =?UTF-8?q?=E5=90=8E=E4=B8=BA=E4=BA=86=E8=AE=A9=E8=AF=BB=E5=92=8C=E5=86=99?= =?UTF-8?q?=E7=9A=84key=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4=EF=BC=8C?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E7=94=A8DocumentModel=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E4=B8=B2=E5=B8=B8=E9=87=8F=E8=A1=A8=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/alphafine/cell/model/DocumentModel.java | 7 ++++++- .../search/manager/impl/DocumentSearchManager.java | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java index 2c608537c..e83b4be76 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java @@ -19,6 +19,11 @@ public class DocumentModel extends AlphaCellModel { private String informationUrl; private int documentId; + public static final String TITLE = "title"; + public static final String CONTENT = "content"; + public static final String DID = "did"; + public static final String SEARCHCOUNT = "searchcount"; + public DocumentModel(String name, String content, int documentId) { super(name, content, CellType.DOCUMENT); this.documentId = documentId; @@ -43,7 +48,7 @@ public class DocumentModel extends AlphaCellModel { public JSONObject modelToJson() { JSONObject object = JSONObject.create(); JSONObject modelObject = JSONObject.create(); - modelObject.put("title", getName()).put("summary", getContent()).put("did", getDocumentId()).put("searchCount", getSearchCount()); + modelObject.put(TITLE, getName()).put(CONTENT, getContent()).put(DID, getDocumentId()).put(SEARCHCOUNT, getSearchCount()); object.put("result", modelObject).put("cellType", getType().getTypeValue()); return object; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java index be3ac4f1b..0b4953083 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java @@ -43,10 +43,10 @@ public class DocumentSearchManager implements AlphaFineSearchProvider { * @return */ public static DocumentModel getModelFromCloud(JSONObject object) { - String name = object.optString("title"); - String content = object.optString("summary"); - int documentId = object.optInt("did"); - int searchCount = object.optInt("searchCount"); + String name = object.optString(DocumentModel.TITLE); + String content = object.optString(DocumentModel.CONTENT); + int documentId = object.optInt(DocumentModel.DID); + int searchCount = object.optInt(DocumentModel.SEARCHCOUNT); return new DocumentModel(name, content, documentId, searchCount); }