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