S3Util 工具类修改
This commit is contained in:
@@ -17,7 +17,7 @@ public enum CreditsEventsEnum {
|
|||||||
INIT_YEARLY("init_yearly", "6000"),
|
INIT_YEARLY("init_yearly", "6000"),
|
||||||
INIT_MONTHLY("init_monthly", "5000"),
|
INIT_MONTHLY("init_monthly", "5000"),
|
||||||
INIT_TRIAL("init_trial", "100"),
|
INIT_TRIAL("init_trial", "100"),
|
||||||
INIT_WEEKLY("init_weekly","10000"),
|
INIT_WEEKLY("init_weekly","6000"),
|
||||||
|
|
||||||
// SUPER_RESOLUTION("Super Resolution","30"),
|
// SUPER_RESOLUTION("Super Resolution","30"),
|
||||||
SUPER_RESOLUTION("Super Resolution","10"),
|
SUPER_RESOLUTION("Super Resolution","10"),
|
||||||
|
|||||||
@@ -1,20 +1,24 @@
|
|||||||
package com.ai.da.common.task;
|
package com.ai.da.common.task;
|
||||||
|
|
||||||
import com.ai.da.service.AccountService;
|
import com.ai.da.service.AccountService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
|
@Slf4j
|
||||||
public class AccountTask {
|
public class AccountTask {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private AccountService accountService;
|
private AccountService accountService;
|
||||||
|
|
||||||
/** 每周日晚上刷新 年付用户、月付用户的积分 */
|
/** 每周日晚上刷新 年付用户、月付用户的积分 */
|
||||||
// @Scheduled(cron = "59 59 23 ? * SUN")
|
@Scheduled(cron = "59 59 23 ? * SUN")
|
||||||
|
// @Scheduled(cron = "59 59 23 * * ?")
|
||||||
public void refreshCreditsMonthly(){
|
public void refreshCreditsMonthly(){
|
||||||
|
log.info("每周日晚11:59:59刷新付费用户积分为 6000");
|
||||||
accountService.refreshCreditsWeekly();
|
accountService.refreshCreditsWeekly();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -373,7 +373,7 @@ public class MinioUtil {
|
|||||||
* @param expiry 过期时间(单位:分)
|
* @param expiry 过期时间(单位:分)
|
||||||
* @return 文件的临时URL,如果出现异常则返回null
|
* @return 文件的临时URL,如果出现异常则返回null
|
||||||
*/
|
*/
|
||||||
public String getPresignedUrl(String bucketName, String fileName, int expiry) {
|
public String getPreSignedUrl(String bucketName, String fileName, int expiry) {
|
||||||
try {
|
try {
|
||||||
return minioClient.getPresignedObjectUrl(
|
return minioClient.getPresignedObjectUrl(
|
||||||
GetPresignedObjectUrlArgs.builder()
|
GetPresignedObjectUrlArgs.builder()
|
||||||
@@ -389,7 +389,7 @@ public class MinioUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPresignedUrl(String path, int expiry) {
|
public String getPreSignedUrl(String path, int expiry) {
|
||||||
if (LocalCacheUtils.getPresignedUrlCache(path) != null) {
|
if (LocalCacheUtils.getPresignedUrlCache(path) != null) {
|
||||||
return LocalCacheUtils.getPresignedUrlCache(path);
|
return LocalCacheUtils.getPresignedUrlCache(path);
|
||||||
} else {
|
} else {
|
||||||
@@ -399,7 +399,7 @@ public class MinioUtil {
|
|||||||
int index = path.indexOf("/");
|
int index = path.indexOf("/");
|
||||||
String bucketName = path.substring(0, index);
|
String bucketName = path.substring(0, index);
|
||||||
String fileName = path.substring(index + 1);
|
String fileName = path.substring(index + 1);
|
||||||
String presignedUrl = getPresignedUrl(bucketName, fileName, expiry);
|
String presignedUrl = getPreSignedUrl(bucketName, fileName, expiry);
|
||||||
LocalCacheUtils.setPresignedUrlCache(path, presignedUrl);
|
LocalCacheUtils.setPresignedUrlCache(path, presignedUrl);
|
||||||
return presignedUrl;
|
return presignedUrl;
|
||||||
}
|
}
|
||||||
@@ -422,7 +422,7 @@ public class MinioUtil {
|
|||||||
fileName.append("/");
|
fileName.append("/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return getPresignedUrl(bucketName, String.valueOf(fileName), expiry);
|
return getPreSignedUrl(bucketName, String.valueOf(fileName), expiry);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean doesObjectExist(String bucketName, String objectName) {
|
public boolean doesObjectExist(String bucketName, String objectName) {
|
||||||
|
|||||||
@@ -104,11 +104,11 @@ public class S3Util {
|
|||||||
.contentType("image/png")
|
.contentType("image/png")
|
||||||
.contentLength((long) in.available())
|
.contentLength((long) in.available())
|
||||||
.key(fileName)
|
.key(fileName)
|
||||||
// .acl(ObjectCannedACL.PUBLIC_READ)
|
.acl(ObjectCannedACL.PUBLIC_READ)
|
||||||
.build();
|
.build();
|
||||||
s3Client.putObject(putObjectRequest, RequestBody.fromInputStream(in, in.available()));
|
s3Client.putObject(putObjectRequest, RequestBody.fromInputStream(in, in.available()));
|
||||||
|
|
||||||
log.info("上传的位置:桶 - {},路径 - {}", bucketName, fileName);
|
log.info("uploadImageFromBase64 上传的位置:桶 - {},路径 - {}", bucketName, fileName);
|
||||||
return bucketName + "/" + fileName;
|
return bucketName + "/" + fileName;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -132,18 +132,19 @@ public class S3Util {
|
|||||||
.contentType(file.getContentType())
|
.contentType(file.getContentType())
|
||||||
.contentLength(file.getSize())
|
.contentLength(file.getSize())
|
||||||
.key(fileName)
|
.key(fileName)
|
||||||
// .acl(ObjectCannedACL.PUBLIC_READ)
|
.acl(ObjectCannedACL.PUBLIC_READ)
|
||||||
.build();
|
.build();
|
||||||
s3Client.putObject(putObjectRequest, RequestBody.fromInputStream(file.getInputStream(), file.getSize()));
|
s3Client.putObject(putObjectRequest, RequestBody.fromInputStream(file.getInputStream(), file.getSize()));
|
||||||
|
|
||||||
log.info("上传的位置:桶 - {},路径 - {}", bucketName, fileName);
|
log.info("upload 上传的位置:桶 - {},路径 - {}", bucketName, fileName);
|
||||||
return bucketName + "/" + fileName;
|
return bucketName + "/" + fileName;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("上传文件到S3失败 异常:{}", e.getMessage());
|
log.error("上传文件到S3失败 异常:{}", e.getMessage());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// todo
|
|
||||||
|
// todo
|
||||||
public String upload(String bucketName, String path, MultipartFile file, String copy) {
|
public String upload(String bucketName, String path, MultipartFile file, String copy) {
|
||||||
S3Client s3Client = getS3Client();
|
S3Client s3Client = getS3Client();
|
||||||
InputStream in = null;
|
InputStream in = null;
|
||||||
@@ -155,10 +156,10 @@ public class S3Util {
|
|||||||
.contentType(file.getContentType())
|
.contentType(file.getContentType())
|
||||||
.contentLength(file.getSize())
|
.contentLength(file.getSize())
|
||||||
.key(path)
|
.key(path)
|
||||||
// .acl(ObjectCannedACL.PUBLIC_READ)
|
.acl(ObjectCannedACL.PUBLIC_READ)
|
||||||
.build();
|
.build();
|
||||||
s3Client.putObject(putObjectRequest, RequestBody.fromInputStream(file.getInputStream(), file.getSize()));
|
s3Client.putObject(putObjectRequest, RequestBody.fromInputStream(file.getInputStream(), file.getSize()));
|
||||||
|
log.info("upload-copy 上传的位置:桶 - {},路径 - {}", bucketName, path);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} finally {
|
} finally {
|
||||||
@@ -195,6 +196,7 @@ public class S3Util {
|
|||||||
// ResponseBytes<GetObjectResponse> objectBytes = s3.getObjectAsBytes(objectRequest);
|
// ResponseBytes<GetObjectResponse> objectBytes = s3.getObjectAsBytes(objectRequest);
|
||||||
ResponseBytes<GetObjectResponse> objectAsBytes = s3Client.getObjectAsBytes(objectRequest);
|
ResponseBytes<GetObjectResponse> objectAsBytes = s3Client.getObjectAsBytes(objectRequest);
|
||||||
byte[] data = objectAsBytes.asByteArray();
|
byte[] data = objectAsBytes.asByteArray();
|
||||||
|
log.info("download 下载图片位置:桶 - {},路径 - {}", bucketName, objectName);
|
||||||
return new ByteArrayInputStream(data);
|
return new ByteArrayInputStream(data);
|
||||||
|
|
||||||
/*// Write the data to a local file.
|
/*// Write the data to a local file.
|
||||||
@@ -263,6 +265,9 @@ public class S3Util {
|
|||||||
String preSignatureUrl = "";
|
String preSignatureUrl = "";
|
||||||
try {
|
try {
|
||||||
S3Presigner s3PreSigner = getS3PreSigner();
|
S3Presigner s3PreSigner = getS3PreSigner();
|
||||||
|
S3Client s3Client = getS3Client();
|
||||||
|
setObjectAcl(s3Client, bucket, keyName, ObjectCannedACL.PUBLIC_READ);
|
||||||
|
|
||||||
GetObjectRequest getObjectRequest = GetObjectRequest.builder()
|
GetObjectRequest getObjectRequest = GetObjectRequest.builder()
|
||||||
.bucket(bucket)
|
.bucket(bucket)
|
||||||
.key(keyName)
|
.key(keyName)
|
||||||
@@ -286,13 +291,20 @@ public class S3Util {
|
|||||||
s3PreSigner.presignGetObject(getObjectPresignRequest);
|
s3PreSigner.presignGetObject(getObjectPresignRequest);
|
||||||
|
|
||||||
preSignatureUrl = String.valueOf(presignedGetObjectRequest.url());
|
preSignatureUrl = String.valueOf(presignedGetObjectRequest.url());
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("生成预签名URL失败,异常:{}", e.getMessage());
|
log.error("生成预签名URL失败,异常:{}", e.getMessage());
|
||||||
}
|
}
|
||||||
return preSignatureUrl;
|
return preSignatureUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void setObjectAcl(S3Client s3, String bucketName, String keyName, ObjectCannedACL acl) {
|
||||||
|
PutObjectAclRequest aclRequest = PutObjectAclRequest.builder()
|
||||||
|
.bucket(bucketName)
|
||||||
|
.key(keyName)
|
||||||
|
.acl(acl)
|
||||||
|
.build();
|
||||||
|
s3.putObjectAcl(aclRequest);
|
||||||
|
}
|
||||||
public boolean doesObjectExist(String bucketName, String objectName) {
|
public boolean doesObjectExist(String bucketName, String objectName) {
|
||||||
try {
|
try {
|
||||||
S3Client s3Client = getS3Client();
|
S3Client s3Client = getS3Client();
|
||||||
@@ -309,7 +321,7 @@ public class S3Util {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String base64UploadToPath(String base64, String bucketName, String path){
|
public String base64UploadToPath(String base64, String bucketName, String path) {
|
||||||
S3Client s3Client = getS3Client();
|
S3Client s3Client = getS3Client();
|
||||||
String[] parts = base64.split(",");
|
String[] parts = base64.split(",");
|
||||||
String imageType = parts[0].split("/")[1].split(";")[0];
|
String imageType = parts[0].split("/")[1].split(";")[0];
|
||||||
@@ -317,9 +329,9 @@ public class S3Util {
|
|||||||
|
|
||||||
byte[] imageBytes = Base64.getDecoder().decode(base64Data);
|
byte[] imageBytes = Base64.getDecoder().decode(base64Data);
|
||||||
String fileName;
|
String fileName;
|
||||||
if (!StringUtil.isNullOrEmpty(path)){
|
if (!StringUtil.isNullOrEmpty(path)) {
|
||||||
fileName = path + "." + imageType; // or any other image format
|
fileName = path + "." + imageType; // or any other image format
|
||||||
}else {
|
} else {
|
||||||
fileName = UUID.randomUUID() + "." + imageType;
|
fileName = UUID.randomUUID() + "." + imageType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -329,11 +341,11 @@ public class S3Util {
|
|||||||
.contentType("image/" + imageType)
|
.contentType("image/" + imageType)
|
||||||
.contentLength((long) in.available())
|
.contentLength((long) in.available())
|
||||||
.key(fileName)
|
.key(fileName)
|
||||||
// .acl(ObjectCannedACL.PUBLIC_READ)
|
.acl(ObjectCannedACL.PUBLIC_READ)
|
||||||
.build();
|
.build();
|
||||||
s3Client.putObject(putObjectRequest, RequestBody.fromInputStream(in, in.available()));
|
s3Client.putObject(putObjectRequest, RequestBody.fromInputStream(in, in.available()));
|
||||||
|
|
||||||
log.info("上传的位置:桶 - {},路径 - {}", bucketName, fileName);
|
log.info("base64UploadToPath 上传的位置:桶 - {},路径 - {}", bucketName, fileName);
|
||||||
return bucketName + "/" + fileName;
|
return bucketName + "/" + fileName;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ public class LibraryController {
|
|||||||
Response<String> response = new Response();
|
Response<String> response = new Response();
|
||||||
log.info("Models打点预览入参####{}", JSON.toJSONString(modelsDotDTO));
|
log.info("Models打点预览入参####{}", JSON.toJSONString(modelsDotDTO));
|
||||||
String url = libraryModelPointService.modelsDot(modelsDotDTO);
|
String url = libraryModelPointService.modelsDot(modelsDotDTO);
|
||||||
response.setData(minioUtil.getPresignedUrl(url, 24 * 60));
|
response.setData(minioUtil.getPreSignedUrl(url, 24 * 60));
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public class SavedCollectionController {
|
|||||||
List<UserLikeVO> details = groupDetailMap.get(group.getId());
|
List<UserLikeVO> details = groupDetailMap.get(group.getId());
|
||||||
for (UserLikeVO detail : details) {
|
for (UserLikeVO detail : details) {
|
||||||
TDesignPythonOutfit tDesignPythonOutfit = designPythonOutfitMapper.selectById(detail.getDesignOutfitId());
|
TDesignPythonOutfit tDesignPythonOutfit = designPythonOutfitMapper.selectById(detail.getDesignOutfitId());
|
||||||
detail.setUrl(minioUtil.getPresignedUrl(tDesignPythonOutfit.getDesignUrl(), 24 * 60));
|
detail.setUrl(minioUtil.getPreSignedUrl(tDesignPythonOutfit.getDesignUrl(), 24 * 60));
|
||||||
}
|
}
|
||||||
userLikeGroupVO.setGroupDetails(details);
|
userLikeGroupVO.setGroupDetails(details);
|
||||||
userLikeGroupVO.setSketchCount(CollectionUtils.isEmpty(details) ? 0 : details.size());
|
userLikeGroupVO.setSketchCount(CollectionUtils.isEmpty(details) ? 0 : details.size());
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.ai.da.mapper.primary.entity;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
@@ -24,11 +25,13 @@ public class BaseEntity implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新时间
|
* 更新时间
|
||||||
*/
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||||
private LocalDateTime updateTime;
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class DesignPythonItemPrint {
|
|||||||
* 是否打点
|
* 是否打点
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty("是否打点 是传true 否则false")
|
@ApiModelProperty("是否打点 是传true 否则false")
|
||||||
private Boolean IfSingle;
|
private Boolean ifSingle;
|
||||||
|
|
||||||
|
|
||||||
@ApiModelProperty("print的位置 传 [[0.2, 0.2]]")
|
@ApiModelProperty("print的位置 传 [[0.2, 0.2]]")
|
||||||
@@ -43,14 +43,14 @@ public class DesignPythonItemPrint {
|
|||||||
|
|
||||||
@JSONField(name = "IfSingle")
|
@JSONField(name = "IfSingle")
|
||||||
public Boolean getIfSingle() {
|
public Boolean getIfSingle() {
|
||||||
return IfSingle;
|
return ifSingle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DesignPythonItemPrint(String singlePath, String level1Type, Float scale, Boolean ifSingle) {
|
public DesignPythonItemPrint(String singlePath, String level1Type, Float scale, Boolean ifSingle) {
|
||||||
this.path = singlePath;
|
this.path = singlePath;
|
||||||
this.level1Type = level1Type;
|
this.level1Type = level1Type;
|
||||||
this.scale = scale;
|
this.scale = scale;
|
||||||
IfSingle = ifSingle;
|
this.ifSingle = ifSingle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DesignPythonItemPrint() {
|
public DesignPythonItemPrint() {
|
||||||
@@ -62,6 +62,6 @@ public class DesignPythonItemPrint {
|
|||||||
|
|
||||||
public DesignPythonItemPrint(List<String> print_path_list, Boolean ifSingle) {
|
public DesignPythonItemPrint(List<String> print_path_list, Boolean ifSingle) {
|
||||||
this.print_path_list = print_path_list;
|
this.print_path_list = print_path_list;
|
||||||
IfSingle = ifSingle;
|
this.ifSingle = ifSingle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ public class ChatRobotServiceImpl implements ChatRobotService {
|
|||||||
if (!CollectionUtils.isEmpty(libraryList)) {
|
if (!CollectionUtils.isEmpty(libraryList)) {
|
||||||
chatRobotLibraryVO.setId(libraryList.get(0).getId());
|
chatRobotLibraryVO.setId(libraryList.get(0).getId());
|
||||||
}
|
}
|
||||||
String aidaSysImage = minioUtil.getPresignedUrl(bucketName + "/" + path, 24 * 60);
|
String aidaSysImage = minioUtil.getPreSignedUrl(bucketName + "/" + path, 24 * 60);
|
||||||
chatRobotLibraryVO.setUrl(bucketName + "/" + path);
|
chatRobotLibraryVO.setUrl(bucketName + "/" + path);
|
||||||
chatRobotLibraryVO.setPresignedUrl(aidaSysImage);
|
chatRobotLibraryVO.setPresignedUrl(aidaSysImage);
|
||||||
chatRobotLibraryVOList.add(chatRobotLibraryVO);
|
chatRobotLibraryVOList.add(chatRobotLibraryVO);
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import io.minio.errors.MinioException;
|
|
||||||
import io.netty.util.internal.StringUtil;
|
import io.netty.util.internal.StringUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
@@ -35,8 +34,6 @@ import org.springframework.util.StringUtils;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
@@ -105,7 +102,7 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
saveOne(collectionElement);
|
saveOne(collectionElement);
|
||||||
CollectionElementVO collectionElementVO = CopyUtil.copyObject(collectionElement, CollectionElementVO.class);
|
CollectionElementVO collectionElementVO = CopyUtil.copyObject(collectionElement, CollectionElementVO.class);
|
||||||
collectionElementVO.setMinIOPath(collectionElementVO.getUrl());
|
collectionElementVO.setMinIOPath(collectionElementVO.getUrl());
|
||||||
collectionElementVO.setUrl(minioUtil.getPresignedUrl(collectionElementVO.getUrl(), 24 * 60));
|
collectionElementVO.setUrl(minioUtil.getPreSignedUrl(collectionElementVO.getUrl(), 24 * 60));
|
||||||
collectionElementVO.setDesignType(DesignTypeEnum.COLLECTION.getRealName());
|
collectionElementVO.setDesignType(DesignTypeEnum.COLLECTION.getRealName());
|
||||||
return collectionElementVO;
|
return collectionElementVO;
|
||||||
}
|
}
|
||||||
@@ -246,7 +243,7 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
// collectionGeneratePrint.setDesignType(DesignTypeEnum.COLLECTION.getRealName());
|
// collectionGeneratePrint.setDesignType(DesignTypeEnum.COLLECTION.getRealName());
|
||||||
// return collectionGeneratePrint;
|
// return collectionGeneratePrint;
|
||||||
return new GenerateCollectionItemVO(generateDetail.getId(),
|
return new GenerateCollectionItemVO(generateDetail.getId(),
|
||||||
minioUtil.getPresignedUrl(generateUrl, 24 * 60),
|
minioUtil.getPreSignedUrl(generateUrl, 24 * 60),
|
||||||
generateDetail.getIsLike().equals((byte) 0) ? Boolean.FALSE : Boolean.TRUE);
|
generateDetail.getIsLike().equals((byte) 0) ? Boolean.FALSE : Boolean.TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -339,9 +336,12 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
element.setHasPin((byte) 0);
|
element.setHasPin((byte) 0);
|
||||||
try {
|
try {
|
||||||
element.setMd5(MD5Utils.encryptFile(minioUtil.download(path)));
|
element.setMd5(MD5Utils.encryptFile(minioUtil.download(path)));
|
||||||
} catch (MinioException | IOException e) {
|
}catch (Exception e){
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
/* catch (MinioException | IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}*/
|
||||||
|
|
||||||
//按时区计算
|
//按时区计算
|
||||||
element.setCreateDate(DateUtil.getByTimeZone(timeZone));
|
element.setCreateDate(DateUtil.getByTimeZone(timeZone));
|
||||||
@@ -881,9 +881,11 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
String md5;
|
String md5;
|
||||||
try {
|
try {
|
||||||
md5 = MD5Utils.encryptFile(minioUtil.download(url));
|
md5 = MD5Utils.encryptFile(minioUtil.download(url));
|
||||||
} catch (MinioException | IOException e) {
|
} catch (Exception e){
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}/*catch (MinioException | IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}*/
|
||||||
// 通过MD5来确认当前图片是否有被like过,避免重复like
|
// 通过MD5来确认当前图片是否有被like过,避免重复like
|
||||||
List<Map<String, Long>> libraryIds = generateDetailMapper.getLibraryIdThroughMD5(md5, CollectionLevel1TypeEnum.PRINT_BOARD.getRealName());
|
List<Map<String, Long>> libraryIds = generateDetailMapper.getLibraryIdThroughMD5(md5, CollectionLevel1TypeEnum.PRINT_BOARD.getRealName());
|
||||||
if (libraryIds.isEmpty()){
|
if (libraryIds.isEmpty()){
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ public class CollectionServiceImpl extends ServiceImpl<CollectionMapper, Collect
|
|||||||
CollectionElement byId = collectionElementService.getById(response.getMoodTemplateId());
|
CollectionElement byId = collectionElementService.getById(response.getMoodTemplateId());
|
||||||
if (Objects.nonNull(byId)) {
|
if (Objects.nonNull(byId)) {
|
||||||
response.setMoodTemplateName(byId.getName());
|
response.setMoodTemplateName(byId.getName());
|
||||||
response.setMoodTemplateUrl(minioUtil.getPresignedUrl(byId.getUrl(), 24 * 60));
|
response.setMoodTemplateUrl(minioUtil.getPreSignedUrl(byId.getUrl(), 24 * 60));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Map<String, List<CollectionElement>> maps = collectionElements
|
Map<String, List<CollectionElement>> maps = collectionElements
|
||||||
@@ -95,27 +95,27 @@ public class CollectionServiceImpl extends ServiceImpl<CollectionMapper, Collect
|
|||||||
case MOOD_BOARD:
|
case MOOD_BOARD:
|
||||||
response.setMoodBoards(CopyUtil.copyList(v, CollectionElementVO.class, (o, d) -> {
|
response.setMoodBoards(CopyUtil.copyList(v, CollectionElementVO.class, (o, d) -> {
|
||||||
d.setDesignType(DesignTypeEnum.COLLECTION.getRealName());
|
d.setDesignType(DesignTypeEnum.COLLECTION.getRealName());
|
||||||
d.setUrl(minioUtil.getPresignedUrl(o.getUrl(), 24 * 60));
|
d.setUrl(minioUtil.getPreSignedUrl(o.getUrl(), 24 * 60));
|
||||||
}));
|
}));
|
||||||
break;
|
break;
|
||||||
case PRINT_BOARD:
|
case PRINT_BOARD:
|
||||||
response.setPrintBoards(CopyUtil.copyList(v, CollectionElementVO.class, (o, d) -> {
|
response.setPrintBoards(CopyUtil.copyList(v, CollectionElementVO.class, (o, d) -> {
|
||||||
d.setIsPin(o.getHasPin());
|
d.setIsPin(o.getHasPin());
|
||||||
d.setDesignType(DesignTypeEnum.COLLECTION.getRealName());
|
d.setDesignType(DesignTypeEnum.COLLECTION.getRealName());
|
||||||
d.setUrl(minioUtil.getPresignedUrl(o.getUrl(), 24 * 60));
|
d.setUrl(minioUtil.getPreSignedUrl(o.getUrl(), 24 * 60));
|
||||||
}));
|
}));
|
||||||
break;
|
break;
|
||||||
case SKETCH_BOARD:
|
case SKETCH_BOARD:
|
||||||
response.setSketchBoards(CopyUtil.copyList(v, CollectionElementVO.class, (o, d) -> {
|
response.setSketchBoards(CopyUtil.copyList(v, CollectionElementVO.class, (o, d) -> {
|
||||||
d.setIsPin(o.getHasPin());
|
d.setIsPin(o.getHasPin());
|
||||||
d.setDesignType(DesignTypeEnum.COLLECTION.getRealName());
|
d.setDesignType(DesignTypeEnum.COLLECTION.getRealName());
|
||||||
d.setUrl(minioUtil.getPresignedUrl(o.getUrl(), 24 * 60));
|
d.setUrl(minioUtil.getPreSignedUrl(o.getUrl(), 24 * 60));
|
||||||
String url = o.getUrl();
|
String url = o.getUrl();
|
||||||
if (url.contains(".")) {
|
if (url.contains(".")) {
|
||||||
String[] split = url.split("\\.");
|
String[] split = url.split("\\.");
|
||||||
d.setUrlWithWhiteSide(minioUtil.getPresignedUrl(split[0] + "-show." + split[1], 24 * 60));
|
d.setUrlWithWhiteSide(minioUtil.getPreSignedUrl(split[0] + "-show." + split[1], 24 * 60));
|
||||||
}else {
|
}else {
|
||||||
d.setUrlWithWhiteSide(minioUtil.getPresignedUrl(url + "-show", 24 * 60));
|
d.setUrlWithWhiteSide(minioUtil.getPreSignedUrl(url + "-show", 24 * 60));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -8,10 +8,7 @@ import com.ai.da.common.context.UserContext;
|
|||||||
import com.ai.da.common.enums.CollectionLevel1TypeEnum;
|
import com.ai.da.common.enums.CollectionLevel1TypeEnum;
|
||||||
import com.ai.da.common.enums.SingleOverallEnum;
|
import com.ai.da.common.enums.SingleOverallEnum;
|
||||||
import com.ai.da.common.enums.SysFileLevel2TypeEnum;
|
import com.ai.da.common.enums.SysFileLevel2TypeEnum;
|
||||||
import com.ai.da.common.utils.CopyUtil;
|
import com.ai.da.common.utils.*;
|
||||||
import com.ai.da.common.utils.DateUtil;
|
|
||||||
import com.ai.da.common.utils.MD5Utils;
|
|
||||||
import com.ai.da.common.utils.MinioUtil;
|
|
||||||
import com.ai.da.mapper.primary.DesignItemMapper;
|
import com.ai.da.mapper.primary.DesignItemMapper;
|
||||||
import com.ai.da.mapper.primary.entity.*;
|
import com.ai.da.mapper.primary.entity.*;
|
||||||
import com.ai.da.model.dto.*;
|
import com.ai.da.model.dto.*;
|
||||||
@@ -536,7 +533,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
|
|||||||
}
|
}
|
||||||
|
|
||||||
return assembleDesignSingleResponse(designItem.getId(),
|
return assembleDesignSingleResponse(designItem.getId(),
|
||||||
minioUtil.getPresignedUrl(designPythonOutfit.getDesignUrl(), 24 * 60),
|
minioUtil.getPreSignedUrl(designPythonOutfit.getDesignUrl(), 24 * 60),
|
||||||
outfit.getString("synthesis_url"),
|
outfit.getString("synthesis_url"),
|
||||||
designSingleIncludeLayersDTO.getDesignSingleItemDTOList(),
|
designSingleIncludeLayersDTO.getDesignSingleItemDTOList(),
|
||||||
detailsVO,
|
detailsVO,
|
||||||
@@ -591,7 +588,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
|
|||||||
|
|
||||||
// 4、合成图层
|
// 4、合成图层
|
||||||
String synthesisUrl = pythonService.composeLayers(outfitDetailPythonItems);
|
String synthesisUrl = pythonService.composeLayers(outfitDetailPythonItems);
|
||||||
designItemLayer.setDesignItemUrl(minioUtil.getPresignedUrl(synthesisUrl, 24 * 60));
|
designItemLayer.setDesignItemUrl(minioUtil.getPreSignedUrl(synthesisUrl, 24 * 60));
|
||||||
|
|
||||||
// 5、更新数据库,根据designItemId更新designItemUrl
|
// 5、更新数据库,根据designItemId更新designItemUrl
|
||||||
designItem.setUpdateDate(DateUtil.getByTimeZone(positionAndScaleVO.getTimeZone()));
|
designItem.setUpdateDate(DateUtil.getByTimeZone(positionAndScaleVO.getTimeZone()));
|
||||||
@@ -627,10 +624,10 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
|
|||||||
}
|
}
|
||||||
layer.setImageSize(imageSize);
|
layer.setImageSize(imageSize);
|
||||||
if (!StringUtil.isNullOrEmpty(layer.getImageUrl())) {
|
if (!StringUtil.isNullOrEmpty(layer.getImageUrl())) {
|
||||||
layer.setImageUrl(minioUtil.getPresignedUrl(layer.getImageUrl(), 24 * 60));
|
layer.setImageUrl(minioUtil.getPreSignedUrl(layer.getImageUrl(), 24 * 60));
|
||||||
}
|
}
|
||||||
if (!StringUtil.isNullOrEmpty(layer.getMaskUrl())) {
|
if (!StringUtil.isNullOrEmpty(layer.getMaskUrl())) {
|
||||||
layer.setMaskUrl(minioUtil.getPresignedUrl(layer.getMaskUrl(), 24 * 60));
|
layer.setMaskUrl(minioUtil.getPreSignedUrl(layer.getMaskUrl(), 24 * 60));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -662,7 +659,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
|
|||||||
// 图片用于修改前后的一键对比
|
// 图片用于修改前后的一键对比
|
||||||
designSingleVO.setDesignItemUrl(designItemUrl);
|
designSingleVO.setDesignItemUrl(designItemUrl);
|
||||||
// 当前全身图
|
// 当前全身图
|
||||||
designSingleVO.setCurrentFullBodyView(minioUtil.getPresignedUrl(currentFullBodyView, 24 * 60));
|
designSingleVO.setCurrentFullBodyView(minioUtil.getPreSignedUrl(currentFullBodyView, 24 * 60));
|
||||||
designSingleVO.setClothes(clothes);
|
designSingleVO.setClothes(clothes);
|
||||||
|
|
||||||
// 获取每个单品的id是否被改变过,该状态需要再返回给前端
|
// 获取每个单品的id是否被改变过,该状态需要再返回给前端
|
||||||
@@ -677,7 +674,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
|
|||||||
designItemClothesDetailVO.setChanged(idChanged.get(singleItem.getId()));
|
designItemClothesDetailVO.setChanged(idChanged.get(singleItem.getId()));
|
||||||
designItemClothesDetailVO.setDesignType(idDesignType.get(singleItem.getId()));
|
designItemClothesDetailVO.setDesignType(idDesignType.get(singleItem.getId()));
|
||||||
designItemClothesDetailVO.setType(singleItem.getType());
|
designItemClothesDetailVO.setType(singleItem.getType());
|
||||||
designItemClothesDetailVO.setPath(minioUtil.getPresignedUrl(singleItem.getPath(), 24 * 60));
|
designItemClothesDetailVO.setPath(minioUtil.getPreSignedUrl(singleItem.getPath(), 24 * 60));
|
||||||
designItemClothesDetailVO.setMinIOPath(singleItem.getPath());
|
designItemClothesDetailVO.setMinIOPath(singleItem.getPath());
|
||||||
designItemClothesDetailVO.setColor(panToneService.getPantoneByRgb(singleItem.getColor()));
|
designItemClothesDetailVO.setColor(panToneService.getPantoneByRgb(singleItem.getColor()));
|
||||||
designItemClothesDetailVO.setPrintObject(singleItem.getPrintObject());
|
designItemClothesDetailVO.setPrintObject(singleItem.getPrintObject());
|
||||||
@@ -785,7 +782,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
|
|||||||
designSingleIncludeLayersDTO.getDesignSingleItemDTOList().forEach(designSingleItem -> {
|
designSingleIncludeLayersDTO.getDesignSingleItemDTOList().forEach(designSingleItem -> {
|
||||||
|
|
||||||
if (!StringUtil.isNullOrEmpty(designSingleItem.getDesignType()) && designSingleItem.getDesignType().equals("Collection")){
|
if (!StringUtil.isNullOrEmpty(designSingleItem.getDesignType()) && designSingleItem.getDesignType().equals("Collection")){
|
||||||
String path = minioUtil.getPresignedUrl(designSingleItem.getPath(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME);
|
String path = minioUtil.getPreSignedUrl(designSingleItem.getPath(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME);
|
||||||
try {
|
try {
|
||||||
String md5 = MD5Utils.encryptFile(path, false);
|
String md5 = MD5Utils.encryptFile(path, false);
|
||||||
// 先判断是否需要被加入到library
|
// 先判断是否需要被加入到library
|
||||||
@@ -814,7 +811,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
|
|||||||
// 添加print到library
|
// 添加print到library
|
||||||
designSingleItem.getPrintObject().getPrints().forEach(print -> {
|
designSingleItem.getPrintObject().getPrints().forEach(print -> {
|
||||||
if (!StringUtil.isNullOrEmpty(print.getDesignType()) && print.getDesignType().equals("Collection")){
|
if (!StringUtil.isNullOrEmpty(print.getDesignType()) && print.getDesignType().equals("Collection")){
|
||||||
String path = minioUtil.getPresignedUrl(print.getMinIOPath(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME);
|
String path = minioUtil.getPreSignedUrl(print.getMinIOPath(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME);
|
||||||
try {
|
try {
|
||||||
String md5 = MD5Utils.encryptFile(path, false);
|
String md5 = MD5Utils.encryptFile(path, false);
|
||||||
// 先判断是否已被加入到library
|
// 先判断是否已被加入到library
|
||||||
|
|||||||
@@ -382,9 +382,9 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
String url = byId.getUrl();
|
String url = byId.getUrl();
|
||||||
if (url.contains(".")) {
|
if (url.contains(".")) {
|
||||||
String[] split = url.split("\\.");
|
String[] split = url.split("\\.");
|
||||||
vo.setUrlWithWhiteSide(minioUtil.getPresignedUrl(split[0] + "-show." + split[1], 24 * 60));
|
vo.setUrlWithWhiteSide(minioUtil.getPreSignedUrl(split[0] + "-show." + split[1], 24 * 60));
|
||||||
}else {
|
}else {
|
||||||
vo.setUrlWithWhiteSide(minioUtil.getPresignedUrl(url + "-show", 24 * 60));
|
vo.setUrlWithWhiteSide(minioUtil.getPreSignedUrl(url + "-show", 24 * 60));
|
||||||
}
|
}
|
||||||
result.add(vo);
|
result.add(vo);
|
||||||
}else if (collectionSketchDTO.getDesignType().equals(DesignTypeEnum.GENERATE.getRealName())) {
|
}else if (collectionSketchDTO.getDesignType().equals(DesignTypeEnum.GENERATE.getRealName())) {
|
||||||
@@ -393,9 +393,9 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
String url = generateDetail.getUrl();
|
String url = generateDetail.getUrl();
|
||||||
if (url.contains(".")) {
|
if (url.contains(".")) {
|
||||||
String[] split = url.split("\\.");
|
String[] split = url.split("\\.");
|
||||||
vo.setUrlWithWhiteSide(minioUtil.getPresignedUrl(split[0] + "-show." + split[1], 24 * 60));
|
vo.setUrlWithWhiteSide(minioUtil.getPreSignedUrl(split[0] + "-show." + split[1], 24 * 60));
|
||||||
}else {
|
}else {
|
||||||
vo.setUrlWithWhiteSide(minioUtil.getPresignedUrl(url + "-show", 24 * 60));
|
vo.setUrlWithWhiteSide(minioUtil.getPreSignedUrl(url + "-show", 24 * 60));
|
||||||
}
|
}
|
||||||
result.add(vo);
|
result.add(vo);
|
||||||
}
|
}
|
||||||
@@ -411,9 +411,9 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
String url = byId.getUrl();
|
String url = byId.getUrl();
|
||||||
if (url.contains(".")) {
|
if (url.contains(".")) {
|
||||||
String[] split = url.split("\\.");
|
String[] split = url.split("\\.");
|
||||||
vo.setUrlWithWhiteSide(minioUtil.getPresignedUrl(split[0] + "-show." + split[1], 24 * 60));
|
vo.setUrlWithWhiteSide(minioUtil.getPreSignedUrl(split[0] + "-show." + split[1], 24 * 60));
|
||||||
}else {
|
}else {
|
||||||
vo.setUrlWithWhiteSide(minioUtil.getPresignedUrl(url + "-show", 24 * 60));
|
vo.setUrlWithWhiteSide(minioUtil.getPreSignedUrl(url + "-show", 24 * 60));
|
||||||
}
|
}
|
||||||
result.add(vo);
|
result.add(vo);
|
||||||
}
|
}
|
||||||
@@ -597,7 +597,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
String designUrl = designPythonOutfit.getDesignUrl();
|
String designUrl = designPythonOutfit.getDesignUrl();
|
||||||
if (!StringUtils.isEmpty(designUrl) && designUrl.contains("/")) {
|
if (!StringUtils.isEmpty(designUrl) && designUrl.contains("/")) {
|
||||||
int firstIndex = designUrl.indexOf("/");
|
int firstIndex = designUrl.indexOf("/");
|
||||||
designCollectionItemVO.setDesignOutfitUrl(minioUtil.getPresignedUrl(designUrl.substring(0, firstIndex) + "/" + designUrl.substring(firstIndex + 1), 24 * 60));
|
designCollectionItemVO.setDesignOutfitUrl(minioUtil.getPreSignedUrl(designUrl.substring(0, firstIndex) + "/" + designUrl.substring(firstIndex + 1), 24 * 60));
|
||||||
}
|
}
|
||||||
//response
|
//response
|
||||||
designCollectionItems.add(designCollectionItemVO);
|
designCollectionItems.add(designCollectionItemVO);
|
||||||
@@ -997,7 +997,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
response.setClothes(CopyUtil.copyList(filterDetail, DesignItemClothesDetailVO.class, (o, d) -> {
|
response.setClothes(CopyUtil.copyList(filterDetail, DesignItemClothesDetailVO.class, (o, d) -> {
|
||||||
d.setId(o.getId());
|
d.setId(o.getId());
|
||||||
d.setPath(minioUtil.getPresignedUrl(o.getPath(), 24 * 60));
|
d.setPath(minioUtil.getPreSignedUrl(o.getPath(), 24 * 60));
|
||||||
d.setMinIOPath(o.getPath());
|
d.setMinIOPath(o.getPath());
|
||||||
d.setLevel1Type(converTypeToLevel1(o.getType()));
|
d.setLevel1Type(converTypeToLevel1(o.getType()));
|
||||||
d.setGradient(JSONObject.parseObject(o.getGradientString(), Gradient.class));
|
d.setGradient(JSONObject.parseObject(o.getGradientString(), Gradient.class));
|
||||||
@@ -1025,12 +1025,12 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
// todo 不确定businessId的作用,暂时取消传递,查看影响
|
// todo 不确定businessId的作用,暂时取消传递,查看影响
|
||||||
// d.setId(o.getBusinessId());
|
// d.setId(o.getBusinessId());
|
||||||
d.setId(0L);
|
d.setId(0L);
|
||||||
d.setPath(minioUtil.getPresignedUrl(o.getPath(), 24 * 60));
|
d.setPath(minioUtil.getPreSignedUrl(o.getPath(), 24 * 60));
|
||||||
d.setMinIOPath(o.getPath());
|
d.setMinIOPath(o.getPath());
|
||||||
d.setPrintObject(new DesignPythonItemPrint());
|
d.setPrintObject(new DesignPythonItemPrint());
|
||||||
}));
|
}));
|
||||||
return editDesignItemLayer(flag, designPythonOutfit,
|
return editDesignItemLayer(flag, designPythonOutfit,
|
||||||
minioUtil.getPresignedUrl(designPythonOutfit.getDesignUrl(), 24 * 60),
|
minioUtil.getPreSignedUrl(designPythonOutfit.getDesignUrl(), 24 * 60),
|
||||||
editResponseColor(designItemDetails, response));
|
editResponseColor(designItemDetails, response));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1169,7 +1169,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 2、将查询出的图层信息填充到designItemDetailVO中
|
// 2、将查询出的图层信息填充到designItemDetailVO中
|
||||||
designItemDetailVO.setDesignItemUrl(minioUtil.getPresignedUrl(designPythonOutfit.getDesignUrl(), 24 * 60));
|
designItemDetailVO.setDesignItemUrl(minioUtil.getPreSignedUrl(designPythonOutfit.getDesignUrl(), 24 * 60));
|
||||||
// 2.1 填充clothes
|
// 2.1 填充clothes
|
||||||
designItemDetailVO.getClothes().forEach(c -> {
|
designItemDetailVO.getClothes().forEach(c -> {
|
||||||
// String type = c.getType().toLowerCase();
|
// String type = c.getType().toLowerCase();
|
||||||
@@ -1209,7 +1209,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
designSinglePrint.setLocation(JSONArray.parseArray(detailPrint.getPosition(), Double.class));
|
designSinglePrint.setLocation(JSONArray.parseArray(detailPrint.getPosition(), Double.class));
|
||||||
designSinglePrint.setAngle(detailPrint.getAngle());
|
designSinglePrint.setAngle(detailPrint.getAngle());
|
||||||
designSinglePrint.setPriority(detailPrint.getPriority());
|
designSinglePrint.setPriority(detailPrint.getPriority());
|
||||||
designSinglePrint.setPath(minioUtil.getPresignedUrl(detailPrint.getPath(), 24 * 60));
|
designSinglePrint.setPath(minioUtil.getPreSignedUrl(detailPrint.getPath(), 24 * 60));
|
||||||
designSinglePrint.setMinIOPath(detailPrint.getPath());
|
designSinglePrint.setMinIOPath(detailPrint.getPath());
|
||||||
designSinglePrint.setScale(detailPrint.getScale());
|
designSinglePrint.setScale(detailPrint.getScale());
|
||||||
prints.add(designSinglePrint);
|
prints.add(designSinglePrint);
|
||||||
@@ -1220,7 +1220,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
if (print.getSingleOrOverall().equals("single")) {
|
if (print.getSingleOrOverall().equals("single")) {
|
||||||
prints.add(new DesignSinglePrint(
|
prints.add(new DesignSinglePrint(
|
||||||
print.getLevel2Type(),
|
print.getLevel2Type(),
|
||||||
minioUtil.getPresignedUrl(print.getPath(), 24 * 60),
|
minioUtil.getPreSignedUrl(print.getPath(), 24 * 60),
|
||||||
print.getPath(),
|
print.getPath(),
|
||||||
JSONArray.parseArray(print.getPosition(), Double.class),
|
JSONArray.parseArray(print.getPosition(), Double.class),
|
||||||
print.getScale(),
|
print.getScale(),
|
||||||
@@ -1250,13 +1250,13 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
List<Long> modelFromLibIds = designs.stream().filter(design -> design.getModelType().equals("Library")).map(Design::getTemplateId).collect(Collectors.toList());
|
List<Long> modelFromLibIds = designs.stream().filter(design -> design.getModelType().equals("Library")).map(Design::getTemplateId).collect(Collectors.toList());
|
||||||
if (!CollectionUtil.isEmpty(modelFromLibIds)){
|
if (!CollectionUtil.isEmpty(modelFromLibIds)){
|
||||||
models.addAll(libraryService.getByIds(modelFromLibIds).stream()
|
models.addAll(libraryService.getByIds(modelFromLibIds).stream()
|
||||||
.map(d -> minioUtil.getPresignedUrl(d.getUrl(), 24 * 60))
|
.map(d -> minioUtil.getPreSignedUrl(d.getUrl(), 24 * 60))
|
||||||
.collect(Collectors.toList()));
|
.collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
List<Long> modelFromSysIds = designs.stream().filter(design -> design.getModelType().equals("System")).map(Design::getTemplateId).collect(Collectors.toList());
|
List<Long> modelFromSysIds = designs.stream().filter(design -> design.getModelType().equals("System")).map(Design::getTemplateId).collect(Collectors.toList());
|
||||||
if (!CollectionUtil.isEmpty(modelFromSysIds)){
|
if (!CollectionUtil.isEmpty(modelFromSysIds)){
|
||||||
models.addAll(sysFileService.getByIds(modelFromSysIds).stream()
|
models.addAll(sysFileService.getByIds(modelFromSysIds).stream()
|
||||||
.map(d -> minioUtil.getPresignedUrl(d.getUrl(), 24 * 60))
|
.map(d -> minioUtil.getPreSignedUrl(d.getUrl(), 24 * 60))
|
||||||
.collect(Collectors.toList()));
|
.collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Generate generate = selectByUniqueId(taskId);
|
// Generate generate = selectByUniqueId(taskId);
|
||||||
String md5 = MD5Utils.encryptFile(minioUtil.getPresignedUrl(url, 24 * 60), Boolean.FALSE);
|
String md5 = MD5Utils.encryptFile(minioUtil.getPreSignedUrl(url, 24 * 60), Boolean.FALSE);
|
||||||
// 通过MD5值和level1Type,判断不同level1Type下相同的图片是否被like过
|
// 通过MD5值和level1Type,判断不同level1Type下相同的图片是否被like过
|
||||||
List<Map<String, Long>> libraryIdList = generateDetailMapper.getLibraryIdThroughMD5(md5, generate.getLevel1Type());
|
List<Map<String, Long>> libraryIdList = generateDetailMapper.getLibraryIdThroughMD5(md5, generate.getLevel1Type());
|
||||||
if (!libraryIdList.isEmpty()) {
|
if (!libraryIdList.isEmpty()) {
|
||||||
@@ -543,7 +543,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
|||||||
collectionElement.setName(name);
|
collectionElement.setName(name);
|
||||||
collectionElement.setUrl(path);
|
collectionElement.setUrl(path);
|
||||||
collectionElement.setHasPin((byte) 0);
|
collectionElement.setHasPin((byte) 0);
|
||||||
collectionElement.setMd5(MD5Utils.encryptFile(minioUtil.getPresignedUrl(path, 24 * 60), Boolean.FALSE));
|
collectionElement.setMd5(MD5Utils.encryptFile(minioUtil.getPreSignedUrl(path, 24 * 60), Boolean.FALSE));
|
||||||
collectionElement.setCreateDate(DateUtil.getByTimeZone(generateThroughImageTextDTO.getTimeZone()));
|
collectionElement.setCreateDate(DateUtil.getByTimeZone(generateThroughImageTextDTO.getTimeZone()));
|
||||||
collectionElementService.save(collectionElement);
|
collectionElementService.save(collectionElement);
|
||||||
|
|
||||||
@@ -633,7 +633,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
|||||||
if (url.substring(url.lastIndexOf("/") + 1).equals("white_image.jpg")) {
|
if (url.substring(url.lastIndexOf("/") + 1).equals("white_image.jpg")) {
|
||||||
generateResultVO.setStatus("Invalid");
|
generateResultVO.setStatus("Invalid");
|
||||||
} else {
|
} else {
|
||||||
generateResultVO.setUrl(minioUtil.getPresignedUrl(url, CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
generateResultVO.setUrl(minioUtil.getPreSignedUrl(url, CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
||||||
}
|
}
|
||||||
} else if (Objects.isNull(generateResultVO)) {
|
} else if (Objects.isNull(generateResultVO)) {
|
||||||
generateResultVO = new GenerateResultVO();
|
generateResultVO = new GenerateResultVO();
|
||||||
|
|||||||
@@ -8,10 +8,7 @@ import com.ai.da.common.context.UserContext;
|
|||||||
import com.ai.da.common.enums.*;
|
import com.ai.da.common.enums.*;
|
||||||
import com.ai.da.common.response.PageBaseResponse;
|
import com.ai.da.common.response.PageBaseResponse;
|
||||||
import com.ai.da.common.response.ResultEnum;
|
import com.ai.da.common.response.ResultEnum;
|
||||||
import com.ai.da.common.utils.CopyUtil;
|
import com.ai.da.common.utils.*;
|
||||||
import com.ai.da.common.utils.DateUtil;
|
|
||||||
import com.ai.da.common.utils.FileUtil;
|
|
||||||
import com.ai.da.common.utils.MinioUtil;
|
|
||||||
import com.ai.da.mapper.primary.*;
|
import com.ai.da.mapper.primary.*;
|
||||||
import com.ai.da.mapper.primary.entity.*;
|
import com.ai.da.mapper.primary.entity.*;
|
||||||
import com.ai.da.model.dto.*;
|
import com.ai.da.model.dto.*;
|
||||||
@@ -209,7 +206,7 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
|
|||||||
QueryLibraryPageVO libraryPageVO = CopyUtil.copyObject(library, QueryLibraryPageVO.class);
|
QueryLibraryPageVO libraryPageVO = CopyUtil.copyObject(library, QueryLibraryPageVO.class);
|
||||||
libraryPageVO.setDesignType(DesignTypeEnum.LIBRARY.getRealName());
|
libraryPageVO.setDesignType(DesignTypeEnum.LIBRARY.getRealName());
|
||||||
libraryPageVO.setMinIOPath(library.getUrl());
|
libraryPageVO.setMinIOPath(library.getUrl());
|
||||||
libraryPageVO.setUrl(minioUtil.getPresignedUrl(library.getUrl(), 24 * 60));
|
libraryPageVO.setUrl(minioUtil.getPreSignedUrl(library.getUrl(), 24 * 60));
|
||||||
if (finalMap != null && finalMap.containsKey(library.getId())) {
|
if (finalMap != null && finalMap.containsKey(library.getId())) {
|
||||||
libraryPageVO.setLibraryModelPoint(finalMap.get(library.getId()));
|
libraryPageVO.setLibraryModelPoint(finalMap.get(library.getId()));
|
||||||
}
|
}
|
||||||
@@ -273,7 +270,7 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
|
|||||||
Library library = resolveData(libraryUploadDTO, userInfo, newFilePath);
|
Library library = resolveData(libraryUploadDTO, userInfo, newFilePath);
|
||||||
LibraryUpdateVo libraryUpdateVo = CopyUtil.copyObject(library, LibraryUpdateVo.class);
|
LibraryUpdateVo libraryUpdateVo = CopyUtil.copyObject(library, LibraryUpdateVo.class);
|
||||||
libraryUpdateVo.setMinIOPath(libraryUpdateVo.getUrl());
|
libraryUpdateVo.setMinIOPath(libraryUpdateVo.getUrl());
|
||||||
libraryUpdateVo.setUrl(minioUtil.getPresignedUrl(newFilePath, 24 * 60));
|
libraryUpdateVo.setUrl(minioUtil.getPreSignedUrl(newFilePath, 24 * 60));
|
||||||
libraryUpdateVo.setCheckMd5(Boolean.TRUE);
|
libraryUpdateVo.setCheckMd5(Boolean.TRUE);
|
||||||
return libraryUpdateVo;
|
return libraryUpdateVo;
|
||||||
} else if (libraryUploadDTO.getModelType().equals(ModelType.SYSTEM.getValue())) {
|
} else if (libraryUploadDTO.getModelType().equals(ModelType.SYSTEM.getValue())) {
|
||||||
@@ -284,7 +281,7 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
|
|||||||
Library library = resolveData(libraryUploadDTO, userInfo, newFilePath);
|
Library library = resolveData(libraryUploadDTO, userInfo, newFilePath);
|
||||||
LibraryUpdateVo libraryUpdateVo = CopyUtil.copyObject(library, LibraryUpdateVo.class);
|
LibraryUpdateVo libraryUpdateVo = CopyUtil.copyObject(library, LibraryUpdateVo.class);
|
||||||
libraryUpdateVo.setMinIOPath(libraryUpdateVo.getUrl());
|
libraryUpdateVo.setMinIOPath(libraryUpdateVo.getUrl());
|
||||||
libraryUpdateVo.setUrl(minioUtil.getPresignedUrl(newFilePath, 24 * 60));
|
libraryUpdateVo.setUrl(minioUtil.getPreSignedUrl(newFilePath, 24 * 60));
|
||||||
libraryUpdateVo.setCheckMd5(Boolean.TRUE);
|
libraryUpdateVo.setCheckMd5(Boolean.TRUE);
|
||||||
return libraryUpdateVo;
|
return libraryUpdateVo;
|
||||||
} else {
|
} else {
|
||||||
@@ -299,7 +296,7 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
|
|||||||
Library library = resolveData(libraryUploadDTO, userInfo, filePath);
|
Library library = resolveData(libraryUploadDTO, userInfo, filePath);
|
||||||
LibraryUpdateVo libraryUpdateVo = CopyUtil.copyObject(library, LibraryUpdateVo.class);
|
LibraryUpdateVo libraryUpdateVo = CopyUtil.copyObject(library, LibraryUpdateVo.class);
|
||||||
libraryUpdateVo.setMinIOPath(libraryUpdateVo.getUrl());
|
libraryUpdateVo.setMinIOPath(libraryUpdateVo.getUrl());
|
||||||
libraryUpdateVo.setUrl(minioUtil.getPresignedUrl(libraryUpdateVo.getUrl(), 24 * 60));
|
libraryUpdateVo.setUrl(minioUtil.getPreSignedUrl(libraryUpdateVo.getUrl(), 24 * 60));
|
||||||
libraryUpdateVo.setCheckMd5(Boolean.TRUE);
|
libraryUpdateVo.setCheckMd5(Boolean.TRUE);
|
||||||
return libraryUpdateVo;
|
return libraryUpdateVo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.ai.da.service.impl;
|
|||||||
import com.ai.da.common.config.exception.BusinessException;
|
import com.ai.da.common.config.exception.BusinessException;
|
||||||
import com.ai.da.common.context.UserContext;
|
import com.ai.da.common.context.UserContext;
|
||||||
import com.ai.da.common.response.PageBaseResponse;
|
import com.ai.da.common.response.PageBaseResponse;
|
||||||
import com.ai.da.common.response.Response;
|
|
||||||
import com.ai.da.common.utils.CopyUtil;
|
import com.ai.da.common.utils.CopyUtil;
|
||||||
import com.ai.da.common.utils.MinioUtil;
|
import com.ai.da.common.utils.MinioUtil;
|
||||||
import com.ai.da.common.utils.RedisUtil;
|
import com.ai.da.common.utils.RedisUtil;
|
||||||
@@ -34,7 +33,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio> implements PortfolioService {
|
public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio> implements PortfolioService {
|
||||||
@@ -395,7 +393,7 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
|
|||||||
if (portfolio != null) {
|
if (portfolio != null) {
|
||||||
PortfolioVO vo = CopyUtil.copyObject(portfolio, PortfolioVO.class);
|
PortfolioVO vo = CopyUtil.copyObject(portfolio, PortfolioVO.class);
|
||||||
Canvas canvas = canvasMapper.selectById(vo.getCanvasId());
|
Canvas canvas = canvasMapper.selectById(vo.getCanvasId());
|
||||||
vo.setCanvasUrl(minioUtil.getPresignedUrl(canvas.getUrl(), 24 * 60));
|
vo.setCanvasUrl(minioUtil.getPreSignedUrl(canvas.getUrl(), 24 * 60));
|
||||||
vo.setLikeNum(redisUtil.getLikeCount(vo.getId()));
|
vo.setLikeNum(redisUtil.getLikeCount(vo.getId()));
|
||||||
vo.setViewNums(redisUtil.getViewCount(vo.getId()));
|
vo.setViewNums(redisUtil.getViewCount(vo.getId()));
|
||||||
return vo;
|
return vo;
|
||||||
@@ -417,19 +415,19 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
|
|||||||
if (StringUtils.isEmpty(element.getUrl())) {
|
if (StringUtils.isEmpty(element.getUrl())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
element.setUrl(minioUtil.getPresignedUrl(element.getUrl(), 24 * 60));
|
element.setUrl(minioUtil.getPreSignedUrl(element.getUrl(), 24 * 60));
|
||||||
}
|
}
|
||||||
vo.setCollectionElementList(collectionElementList);
|
vo.setCollectionElementList(collectionElementList);
|
||||||
QueryWrapper<TDesignPythonOutfit> qw = new QueryWrapper<>();
|
QueryWrapper<TDesignPythonOutfit> qw = new QueryWrapper<>();
|
||||||
qw.lambda().eq(TDesignPythonOutfit::getCollectionId, portfolio.getCollectionId());
|
qw.lambda().eq(TDesignPythonOutfit::getCollectionId, portfolio.getCollectionId());
|
||||||
List<TDesignPythonOutfit> designPythonOutfitList = designPythonOutfitMapper.selectList(qw);
|
List<TDesignPythonOutfit> designPythonOutfitList = designPythonOutfitMapper.selectList(qw);
|
||||||
for (TDesignPythonOutfit tDesignPythonOutfit : designPythonOutfitList) {
|
for (TDesignPythonOutfit tDesignPythonOutfit : designPythonOutfitList) {
|
||||||
tDesignPythonOutfit.setDesignUrl(minioUtil.getPresignedUrl(tDesignPythonOutfit.getDesignUrl(), 24 * 60));
|
tDesignPythonOutfit.setDesignUrl(minioUtil.getPreSignedUrl(tDesignPythonOutfit.getDesignUrl(), 24 * 60));
|
||||||
}
|
}
|
||||||
vo.setDesignPythonOutfitList(designPythonOutfitList);
|
vo.setDesignPythonOutfitList(designPythonOutfitList);
|
||||||
}
|
}
|
||||||
Canvas canvas = canvasMapper.selectById(vo.getCanvasId());
|
Canvas canvas = canvasMapper.selectById(vo.getCanvasId());
|
||||||
vo.setCanvasUrl(minioUtil.getPresignedUrl(canvas.getUrl(), 24 * 60));
|
vo.setCanvasUrl(minioUtil.getPreSignedUrl(canvas.getUrl(), 24 * 60));
|
||||||
vo.setLikeNum(redisUtil.getLikeCount(vo.getId()));
|
vo.setLikeNum(redisUtil.getLikeCount(vo.getId()));
|
||||||
boolean postLikedByUser = redisUtil.isPostLikedByUser(portfolioDTO.getId(), userHolder.getId());
|
boolean postLikedByUser = redisUtil.isPostLikedByUser(portfolioDTO.getId(), userHolder.getId());
|
||||||
if (postLikedByUser) {
|
if (postLikedByUser) {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import static com.ai.da.common.enums.LayersPriorityEnum.BODY;
|
|||||||
public class TDesignPythonOutfitDetailServiceImpl extends ServiceImpl<TDesignPythonOutfitDetailMapper, TDesignPythonOutfitDetail> implements ITDesignPythonOutfitDetailService {
|
public class TDesignPythonOutfitDetailServiceImpl extends ServiceImpl<TDesignPythonOutfitDetailMapper, TDesignPythonOutfitDetail> implements ITDesignPythonOutfitDetailService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private MinioUtil minIoUtil;
|
private MinioUtil minioUtil;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<TDesignPythonOutfitDetailVO> selectTDesignPythonOutfitDetailPage(IPage<TDesignPythonOutfitDetailVO> page, TDesignPythonOutfitDetailVO tDesignPythonOutfitDetail) {
|
public IPage<TDesignPythonOutfitDetailVO> selectTDesignPythonOutfitDetailPage(IPage<TDesignPythonOutfitDetailVO> page, TDesignPythonOutfitDetailVO tDesignPythonOutfitDetail) {
|
||||||
@@ -57,9 +57,9 @@ public class TDesignPythonOutfitDetailServiceImpl extends ServiceImpl<TDesignPyt
|
|||||||
DesignPythonOutfitVO designPythonOutfitVO = CopyUtil.copyObject(detail, DesignPythonOutfitVO.class);
|
DesignPythonOutfitVO designPythonOutfitVO = CopyUtil.copyObject(detail, DesignPythonOutfitVO.class);
|
||||||
designPythonOutfitVO.setPosition(StringUtil.isNullOrEmpty(detail.getPosition()) ? null : (List<Long>) JSON.parse(detail.getPosition()));
|
designPythonOutfitVO.setPosition(StringUtil.isNullOrEmpty(detail.getPosition()) ? null : (List<Long>) JSON.parse(detail.getPosition()));
|
||||||
designPythonOutfitVO.setImageSize(StringUtil.isNullOrEmpty(detail.getImageSize()) ? null : (List<Long>) JSON.parse(detail.getImageSize()));
|
designPythonOutfitVO.setImageSize(StringUtil.isNullOrEmpty(detail.getImageSize()) ? null : (List<Long>) JSON.parse(detail.getImageSize()));
|
||||||
designPythonOutfitVO.setImageUrl(StringUtil.isNullOrEmpty(detail.getImageUrl()) ? null : minIoUtil.getPresignedUrl(detail.getImageUrl(), 24 * 60));
|
designPythonOutfitVO.setImageUrl(StringUtil.isNullOrEmpty(detail.getImageUrl()) ? null : minioUtil.getPreSignedUrl(detail.getImageUrl(), 24 * 60));
|
||||||
designPythonOutfitVO.setImageMinioUrl(StringUtil.isNullOrEmpty(detail.getImageUrl()) ? null : detail.getImageUrl());
|
designPythonOutfitVO.setImageMinioUrl(StringUtil.isNullOrEmpty(detail.getImageUrl()) ? null : detail.getImageUrl());
|
||||||
designPythonOutfitVO.setMaskUrl(StringUtil.isNullOrEmpty(detail.getMaskUrl()) ? null : minIoUtil.getPresignedUrl(detail.getMaskUrl(), 24 * 60));
|
designPythonOutfitVO.setMaskUrl(StringUtil.isNullOrEmpty(detail.getMaskUrl()) ? null : minioUtil.getPreSignedUrl(detail.getMaskUrl(), 24 * 60));
|
||||||
designPythonOutfitVO.setMaskMinioUrl(StringUtil.isNullOrEmpty(detail.getMaskUrl()) ? null : detail.getMaskUrl());
|
designPythonOutfitVO.setMaskMinioUrl(StringUtil.isNullOrEmpty(detail.getMaskUrl()) ? null : detail.getMaskUrl());
|
||||||
// designPythonOutfitVO.setScale(Float.parseFloat(detail.getScale()));
|
// designPythonOutfitVO.setScale(Float.parseFloat(detail.getScale()));
|
||||||
designPythonOutfitVO.setScale(modifyScale(detail.getScale()));
|
designPythonOutfitVO.setScale(modifyScale(detail.getScale()));
|
||||||
|
|||||||
@@ -62,8 +62,8 @@ public class TaskListServiceImpl extends ServiceImpl<TaskListMapper, TaskList> i
|
|||||||
taskDTOS.add(new TaskDTO<>());
|
taskDTOS.add(new TaskDTO<>());
|
||||||
} else {
|
} else {
|
||||||
SuperResolutionDTO inputParam = taskDTO.getInputParam();
|
SuperResolutionDTO inputParam = taskDTO.getInputParam();
|
||||||
inputParam.setImages(minioUtil.getPresignedUrl(inputParam.getImages(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
inputParam.setImages(minioUtil.getPreSignedUrl(inputParam.getImages(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
||||||
taskDTO.setOutputImage(StringUtil.isNullOrEmpty(taskDTO.getOutputImage()) ? null : minioUtil.getPresignedUrl(taskDTO.getOutputImage(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
taskDTO.setOutputImage(StringUtil.isNullOrEmpty(taskDTO.getOutputImage()) ? null : minioUtil.getPreSignedUrl(taskDTO.getOutputImage(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
||||||
taskDTOS.add(taskDTO);
|
taskDTOS.add(taskDTO);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -105,8 +105,8 @@ public class TaskListServiceImpl extends ServiceImpl<TaskListMapper, TaskList> i
|
|||||||
// 成功失败的都返回
|
// 成功失败的都返回
|
||||||
TaskVO task = new TaskVO();
|
TaskVO task = new TaskVO();
|
||||||
task.setImageName(s.getInputUrl().substring(s.getInputUrl().lastIndexOf("/") + 1));
|
task.setImageName(s.getInputUrl().substring(s.getInputUrl().lastIndexOf("/") + 1));
|
||||||
task.setInputImage(minioUtil.getPresignedUrl(s.getInputUrl(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
task.setInputImage(minioUtil.getPreSignedUrl(s.getInputUrl(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
||||||
task.setOutputImage(StringUtil.isNullOrEmpty(s.getOutputUrl()) ? null : minioUtil.getPresignedUrl(s.getOutputUrl(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
task.setOutputImage(StringUtil.isNullOrEmpty(s.getOutputUrl()) ? null : minioUtil.getPreSignedUrl(s.getOutputUrl(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
||||||
task.setStatus(s.getStatus());
|
task.setStatus(s.getStatus());
|
||||||
task.setTaskId(s.getTaskId());
|
task.setTaskId(s.getTaskId());
|
||||||
task.setCreateDate(s.getCreateTime().format(dateTimeFormatter));
|
task.setCreateDate(s.getCreateTime().format(dateTimeFormatter));
|
||||||
|
|||||||
@@ -5,13 +5,9 @@ import com.ai.da.common.config.exception.BusinessException;
|
|||||||
import com.ai.da.common.constant.CommonConstant;
|
import com.ai.da.common.constant.CommonConstant;
|
||||||
import com.ai.da.common.context.UserContext;
|
import com.ai.da.common.context.UserContext;
|
||||||
import com.ai.da.common.enums.CreditsEventsEnum;
|
import com.ai.da.common.enums.CreditsEventsEnum;
|
||||||
import com.ai.da.common.utils.CopyUtil;
|
import com.ai.da.common.utils.*;
|
||||||
import com.ai.da.common.utils.DateUtil;
|
|
||||||
import com.ai.da.common.utils.MinioUtil;
|
|
||||||
import com.ai.da.common.utils.RedisUtil;
|
|
||||||
import com.ai.da.mapper.primary.*;
|
import com.ai.da.mapper.primary.*;
|
||||||
import com.ai.da.mapper.primary.entity.*;
|
import com.ai.da.mapper.primary.entity.*;
|
||||||
import com.ai.da.model.dto.ExportSaveDTO;
|
|
||||||
import com.ai.da.model.dto.ProductImageLikeDTO;
|
import com.ai.da.model.dto.ProductImageLikeDTO;
|
||||||
import com.ai.da.model.dto.ToProductImageDTO;
|
import com.ai.da.model.dto.ToProductImageDTO;
|
||||||
import com.ai.da.model.vo.*;
|
import com.ai.da.model.vo.*;
|
||||||
@@ -144,7 +140,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
|||||||
int index = o.getUrl().lastIndexOf("/");
|
int index = o.getUrl().lastIndexOf("/");
|
||||||
o.setPictureName(o.getUrl().substring(index + 1));
|
o.setPictureName(o.getUrl().substring(index + 1));
|
||||||
}
|
}
|
||||||
o.setDesignOutfitUrl(minioUtil.getPresignedUrl(o.getUrl(), 24 * 60));
|
o.setDesignOutfitUrl(minioUtil.getPreSignedUrl(o.getUrl(), 24 * 60));
|
||||||
QueryWrapper<TDesignPythonOutfit> qw = new QueryWrapper<>();
|
QueryWrapper<TDesignPythonOutfit> qw = new QueryWrapper<>();
|
||||||
qw.lambda().eq(TDesignPythonOutfit::getDesignItemId, o.getDesignItemId());
|
qw.lambda().eq(TDesignPythonOutfit::getDesignItemId, o.getDesignItemId());
|
||||||
List<TDesignPythonOutfit> tDesignPythonOutfits = designPythonOutfitMapper.selectList(qw);
|
List<TDesignPythonOutfit> tDesignPythonOutfits = designPythonOutfitMapper.selectList(qw);
|
||||||
@@ -313,7 +309,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
|||||||
toProductElement.setCreateTime(LocalDateTime.now());
|
toProductElement.setCreateTime(LocalDateTime.now());
|
||||||
toProductElementMapper.insert(toProductElement);
|
toProductElementMapper.insert(toProductElement);
|
||||||
ToProductElementVO toProductElementVO = CopyUtil.copyObject(toProductElement, ToProductElementVO.class);
|
ToProductElementVO toProductElementVO = CopyUtil.copyObject(toProductElement, ToProductElementVO.class);
|
||||||
toProductElementVO.setUrl(minioUtil.getPresignedUrl(toProductElementVO.getUrl(), 24 * 60));
|
toProductElementVO.setUrl(minioUtil.getPreSignedUrl(toProductElementVO.getUrl(), 24 * 60));
|
||||||
return toProductElementVO;
|
return toProductElementVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -345,7 +341,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
|||||||
if (url.substring(url.lastIndexOf("/") + 1).equals("white_image.jpg")) {
|
if (url.substring(url.lastIndexOf("/") + 1).equals("white_image.jpg")) {
|
||||||
magicToolResultVO.setStatus("Invalid");
|
magicToolResultVO.setStatus("Invalid");
|
||||||
} else {
|
} else {
|
||||||
magicToolResultVO.setUrl(minioUtil.getPresignedUrl(url, CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
magicToolResultVO.setUrl(minioUtil.getPreSignedUrl(url, CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
||||||
QueryWrapper<ToProductImageResult> qw = new QueryWrapper<>();
|
QueryWrapper<ToProductImageResult> qw = new QueryWrapper<>();
|
||||||
qw.lambda().eq(ToProductImageResult::getTaskId, taskId);
|
qw.lambda().eq(ToProductImageResult::getTaskId, taskId);
|
||||||
ToProductImageResult toProductImageResult = toProductImageResultMapper.selectOne(qw);
|
ToProductImageResult toProductImageResult = toProductImageResultMapper.selectOne(qw);
|
||||||
@@ -354,10 +350,10 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
|||||||
}
|
}
|
||||||
if (toProductImageResult.getElementType().equals("ProductElement")) {
|
if (toProductImageResult.getElementType().equals("ProductElement")) {
|
||||||
ToProductElement toProductElement = toProductElementMapper.selectById(toProductImageResult.getElementId());
|
ToProductElement toProductElement = toProductElementMapper.selectById(toProductImageResult.getElementId());
|
||||||
magicToolResultVO.setSourceUrl(minioUtil.getPresignedUrl(toProductElement.getUrl(), 24 * 60));
|
magicToolResultVO.setSourceUrl(minioUtil.getPreSignedUrl(toProductElement.getUrl(), 24 * 60));
|
||||||
}else {
|
}else {
|
||||||
UserLike userLike = userLikeMapper.selectById(toProductImageResult.getElementId());
|
UserLike userLike = userLikeMapper.selectById(toProductImageResult.getElementId());
|
||||||
magicToolResultVO.setSourceUrl(minioUtil.getPresignedUrl(userLike.getUrl(), 24 * 60));
|
magicToolResultVO.setSourceUrl(minioUtil.getPreSignedUrl(userLike.getUrl(), 24 * 60));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (Objects.isNull(magicToolResultVO)) {
|
} else if (Objects.isNull(magicToolResultVO)) {
|
||||||
@@ -385,7 +381,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
|||||||
String type = jsonObject1.getString("type");
|
String type = jsonObject1.getString("type");
|
||||||
if (type.equals("image")) {
|
if (type.equals("image")) {
|
||||||
String minioUrl = jsonObject1.getString("minioUrl");
|
String minioUrl = jsonObject1.getString("minioUrl");
|
||||||
jsonObject1.put("src", minioUtil.getPresignedUrl(minioUrl, 24 * 60));
|
jsonObject1.put("src", minioUtil.getPreSignedUrl(minioUrl, 24 * 60));
|
||||||
}
|
}
|
||||||
objects.set(i, jsonObject1);
|
objects.set(i, jsonObject1);
|
||||||
}
|
}
|
||||||
@@ -406,7 +402,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
|||||||
CanvasElementUpload canvasElementUpload = new CanvasElementUpload();
|
CanvasElementUpload canvasElementUpload = new CanvasElementUpload();
|
||||||
String url = minioUtil.upload("aida-users", userHolder.getId() + "/canvasElementUpload", file);
|
String url = minioUtil.upload("aida-users", userHolder.getId() + "/canvasElementUpload", file);
|
||||||
canvasElementUpload.setUrl(url);
|
canvasElementUpload.setUrl(url);
|
||||||
canvasElementUpload.setMinioUrl(minioUtil.getPresignedUrl(url, 24 * 60));
|
canvasElementUpload.setMinioUrl(minioUtil.getPreSignedUrl(url, 24 * 60));
|
||||||
return canvasElementUpload;
|
return canvasElementUpload;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -417,7 +413,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
|||||||
qw.lambda().eq(ToProductImageResult::getUserLikeGroupId, toProductImageDTO.getUserLikeGroupId());
|
qw.lambda().eq(ToProductImageResult::getUserLikeGroupId, toProductImageDTO.getUserLikeGroupId());
|
||||||
List<ToProductImageResult> toProductImageResults = toProductImageResultMapper.selectList(qw);
|
List<ToProductImageResult> toProductImageResults = toProductImageResultMapper.selectList(qw);
|
||||||
for (ToProductImageResult toProductImageResult : toProductImageResults) {
|
for (ToProductImageResult toProductImageResult : toProductImageResults) {
|
||||||
toProductImageResult.setUrl(minioUtil.getPresignedUrl(toProductImageResult.getUrl(), 24 * 60));
|
toProductImageResult.setUrl(minioUtil.getPreSignedUrl(toProductImageResult.getUrl(), 24 * 60));
|
||||||
}
|
}
|
||||||
return toProductImageResults;
|
return toProductImageResults;
|
||||||
}
|
}
|
||||||
@@ -505,7 +501,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
|||||||
if (url.substring(url.lastIndexOf("/") + 1).equals("white_image.jpg")) {
|
if (url.substring(url.lastIndexOf("/") + 1).equals("white_image.jpg")) {
|
||||||
magicToolResultVO.setStatus("Invalid");
|
magicToolResultVO.setStatus("Invalid");
|
||||||
} else {
|
} else {
|
||||||
magicToolResultVO.setUrl(minioUtil.getPresignedUrl(url, CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
magicToolResultVO.setUrl(minioUtil.getPreSignedUrl(url, CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
||||||
QueryWrapper<ToProductImageResult> qw = new QueryWrapper<>();
|
QueryWrapper<ToProductImageResult> qw = new QueryWrapper<>();
|
||||||
qw.lambda().eq(ToProductImageResult::getTaskId, taskId);
|
qw.lambda().eq(ToProductImageResult::getTaskId, taskId);
|
||||||
ToProductImageResult toProductImageResult = toProductImageResultMapper.selectOne(qw);
|
ToProductImageResult toProductImageResult = toProductImageResultMapper.selectOne(qw);
|
||||||
@@ -514,10 +510,10 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
|||||||
}
|
}
|
||||||
if (toProductImageResult.getElementType().equals("ProductElement")) {
|
if (toProductImageResult.getElementType().equals("ProductElement")) {
|
||||||
ToProductElement toProductElement = toProductElementMapper.selectById(toProductImageResult.getElementId());
|
ToProductElement toProductElement = toProductElementMapper.selectById(toProductImageResult.getElementId());
|
||||||
magicToolResultVO.setSourceUrl(minioUtil.getPresignedUrl(toProductElement.getUrl(), 24 * 60));
|
magicToolResultVO.setSourceUrl(minioUtil.getPreSignedUrl(toProductElement.getUrl(), 24 * 60));
|
||||||
}else {
|
}else {
|
||||||
ToProductImageResult toProductImageResult1 = toProductImageResultMapper.selectById(toProductImageResult.getElementId());
|
ToProductImageResult toProductImageResult1 = toProductImageResultMapper.selectById(toProductImageResult.getElementId());
|
||||||
magicToolResultVO.setSourceUrl(minioUtil.getPresignedUrl(toProductImageResult1.getUrl(), 24 * 60));
|
magicToolResultVO.setSourceUrl(minioUtil.getPreSignedUrl(toProductImageResult1.getUrl(), 24 * 60));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (Objects.isNull(magicToolResultVO)) {
|
} else if (Objects.isNull(magicToolResultVO)) {
|
||||||
|
|||||||
@@ -5,10 +5,7 @@ import com.ai.da.common.context.UserContext;
|
|||||||
import com.ai.da.common.enums.LibraryLevel1TypeEnum;
|
import com.ai.da.common.enums.LibraryLevel1TypeEnum;
|
||||||
import com.ai.da.common.response.PageBaseResponse;
|
import com.ai.da.common.response.PageBaseResponse;
|
||||||
import com.ai.da.common.response.ResultEnum;
|
import com.ai.da.common.response.ResultEnum;
|
||||||
import com.ai.da.common.utils.CopyUtil;
|
import com.ai.da.common.utils.*;
|
||||||
import com.ai.da.common.utils.FileUtil;
|
|
||||||
import com.ai.da.common.utils.MD5Utils;
|
|
||||||
import com.ai.da.common.utils.MinioUtil;
|
|
||||||
import com.ai.da.mapper.primary.*;
|
import com.ai.da.mapper.primary.*;
|
||||||
import com.ai.da.mapper.primary.entity.*;
|
import com.ai.da.mapper.primary.entity.*;
|
||||||
import com.ai.da.model.dto.WorkspaceDTO;
|
import com.ai.da.model.dto.WorkspaceDTO;
|
||||||
@@ -31,7 +28,6 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.naming.Context;
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@@ -207,16 +203,16 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
|||||||
WorkspaceVO workspaceVO = CopyUtil.copyObject(o, WorkspaceVO.class);
|
WorkspaceVO workspaceVO = CopyUtil.copyObject(o, WorkspaceVO.class);
|
||||||
if (o.getMannequinFemaleId() != null) {
|
if (o.getMannequinFemaleId() != null) {
|
||||||
if (o.getMannequinFemaleType().equals(ModelType.SYSTEM.getValue())) {
|
if (o.getMannequinFemaleType().equals(ModelType.SYSTEM.getValue())) {
|
||||||
workspaceVO.setFemalePresignedUrl(minioUtil.getPresignedUrl(sysFileMapper.selectById(o.getMannequinFemaleId()).getUrl(), 24 * 60));
|
workspaceVO.setFemalePresignedUrl(minioUtil.getPreSignedUrl(sysFileMapper.selectById(o.getMannequinFemaleId()).getUrl(), 24 * 60));
|
||||||
} else if (o.getMannequinFemaleType().equals(ModelType.LIBRARY.getValue())) {
|
} else if (o.getMannequinFemaleType().equals(ModelType.LIBRARY.getValue())) {
|
||||||
workspaceVO.setFemalePresignedUrl(minioUtil.getPresignedUrl(libraryMapper.selectById(o.getMannequinFemaleId()).getUrl(), 24 * 60));
|
workspaceVO.setFemalePresignedUrl(minioUtil.getPreSignedUrl(libraryMapper.selectById(o.getMannequinFemaleId()).getUrl(), 24 * 60));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (o.getMannequinMaleId() != null) {
|
if (o.getMannequinMaleId() != null) {
|
||||||
if (o.getMannequinMaleType().equals(ModelType.SYSTEM.getValue())) {
|
if (o.getMannequinMaleType().equals(ModelType.SYSTEM.getValue())) {
|
||||||
workspaceVO.setMalePresignedUrl(minioUtil.getPresignedUrl(sysFileMapper.selectById(o.getMannequinMaleId()).getUrl(), 24 * 60));
|
workspaceVO.setMalePresignedUrl(minioUtil.getPreSignedUrl(sysFileMapper.selectById(o.getMannequinMaleId()).getUrl(), 24 * 60));
|
||||||
} else if (o.getMannequinMaleType().equals(ModelType.LIBRARY.getValue())) {
|
} else if (o.getMannequinMaleType().equals(ModelType.LIBRARY.getValue())) {
|
||||||
workspaceVO.setMalePresignedUrl(minioUtil.getPresignedUrl(libraryMapper.selectById(o.getMannequinMaleId()).getUrl(), 24 * 60));
|
workspaceVO.setMalePresignedUrl(minioUtil.getPreSignedUrl(libraryMapper.selectById(o.getMannequinMaleId()).getUrl(), 24 * 60));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Sex sex = Sex.getSex(workspaceVO.getSex());
|
Sex sex = Sex.getSex(workspaceVO.getSex());
|
||||||
@@ -235,16 +231,16 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
|||||||
WorkspaceVO workspaceVO = CopyUtil.copyObject(o, WorkspaceVO.class);
|
WorkspaceVO workspaceVO = CopyUtil.copyObject(o, WorkspaceVO.class);
|
||||||
if (o.getMannequinFemaleId() != null) {
|
if (o.getMannequinFemaleId() != null) {
|
||||||
if (o.getMannequinFemaleType().equals(ModelType.SYSTEM.getValue())) {
|
if (o.getMannequinFemaleType().equals(ModelType.SYSTEM.getValue())) {
|
||||||
workspaceVO.setFemalePresignedUrl(minioUtil.getPresignedUrl(sysFileMapper.selectById(o.getMannequinFemaleId()).getUrl(), 24 * 60));
|
workspaceVO.setFemalePresignedUrl(minioUtil.getPreSignedUrl(sysFileMapper.selectById(o.getMannequinFemaleId()).getUrl(), 24 * 60));
|
||||||
} else if (o.getMannequinFemaleType().equals(ModelType.LIBRARY.getValue())) {
|
} else if (o.getMannequinFemaleType().equals(ModelType.LIBRARY.getValue())) {
|
||||||
workspaceVO.setFemalePresignedUrl(minioUtil.getPresignedUrl(libraryMapper.selectById(o.getMannequinFemaleId()).getUrl(), 24 * 60));
|
workspaceVO.setFemalePresignedUrl(minioUtil.getPreSignedUrl(libraryMapper.selectById(o.getMannequinFemaleId()).getUrl(), 24 * 60));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (o.getMannequinMaleId() != null) {
|
if (o.getMannequinMaleId() != null) {
|
||||||
if (o.getMannequinMaleType().equals(ModelType.SYSTEM.getValue())) {
|
if (o.getMannequinMaleType().equals(ModelType.SYSTEM.getValue())) {
|
||||||
workspaceVO.setMalePresignedUrl(minioUtil.getPresignedUrl(sysFileMapper.selectById(o.getMannequinMaleId()).getUrl(), 24 * 60));
|
workspaceVO.setMalePresignedUrl(minioUtil.getPreSignedUrl(sysFileMapper.selectById(o.getMannequinMaleId()).getUrl(), 24 * 60));
|
||||||
} else if (o.getMannequinMaleType().equals(ModelType.LIBRARY.getValue())) {
|
} else if (o.getMannequinMaleType().equals(ModelType.LIBRARY.getValue())) {
|
||||||
workspaceVO.setMalePresignedUrl(minioUtil.getPresignedUrl(libraryMapper.selectById(o.getMannequinMaleId()).getUrl(), 24 * 60));
|
workspaceVO.setMalePresignedUrl(minioUtil.getPreSignedUrl(libraryMapper.selectById(o.getMannequinMaleId()).getUrl(), 24 * 60));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Sex sex = Sex.getSex(workspaceVO.getSex());
|
Sex sex = Sex.getSex(workspaceVO.getSex());
|
||||||
@@ -295,16 +291,16 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
|||||||
WorkspaceVO vo = CopyUtil.copyObject(newIsLastIndex, WorkspaceVO.class);
|
WorkspaceVO vo = CopyUtil.copyObject(newIsLastIndex, WorkspaceVO.class);
|
||||||
if (vo.getMannequinFemaleId() != null) {
|
if (vo.getMannequinFemaleId() != null) {
|
||||||
if (vo.getMannequinFemaleType().equals(ModelType.SYSTEM.getValue())) {
|
if (vo.getMannequinFemaleType().equals(ModelType.SYSTEM.getValue())) {
|
||||||
vo.setFemalePresignedUrl(minioUtil.getPresignedUrl(sysFileMapper.selectById(vo.getMannequinFemaleId()).getUrl(), 24 * 60));
|
vo.setFemalePresignedUrl(minioUtil.getPreSignedUrl(sysFileMapper.selectById(vo.getMannequinFemaleId()).getUrl(), 24 * 60));
|
||||||
} else if (vo.getMannequinFemaleType().equals(ModelType.LIBRARY.getValue())) {
|
} else if (vo.getMannequinFemaleType().equals(ModelType.LIBRARY.getValue())) {
|
||||||
vo.setFemalePresignedUrl(minioUtil.getPresignedUrl(libraryMapper.selectById(vo.getMannequinFemaleId()).getUrl(), 24 * 60));
|
vo.setFemalePresignedUrl(minioUtil.getPreSignedUrl(libraryMapper.selectById(vo.getMannequinFemaleId()).getUrl(), 24 * 60));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (vo.getMannequinMaleId() != null) {
|
if (vo.getMannequinMaleId() != null) {
|
||||||
if (vo.getMannequinMaleType().equals(ModelType.SYSTEM.getValue())) {
|
if (vo.getMannequinMaleType().equals(ModelType.SYSTEM.getValue())) {
|
||||||
vo.setMalePresignedUrl(minioUtil.getPresignedUrl(sysFileMapper.selectById(vo.getMannequinMaleId()).getUrl(), 24 * 60));
|
vo.setMalePresignedUrl(minioUtil.getPreSignedUrl(sysFileMapper.selectById(vo.getMannequinMaleId()).getUrl(), 24 * 60));
|
||||||
} else if (vo.getMannequinMaleType().equals(ModelType.LIBRARY.getValue())) {
|
} else if (vo.getMannequinMaleType().equals(ModelType.LIBRARY.getValue())) {
|
||||||
vo.setMalePresignedUrl(minioUtil.getPresignedUrl(libraryMapper.selectById(vo.getMannequinMaleId()).getUrl(), 24 * 60));
|
vo.setMalePresignedUrl(minioUtil.getPreSignedUrl(libraryMapper.selectById(vo.getMannequinMaleId()).getUrl(), 24 * 60));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Sex sex = Sex.getSex(vo.getSex());
|
Sex sex = Sex.getSex(vo.getSex());
|
||||||
@@ -346,7 +342,7 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
|||||||
ModelVO modelVO = new ModelVO();
|
ModelVO modelVO = new ModelVO();
|
||||||
modelVO.setId(library.getId());
|
modelVO.setId(library.getId());
|
||||||
modelVO.setUrl(library.getUrl());
|
modelVO.setUrl(library.getUrl());
|
||||||
modelVO.setPresignedUrl(minioUtil.getPresignedUrl(library.getUrl(), 24 * 60));
|
modelVO.setPresignedUrl(minioUtil.getPreSignedUrl(library.getUrl(), 24 * 60));
|
||||||
modelVOList.add(modelVO);
|
modelVOList.add(modelVO);
|
||||||
}
|
}
|
||||||
ModelsVO vo = new ModelsVO();
|
ModelsVO vo = new ModelsVO();
|
||||||
@@ -371,7 +367,7 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
|||||||
ModelVO modelVO = new ModelVO();
|
ModelVO modelVO = new ModelVO();
|
||||||
modelVO.setId(sysFile.getId());
|
modelVO.setId(sysFile.getId());
|
||||||
modelVO.setUrl(sysFile.getUrl());
|
modelVO.setUrl(sysFile.getUrl());
|
||||||
modelVO.setPresignedUrl(minioUtil.getPresignedUrl(sysFile.getUrl(), 24 * 60));
|
modelVO.setPresignedUrl(minioUtil.getPreSignedUrl(sysFile.getUrl(), 24 * 60));
|
||||||
modelVOList.add(modelVO);
|
modelVOList.add(modelVO);
|
||||||
}
|
}
|
||||||
ModelsVO vo = new ModelsVO();
|
ModelsVO vo = new ModelsVO();
|
||||||
|
|||||||
Reference in New Issue
Block a user