REQ-3540: 隐藏oss file key

This commit is contained in:
yanglin 2025-03-18 13:58:36 +08:00
parent 7461549ff5
commit e1003b1842
2 changed files with 14 additions and 0 deletions

View File

@ -119,6 +119,14 @@ public class IndexNodeInfo implements NodeValue, ValueContainer<IndexNodeInfo> {
private IndexNodeAttributes attributes;
@JsonIgnore
@JSONField(serialize = false)
public IndexNodeAttributes getOrCreateAttributes() {
if (attributes == null)
attributes = new IndexNodeAttributes();
return attributes;
}
@JsonIgnore
@JSONField(serialize = false)
public FileTemplateNodeInfo getOrCreateFileTemplateNodeInfo() {

View File

@ -15,6 +15,7 @@ import cn.axzo.maokai.api.vo.response.tree.ValueNode;
import cn.axzo.maokai.api.vo.response.tree.ValueNodeRecursiveVisitor;
import cn.axzo.maokai.api.vo.response.tree.WalkingDecision;
import cn.axzo.nanopart.doc.api.domain.IndexNodeInfo;
import cn.axzo.nanopart.doc.api.enums.IndexNodeType;
import cn.axzo.nanopart.doc.config.DocProps;
import cn.axzo.nanopart.doc.entity.IndexNode;
import lombok.RequiredArgsConstructor;
@ -31,6 +32,11 @@ public class IndexNodeTreeUtils {
public RootNode<IndexNodeInfo> transform(List<IndexNode> subtreeNodes) {
RootNode<IndexNodeInfo> root = TreeUtils.transform(subtreeNodes, IndexNodeInfo.class);
TreeUtils.connectValueChildren(root);
for (ValueNode<IndexNodeInfo> valueNode : root.getValueNodes()) {
IndexNodeInfo indexNode = valueNode.getValue();
if (indexNode.getNodeType() == IndexNodeType.FILE)
indexNode.getOrCreateAttributes().getOrCreateFileAttributes().setOssFileKey("hidden");
}
return root;
}