mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-22 16:03:15 +00:00
getRecentDocument実装
This commit is contained in:
parent
1c3fdf921d
commit
e0d63122bd
|
@ -1,14 +1,19 @@
|
||||||
package one.nem.lacerta.data.impl;
|
package one.nem.lacerta.data.impl;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import one.nem.lacerta.data.LacertaLibrary;
|
import one.nem.lacerta.data.LacertaLibrary;
|
||||||
import one.nem.lacerta.model.LibraryItemPage;
|
import one.nem.lacerta.model.LibraryItemPage;
|
||||||
import one.nem.lacerta.model.ListItem;
|
import one.nem.lacerta.model.ListItem;
|
||||||
|
import one.nem.lacerta.model.ListItemType;
|
||||||
import one.nem.lacerta.model.document.DocumentDetail;
|
import one.nem.lacerta.model.document.DocumentDetail;
|
||||||
import one.nem.lacerta.source.database.LacertaDatabase;
|
import one.nem.lacerta.source.database.LacertaDatabase;
|
||||||
|
import one.nem.lacerta.source.database.common.DateTypeConverter;
|
||||||
|
import one.nem.lacerta.source.database.entity.DocumentEntity;
|
||||||
import one.nem.lacerta.utils.LacertaLogger;
|
import one.nem.lacerta.utils.LacertaLogger;
|
||||||
|
|
||||||
public class LacertaLibraryImpl implements LacertaLibrary {
|
public class LacertaLibraryImpl implements LacertaLibrary {
|
||||||
|
@ -21,12 +26,23 @@ public class LacertaLibraryImpl implements LacertaLibrary {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ArrayList<ListItem> getRecentDocument(int limit) {
|
public ArrayList<ListItem> getRecentDocument(int limit) {
|
||||||
return null;
|
List<DocumentEntity> documentEntities = database.documentDao().getRecentDocument(limit);
|
||||||
|
|
||||||
|
ArrayList<ListItem> listItems = new ArrayList<>();
|
||||||
|
for (DocumentEntity documentEntity : documentEntities) {
|
||||||
|
ListItem listItem = new ListItem();
|
||||||
|
listItem.setItemType(ListItemType.ITEM_TYPE_DOCUMENT);
|
||||||
|
listItem.setTitle(documentEntity.title);
|
||||||
|
listItem.setDescription(DateFormat.getDateInstance().format(documentEntity.updatedAt));
|
||||||
|
listItem.setItemId(documentEntity.id);
|
||||||
|
listItems.add(listItem);
|
||||||
|
}
|
||||||
|
return listItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ArrayList<ListItem> getRecentDocument(int limit, int offset) {
|
public ArrayList<ListItem> getRecentDocument(int limit, int offset) {
|
||||||
return null;
|
return null; // TODO-rca: Implement
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue
Block a user