mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-22 16:03:15 +00:00
getAppliedTagList実装
This commit is contained in:
parent
23489e20c6
commit
6ed09e6103
|
@ -35,6 +35,8 @@ public interface LacertaLibrary {
|
|||
// Tag
|
||||
CompletableFuture<ArrayList<DocumentTag>> getTagList();
|
||||
|
||||
CompletableFuture<ArrayList<DocumentTag>> getAppliedTagList(String documentId);
|
||||
|
||||
CompletableFuture<Void> createTag(DocumentTag tag);
|
||||
|
||||
CompletableFuture<Void> updateTag(DocumentTag tag);
|
||||
|
|
|
@ -248,6 +248,22 @@ public class LacertaLibraryImpl implements LacertaLibrary {
|
|||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<ArrayList<DocumentTag>> getAppliedTagList(String documentId) {
|
||||
return CompletableFuture.supplyAsync(() -> {
|
||||
List<ToxiDocumentTagEntity> toxiDocumentTagEntities = database.toxiDocumentTagDao().findByDocumentId(documentId);
|
||||
logger.debug("LacertaLibraryImpl", "Database Query: Get ToxiDocumentTagEntity List (Size: " + toxiDocumentTagEntities.size() + ")");
|
||||
ArrayList<DocumentTag> documentTags = new ArrayList<>();
|
||||
for (ToxiDocumentTagEntity toxiDocumentTagEntity : toxiDocumentTagEntities) {
|
||||
TagEntity tagEntity = database.tagDao().findById(toxiDocumentTagEntity.tagId);
|
||||
if (tagEntity != null) {
|
||||
documentTags.add(convertTagEntityToDocumentTag(tagEntity));
|
||||
}
|
||||
}
|
||||
return documentTags;
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Void> createTag(DocumentTag tag) {
|
||||
return CompletableFuture.supplyAsync(() -> {
|
||||
|
|
Loading…
Reference in New Issue
Block a user