Merge remote-tracking branch 'origin/feature/REQ-3540' into feature/REQ-3540

This commit is contained in:
xudawei 2025-03-18 18:46:16 +08:00
commit e8e70bb439
2 changed files with 6 additions and 3 deletions

View File

@ -3,7 +3,6 @@ package cn.axzo.nanopart.doc.entity;
import java.util.Objects;
import cn.axzo.nanopart.doc.api.util.BizAssertions;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
@ -19,6 +18,7 @@ import cn.axzo.nanopart.doc.api.enums.DatabaseScope;
import cn.axzo.nanopart.doc.api.enums.IndexNodeContext;
import cn.axzo.nanopart.doc.api.enums.IndexNodeState;
import cn.axzo.nanopart.doc.api.enums.IndexNodeType;
import cn.axzo.nanopart.doc.api.util.BizAssertions;
import cn.axzo.nanopart.doc.entity.domain.Path;
import cn.axzo.pokonyan.config.mybatisplus.BaseEntity;
import lombok.Getter;
@ -168,8 +168,7 @@ public class IndexNode extends BaseEntity<IndexNode> implements NodeValue, Index
@JSONField(serialize = false, deserialize = false)
public String getFullFileName() {
BizAssertions.assertTrue(isFile(), "只有文件才有完整文件名");
return String.format("%s.%s", getName(),
getOrCreateAttributes().getOrCreateFileAttributes().getFileExtension());
return String.format("%s.%s", getName(), getOrCreateFileAttributes().getFileExtension());
}
@JsonIgnore

View File

@ -37,6 +37,10 @@ public class IndexNodeRenameOssFileHandler implements EventHandler, Initializing
log.warn("index node not found: {}", message.getIndexNodeCode());
return;
}
if (!indexNode.isFile()) {
log.warn("index node is not a file: {}", message.getIndexNodeCode());
return;
}
String ossFileKey = indexNode.getOrCreateAttributes().getOrCreateFileAttributes().getOssFileKey();
if (StringUtils.isBlank(ossFileKey)) {
log.warn("try to rename index node oss file ({}) but oss file key not found", indexNode.getCode());