Merge remote-tracking branch 'origin/dev/dev' into dev/dev

This commit is contained in:
shahaibo
2025-04-09 10:30:56 +08:00
4 changed files with 29 additions and 3 deletions

View File

@@ -61,4 +61,6 @@ public interface GenerateService extends IService<Generate> {
GenerateResultVO sketchReconstructionGenerate(SketchReconstructionDTO sketchReconstructionDTO);
SketchReconstructionVO getSketchReconstruction(Long projectId);
List<Map<String, String>> getAllPose();
}

View File

@@ -303,6 +303,8 @@ public class CreditsServiceImpl extends ServiceImpl<CreditsDetailMapper, Credits
credits = CreditsEventsEnum.LOGO.getValue();
}else if (changeEvent.equals("Slogan")){
credits = CreditsEventsEnum.SLOGAN.getValue();
}else if (changeEvent.equals("PoseTransformation")){
credits = CreditsEventsEnum.POSE_TRANSFORMATION.getValue();
}
// BigDecimal finalCredits = currentCredits.subtract(new BigDecimal(credits));

View File

@@ -1009,9 +1009,15 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
if (!StringUtil.isNullOrEmpty(resultJson)){
PoseTransformationVO poseTransformationVO = new Gson().fromJson(redisUtil.getFromString(key), PoseTransformationVO.class);
if (poseTransformationVO.getStatus().equals("Success")){
poseTransformationVO.setGifUrl(minioUtil.getPreSignedUrl(poseTransformationVO.getGifUrl(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
poseTransformationVO.setVideoUrl(minioUtil.getPreSignedUrl(poseTransformationVO.getVideoUrl(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
poseTransformationVO.setFirstFrameUrl(minioUtil.getPreSignedUrl(poseTransformationVO.getFirstFrameUrl(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
if (!poseTransformationVO.getGifUrl().equals("None")){
poseTransformationVO.setGifUrl(minioUtil.getPreSignedUrl(poseTransformationVO.getGifUrl(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
}
if (!poseTransformationVO.getVideoUrl().equals("None")){
poseTransformationVO.setVideoUrl(minioUtil.getPreSignedUrl(poseTransformationVO.getVideoUrl(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
}
if (!poseTransformationVO.getFirstFrameUrl().equals("None")){
poseTransformationVO.setFirstFrameUrl(minioUtil.getPreSignedUrl(poseTransformationVO.getFirstFrameUrl(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
}
}
return poseTransformationVO;
}else {
@@ -1187,4 +1193,13 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
return vo;
}
public List<Map<String, String>> getAllPose(){
String posePath = "aida-sys-image/pose/pose-1.gif";
String firstFramePath = "aida-sys-image/pose/pose-1-first_frame.jpeg";
HashMap<String, String> resp = new HashMap<>();
resp.put("gif", minioUtil.getPreSignedUrl(posePath, CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
resp.put("firstFrame", minioUtil.getPreSignedUrl(firstFramePath, CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
return Arrays.asList(resp);
}
}