fix: 调整 playbook 上传时,保存文件的名称
This commit is contained in:
@@ -47,11 +47,15 @@ public class PlaybookServiceImpl extends ServiceImpl<PlaybookDao, PlaybookEntity
|
||||
throw new ASWException(RCode.PLAYBOOK_NAME_DUPLICATE);
|
||||
}
|
||||
|
||||
File destination = T.FileUtil.file(Constants.PLAYBOOK_FILES_DIR, name);
|
||||
File unzip = null;
|
||||
PlaybookEntity playbook = new PlaybookEntity();
|
||||
|
||||
PlaybookEntity playbook = new PlaybookEntity();
|
||||
String playbookId = T.StrUtil.uuid();
|
||||
String fileExtName = T.StrUtil.emptyToDefault(T.FileUtil.extName(file.getName()), "zip");
|
||||
String saveFileName = playbookId + "." + fileExtName;
|
||||
File destination = T.FileUtil.file(Constants.PLAYBOOK_FILES_DIR, saveFileName);
|
||||
File unzip = null;
|
||||
try {
|
||||
playbook.setId(playbookId);
|
||||
playbook.setWorkspaceId(workspaceId);
|
||||
playbook.setName(name);
|
||||
playbook.setDescription(description);
|
||||
|
||||
Reference in New Issue
Block a user