|
|
@ -39,8 +39,8 @@ public class PluginSearchManager implements AlphaFineSearchProvider { |
|
|
|
private SearchResult searchResult; |
|
|
|
private SearchResult searchResult; |
|
|
|
private SearchResult defaultModelList; |
|
|
|
private SearchResult defaultModelList; |
|
|
|
|
|
|
|
|
|
|
|
private static final int defaultListSize = 10; |
|
|
|
private static final int DEFAULT_LIST_SIZE = 10; |
|
|
|
private static final String timeFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"; |
|
|
|
private static final String TIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"; |
|
|
|
|
|
|
|
|
|
|
|
private static final String UPLOAD_TIME = "uploadTime"; |
|
|
|
private static final String UPLOAD_TIME = "uploadTime"; |
|
|
|
|
|
|
|
|
|
|
@ -200,12 +200,12 @@ public class PluginSearchManager implements AlphaFineSearchProvider { |
|
|
|
List<PluginModel> parseDefaultPluginModel(List<Map> jsonObjects) { |
|
|
|
List<PluginModel> parseDefaultPluginModel(List<Map> jsonObjects) { |
|
|
|
List<PluginModel> pluginModels = new ArrayList<>(); |
|
|
|
List<PluginModel> pluginModels = new ArrayList<>(); |
|
|
|
if (!Collections.isEmpty(jsonObjects)) { |
|
|
|
if (!Collections.isEmpty(jsonObjects)) { |
|
|
|
SimpleDateFormat format = new SimpleDateFormat(timeFormat); |
|
|
|
SimpleDateFormat format = new SimpleDateFormat(TIME_FORMAT); |
|
|
|
try { |
|
|
|
try { |
|
|
|
jsonObjects.sort(Comparator.comparingLong(new ToLongFunction<Map>() { |
|
|
|
jsonObjects.sort(Comparator.comparingLong(new ToLongFunction<Map>() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public long applyAsLong(Map value) { |
|
|
|
public long applyAsLong(Map value) { |
|
|
|
Long time = 0l; |
|
|
|
long time = 0L; |
|
|
|
try { |
|
|
|
try { |
|
|
|
time = format.parse((String) value.get(UPLOAD_TIME)).getTime(); |
|
|
|
time = format.parse((String) value.get(UPLOAD_TIME)).getTime(); |
|
|
|
} catch (ParseException e) { |
|
|
|
} catch (ParseException e) { |
|
|
@ -217,7 +217,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider { |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
FineLoggerFactory.getLogger().error(e, e.getMessage()); |
|
|
|
FineLoggerFactory.getLogger().error(e, e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
for (int i = 0; i < defaultListSize; i++) { |
|
|
|
for (int i = 0; i < DEFAULT_LIST_SIZE; i++) { |
|
|
|
pluginModels.add(getPluginModel(new JSONObject(jsonObjects.get(i)), false)); |
|
|
|
pluginModels.add(getPluginModel(new JSONObject(jsonObjects.get(i)), false)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|