Browse Source

提升alphafine代码质量

research/10.0
alex.sung 6 years ago
parent
commit
8548d36a0b
  1. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java
  2. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/ActionModel.java
  3. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/AlphaCellModel.java
  4. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/BottomModel.java
  5. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java
  6. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/FileModel.java
  7. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/MoreModel.java
  8. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/NoResultModel.java
  9. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java
  10. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java
  11. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java
  12. 3
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SegmentationManager.java

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

@ -121,5 +121,7 @@ public class AlphaFineConstants {
public static final String ALPHA_GO_TO_WEB = CloudCenter.getInstance().acquireUrlByKind("af.go_web"); public static final String ALPHA_GO_TO_WEB = CloudCenter.getInstance().acquireUrlByKind("af.go_web");
public static final String CHINESE_CHARACTERS = "[\\u4e00-\\u9fa5]";
} }

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

@ -51,7 +51,7 @@ public class ActionModel extends AlphaCellModel {
} }
@Override @Override
public JSONObject ModelToJson() { public JSONObject modelToJson() {
JSONObject object = JSONObject.create(); JSONObject object = JSONObject.create();
try { try {
JSONObject modelObject = JSONObject.create(); JSONObject modelObject = JSONObject.create();

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

@ -75,7 +75,7 @@ public abstract class AlphaCellModel implements Comparable {
* @return * @return
* @throws JSONException * @throws JSONException
*/ */
abstract public JSONObject ModelToJson() throws JSONException; abstract public JSONObject modelToJson() throws JSONException;
/** /**
* 获取需要保存到云中心的信息 * 获取需要保存到云中心的信息

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

@ -31,7 +31,7 @@ public class BottomModel extends AlphaCellModel {
} }
@Override @Override
public JSONObject ModelToJson() throws JSONException { public JSONObject modelToJson() throws JSONException {
return JSONObject.EMPTY; return JSONObject.EMPTY;
} }

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

@ -40,7 +40,7 @@ public class DocumentModel extends AlphaCellModel {
} }
@Override @Override
public JSONObject ModelToJson() { public JSONObject modelToJson() {
JSONObject object = JSONObject.create(); JSONObject object = JSONObject.create();
try { try {
JSONObject modelObject = JSONObject.create(); JSONObject modelObject = JSONObject.create();

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

@ -35,7 +35,7 @@ public class FileModel extends AlphaCellModel {
} }
@Override @Override
public JSONObject ModelToJson() { public JSONObject modelToJson() {
JSONObject object = JSONObject.create(); JSONObject object = JSONObject.create();
try { try {
JSONObject modelObject = JSONObject.create(); JSONObject modelObject = JSONObject.create();

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

@ -37,7 +37,7 @@ public class MoreModel extends AlphaCellModel {
} }
@Override @Override
public JSONObject ModelToJson() throws JSONException { public JSONObject modelToJson() throws JSONException {
return null; return null;
} }

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

@ -13,7 +13,7 @@ public class NoResultModel extends AlphaCellModel {
} }
@Override @Override
public JSONObject ModelToJson() throws JSONException { public JSONObject modelToJson() throws JSONException {
return null; return null;
} }

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

@ -85,7 +85,7 @@ public class PluginModel extends AlphaCellModel {
} }
@Override @Override
public JSONObject ModelToJson() { public JSONObject modelToJson() {
JSONObject object = JSONObject.create(); JSONObject object = JSONObject.create();
try { try {
JSONObject modelObject = JSONObject.create(); JSONObject modelObject = JSONObject.create();
@ -109,7 +109,7 @@ public class PluginModel extends AlphaCellModel {
if (StringUtils.isBlank(this.pluginId) || !WorkContext.getCurrent().isLocal()) { if (StringUtils.isBlank(this.pluginId) || !WorkContext.getCurrent().isLocal()) {
return; return;
} }
WebViewDlgHelper.showPluginInStore(getName(), "[" + ModelToJson().optString("result") + "]"); WebViewDlgHelper.showPluginInStore(getName(), "[" + modelToJson().optString("result") + "]");
} }
@Override @Override

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

@ -65,7 +65,7 @@ public class RobotModel extends AlphaCellModel {
} }
@Override @Override
public JSONObject ModelToJson() throws JSONException { public JSONObject modelToJson() throws JSONException {
JSONObject object = JSONObject.create(); JSONObject object = JSONObject.create();
try { try {
JSONObject modelObject = JSONObject.create(); JSONObject modelObject = JSONObject.create();

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

@ -138,7 +138,7 @@ public class RecentSearchManager implements AlphaFineSearchProvider {
initWriter(); initWriter();
Document doc = new Document(); Document doc = new Document();
doc.add(new StringField("searchKey", searchKey, Field.Store.YES)); doc.add(new StringField("searchKey", searchKey, Field.Store.YES));
doc.add(new StringField("cellModel", cellModel.ModelToJson().toString(), Field.Store.YES)); doc.add(new StringField("cellModel", cellModel.modelToJson().toString(), Field.Store.YES));
doc.add(new LongField("time", System.currentTimeMillis(), Field.Store.YES)); doc.add(new LongField("time", System.currentTimeMillis(), Field.Store.YES));
writeDoc(doc); writeDoc(doc);
} catch (JSONException e) { } catch (JSONException e) {

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

@ -35,8 +35,7 @@ public class SegmentationManager {
*/ */
public boolean isNeedSegmentation(String searchText) { public boolean isNeedSegmentation(String searchText) {
int count = 0; int count = 0;
String reg = "[\\u4e00-\\u9fa5]"; Pattern p = Pattern.compile(AlphaFineConstants.CHINESE_CHARACTERS);
Pattern p = Pattern.compile(reg);
Matcher m = p.matcher(searchText); Matcher m = p.matcher(searchText);
while (m.find()) { while (m.find()) {
for (int i = 0; i <= m.groupCount(); i++) { for (int i = 0; i <= m.groupCount(); i++) {

Loading…
Cancel
Save