BUGFIX: 模特preview;

This commit is contained in:
shahaibo
2023-10-16 10:53:37 +08:00
parent 0dd765123f
commit 5e70f7ca73
5 changed files with 43 additions and 14 deletions

View File

@@ -130,9 +130,9 @@ public class LibraryController {
modelsDotDTO.setHigh(fileVO.getHigh());
modelsDotDTO.setWidth(fileVO.getWidth());
//存储template临时地址
String path = calculateTempFileUrl(userInfo.getId());
File uploadFile = FileUtil.upload(file, path);
modelsDotDTO.setTemplateUrl(calculateTemplateUrl(uploadFile));
String path = calculateTempFileUrlNew(userInfo.getId());
String uploadPath = minioUtil.upload("aida-tmp", path, file);
modelsDotDTO.setTemplateUrl(uploadPath);
}else{
Assert.notNull(modelsDotDTO.getLibraryId(),"libraryId cannot be empty!");
Assert.notNull(modelsDotDTO.getTemplateId(),"templateId cannot be empty!");
@@ -147,7 +147,7 @@ public class LibraryController {
Response<String> response =new Response();
log.info("Models打点预览入参####{}", JSON.toJSONString(modelsDotDTO));
String url = libraryModelPointService.modelsDot(modelsDotDTO);
response.setData(url);
response.setData(minioUtil.getPresignedUrl(url, 24 * 60));
return response;
}
@@ -163,6 +163,10 @@ public class LibraryController {
return rootPath + day + File.separator + "tmp" + File.separator + userId + File.separator+ UUID.randomUUID().toString();
}
private String calculateTempFileUrlNew(Long userId) {
return userId.toString();
}
private String calculateTemplateUrl(File uploadFile){
String linuxDomain = fileProperties.getLinuxDomain();
if (!StringUtils.isEmpty(linuxDomain)) {