Merge remote-tracking branch 'origin/dev/dev' into dev/dev
This commit is contained in:
@@ -14,6 +14,8 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author XP
|
||||
*/
|
||||
@@ -137,6 +139,11 @@ public class GenerateController {
|
||||
return Response.success(sketchReconstruction);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取pose transfer的所有pose")
|
||||
@GetMapping("/getAllPose")
|
||||
public Response<List<Map<String, String>>> getAllPose(){
|
||||
return Response.success(generateService.getAllPose());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -61,4 +61,6 @@ public interface GenerateService extends IService<Generate> {
|
||||
GenerateResultVO sketchReconstructionGenerate(SketchReconstructionDTO sketchReconstructionDTO);
|
||||
|
||||
SketchReconstructionVO getSketchReconstruction(Long projectId);
|
||||
|
||||
List<Map<String, String>> getAllPose();
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user