|
|
@@ -2,6 +2,7 @@ package com.zhongshu.card.server.core.dao.dictionary.impl;
|
|
|
|
|
|
import com.github.microservice.components.data.mongo.mongo.helper.DBHelper;
|
|
|
import com.mongodb.client.MongoCollection;
|
|
|
+import com.zhongshu.card.client.model.dictionary.DictionaryItemModel;
|
|
|
import com.zhongshu.card.server.core.dao.dictionary.extend.DictionaryItemDaoExtend;
|
|
|
import com.zhongshu.card.server.core.domain.dictionary.DictionaryItem;
|
|
|
import com.zhongshu.card.server.core.model.dictionary.DItemChildrenResult;
|
|
|
@@ -55,7 +56,7 @@ public class DictionaryItemDaoImpl implements DictionaryItemDaoExtend {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<DItemChildrenResult> deepAggregate(String dictionaryId, List<String> keys) {
|
|
|
+ public List<DictionaryItemModel> deepAggregate(String dictionaryId, List<String> keys) {
|
|
|
|
|
|
List<Document> pipeline = new ArrayList<>() {{
|
|
|
add(new Document()
|
|
|
@@ -82,12 +83,12 @@ public class DictionaryItemDaoImpl implements DictionaryItemDaoExtend {
|
|
|
));
|
|
|
final MongoCollection<Document> collection = this.mongoTemplate.getCollection(this.mongoTemplate.getCollectionName(DictionaryItem.class));
|
|
|
|
|
|
- List<DItemChildrenResult> ret = new ArrayList<>();
|
|
|
+ List<DictionaryItemModel> ret = new ArrayList<>();
|
|
|
|
|
|
|
|
|
collection.aggregate(pipeline).allowDiskUse(false).forEach((document)->{
|
|
|
Optional.ofNullable(document).ifPresent((it) -> {
|
|
|
- ret.add(this.mongoTemplate.getConverter().read(DItemChildrenResult.class, it));
|
|
|
+ ret.add(this.mongoTemplate.getConverter().read(DictionaryItemModel.class, it));
|
|
|
});
|
|
|
});
|
|
|
return ret;
|