REQ-3540: misc
This commit is contained in:
parent
dc34bfe806
commit
ec1790137c
@ -5,7 +5,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import cn.axzo.nanopart.doc.api.enums.FileFormat;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@ -21,7 +20,6 @@ public class DocProps {
|
||||
|
||||
private String createFileOssFileKeyWord = "ent-workspace-empty-docx";
|
||||
private String createFileFileKeyExcel = "ent-workspace-empty-xlsx";
|
||||
private String createFileFileKeyPpt = "ent-workspace-empty-pptx";
|
||||
private int indexNodeMaxChildrenSize = 200;
|
||||
private int indexNodeMaxDepth = 10;
|
||||
private int indexNodeMaxCopyFileSize = 1000;
|
||||
@ -35,14 +33,4 @@ public class DocProps {
|
||||
private String defaultIconWord = "https://axzo-obs-public.obs.cn-north-4.myhuaweicloud.com:443/doc/doc/word.png";
|
||||
private String defaultIconPdf = "https://axzo-obs-public.obs.cn-north-4.myhuaweicloud.com:443/doc/doc/pdf.png";
|
||||
|
||||
public String createFileOssFileKey(FileFormat format) {
|
||||
if (format == FileFormat.WORD)
|
||||
return createFileOssFileKeyWord;
|
||||
if (format == FileFormat.EXCEL)
|
||||
return createFileFileKeyExcel;
|
||||
if (format == FileFormat.PDF)
|
||||
return createFileFileKeyPpt;
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -25,9 +25,9 @@ import cn.axzo.nanopart.doc.dao.DocLogDao;
|
||||
import cn.axzo.nanopart.doc.dao.IndexNodeDao;
|
||||
import cn.axzo.nanopart.doc.entity.IndexNode;
|
||||
import cn.axzo.nanopart.doc.file.index.copy.ConnectNodeVisitor;
|
||||
import cn.axzo.nanopart.doc.file.index.copy.OssFilesCopy;
|
||||
import cn.axzo.nanopart.doc.file.index.copy.CopyFileVisitor;
|
||||
import cn.axzo.nanopart.doc.file.index.copy.CopyNodeVisitor;
|
||||
import cn.axzo.nanopart.doc.file.index.copy.OssFilesCopy;
|
||||
import cn.axzo.nanopart.doc.file.index.domain.NameUsedException;
|
||||
import cn.axzo.nanopart.doc.file.mq.FileBroadcaster;
|
||||
import cn.axzo.nanopart.doc.integration.OssClient;
|
||||
@ -70,7 +70,9 @@ public class IndexManager {
|
||||
// check without lock
|
||||
ensureChildNameNotUsed(create, IndexNodeType.FILE, false);
|
||||
String fullFileName = String.format("%s.%s", create.name(), format.createFileExtension());
|
||||
String ossFileKey = ossClient.copy(docProps.createFileOssFileKey(format), fullFileName);
|
||||
String emptyOssFileKey = format == FileFormat.WORD ? docProps.getCreateFileOssFileKeyWord()
|
||||
: docProps.getCreateFileFileKeyExcel();
|
||||
String ossFileKey = ossClient.copy(emptyOssFileKey, fullFileName);
|
||||
return OssFile.create(format, format.createFileExtension(), 0, ossFileKey);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user