mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
applyTagListToDocument実装
This commit is contained in:
parent
b32ce60ad8
commit
1e0ba33519
|
@ -45,6 +45,8 @@ public interface LacertaLibrary {
|
||||||
|
|
||||||
CompletableFuture<Void> addTagToDocument(String documentId, String tagId);
|
CompletableFuture<Void> addTagToDocument(String documentId, String tagId);
|
||||||
|
|
||||||
|
CompletableFuture<Void> applyTagListToDocument(String documentId, ArrayList<DocumentTag> tagList);
|
||||||
|
|
||||||
CompletableFuture<Void> removeTagFromDocument(String documentId, String tagId);
|
CompletableFuture<Void> removeTagFromDocument(String documentId, String tagId);
|
||||||
|
|
||||||
// Combined Document
|
// Combined Document
|
||||||
|
|
|
@ -321,6 +321,20 @@ public class LacertaLibraryImpl implements LacertaLibrary {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CompletableFuture<Void> applyTagListToDocument(String documentId, ArrayList<DocumentTag> tagArrayList) {
|
||||||
|
return CompletableFuture.supplyAsync(() -> { // TODO-rca: 必要なものだけInsertするべき, 時間があれば...
|
||||||
|
// 一旦全てのタグを削除
|
||||||
|
database.toxiDocumentTagDao().deleteByDocumentId(documentId);
|
||||||
|
logger.debug("LacertaLibraryImpl", "Database Query: Deleted ToxiDocumentTagEntity");
|
||||||
|
// タグを追加
|
||||||
|
for (DocumentTag documentTag : tagArrayList) {
|
||||||
|
addTagToDocument(documentId, documentTag.getId());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CompletableFuture<Void> removeTagFromDocument(String documentId, String tagId) {
|
public CompletableFuture<Void> removeTagFromDocument(String documentId, String tagId) {
|
||||||
return CompletableFuture.supplyAsync(() -> {
|
return CompletableFuture.supplyAsync(() -> {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user