feat: (REQ-3540) 文件信息modifierId优化

This commit is contained in:
xudawei 2025-03-20 18:00:32 +08:00
parent 56e9213c71
commit d6b6f510da
2 changed files with 14 additions and 1 deletions

View File

@ -2,6 +2,7 @@
package cn.axzo.nanopart.doc.api.domain;
import cn.axzo.nanopart.doc.api.enums.FileFormat;
import com.aliyuncs.utils.StringUtils;
import lombok.Getter;
import lombok.Setter;
@ -46,6 +47,7 @@ public class FileAttributes {
/**
* 返回version
* version最小为1
*/
public Integer fetchVersion(){
if (Objects.isNull(version) || version <= 0) {
@ -54,4 +56,15 @@ public class FileAttributes {
return version;
}
/**
* 返回modifierId
* 修改人为空则返回创建人
*/
public String fetchModifierId(){
if (StringUtils.isEmpty(modifierId)) {
return creatorId;
}
return modifierId;
}
}

View File

@ -58,7 +58,7 @@ public class WpsBaseManager {
.createAt(node.getCreateAt())
.updateAt(node.getUpdateAt())
.creatorId(node.getAttributes().getFileAttributes().getCreatorId())
.modifierId(node.getAttributes().getFileAttributes().getModifierId())
.modifierId(node.getOrCreateFileAttributes().fetchModifierId())
.build();
}