|
|
|
|
@@ -14,8 +14,6 @@ import com.ai.da.model.vo.*;
|
|
|
|
|
import com.ai.da.python.PythonService;
|
|
|
|
|
import com.ai.da.service.*;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException;
|
|
|
|
|
@@ -28,17 +26,14 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.io.InputStream;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
import static com.ai.da.common.enums.CollectionLevel1TypeEnum.*;
|
|
|
|
|
import static com.ai.da.service.impl.UserLikeGroupServiceImpl.convert;
|
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
|
@Service
|
|
|
|
|
@@ -988,7 +983,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
|
|
|
|
poseTransformation = poseTransformations.get(0);
|
|
|
|
|
poseTransformation.setGifUrl(gifUrl);
|
|
|
|
|
poseTransformation.setVideoUrl(videoUrl);
|
|
|
|
|
poseTransformation.setImageUrl(imageUrl);
|
|
|
|
|
poseTransformation.setFirstFrameUrl(imageUrl);
|
|
|
|
|
poseTransformation.setUpdateTime(LocalDateTime.now());
|
|
|
|
|
poseTransformationMapper.updateById(poseTransformation);
|
|
|
|
|
|
|
|
|
|
@@ -1015,7 +1010,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
|
|
|
|
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.setImageUrl(minioUtil.getPreSignedUrl(poseTransformationVO.getImageUrl(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
|
|
|
|
poseTransformationVO.setFirstFrameUrl(minioUtil.getPreSignedUrl(poseTransformationVO.getFirstFrameUrl(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
|
|
|
|
}
|
|
|
|
|
return poseTransformationVO;
|
|
|
|
|
}else {
|
|
|
|
|
@@ -1023,6 +1018,35 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<PoseTransformationVO> getPoseTransformationResultList(String projectId){
|
|
|
|
|
List<PoseTransformation> poseTransformations = poseTransformationMapper.selectList(new QueryWrapper<PoseTransformation>().eq("project_id", projectId).eq("is_liked", 1));
|
|
|
|
|
List<PoseTransformationVO> vos = new ArrayList<>();
|
|
|
|
|
if (poseTransformations != null && poseTransformations.size() > 1){
|
|
|
|
|
poseTransformations.forEach(item -> {
|
|
|
|
|
PoseTransformationVO poseTransformationVO = CopyUtil.copyObject(item, PoseTransformationVO.class);
|
|
|
|
|
poseTransformationVO.setId(item.getId());
|
|
|
|
|
vos.add(poseTransformationVO);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
return vos;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Boolean disOrLikePose(Long transformedId, String likeOrDislike){
|
|
|
|
|
PoseTransformation poseTransformation = poseTransformationMapper.selectById(transformedId);
|
|
|
|
|
if (Objects.nonNull(poseTransformation)){
|
|
|
|
|
if (likeOrDislike.equals("like")){
|
|
|
|
|
poseTransformation.setIsLiked((byte)1);
|
|
|
|
|
}else if (likeOrDislike.equals("dislike")){
|
|
|
|
|
poseTransformation.setIsLiked((byte)0);
|
|
|
|
|
}
|
|
|
|
|
poseTransformation.setUpdateTime(LocalDateTime.now());
|
|
|
|
|
poseTransformationMapper.updateById(poseTransformation);
|
|
|
|
|
}else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private SysFileService sysFileService;
|
|
|
|
|
|
|
|
|
|
|