|
|
@@ -2,9 +2,11 @@ package com.iformall.service.impl; |
|
|
|
|
|
|
|
import com.iformall.common.CommonConstants; |
|
|
|
import com.iformall.domain.dto.sm.SaveServiceVideoRecordDTO; |
|
|
|
import com.iformall.domain.po.sm.ServiceInfo; |
|
|
|
import com.iformall.dto.GenerateVideoDTO; |
|
|
|
import com.iformall.enums.sm.EnumThirdPartyType; |
|
|
|
import com.iformall.service.AiVideoService; |
|
|
|
import com.iformall.service.sm.ServiceInfoService; |
|
|
|
import com.iformall.service.sm.ServiceVideoRecordService; |
|
|
|
import com.iformall.sm.*; |
|
|
|
import com.iformall.utils.Base64Util; |
|
|
@@ -20,6 +22,8 @@ import org.springframework.stereotype.Service; |
|
|
|
@Service |
|
|
|
public class AiVideoServiceImpl implements AiVideoService { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ServiceInfoService serviceInfoService; |
|
|
|
@Autowired |
|
|
|
private ServiceVideoRecordService serviceVideoRecordService; |
|
|
|
|
|
|
@@ -29,10 +33,11 @@ public class AiVideoServiceImpl implements AiVideoService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public AiVideoResult generateVideo(GenerateVideoDTO dto, Long serviceId) { |
|
|
|
AiVideoParam aiVideoParam = dto.getAiVideoParam(); |
|
|
|
public AiVideoResult generateVideo(AiVideoParam aiVideoParam, Long serviceId) { |
|
|
|
// 查询该接入商的接入方式 |
|
|
|
ServiceInfo serviceInfo = serviceInfoService.getServiceInfo(serviceId); |
|
|
|
// 如果是api接入,则将图片地址转为base64 |
|
|
|
if (EnumThirdPartyType.API_JOIN.getCode().equals(dto.getType())) { |
|
|
|
if (EnumThirdPartyType.API_JOIN.getCode().equals(serviceInfo.getType())) { |
|
|
|
AiVideoParam.VideoFiles videoFiles = aiVideoParam.getVideo_files(); |
|
|
|
videoFiles.getBack_ground().setImage(Base64Util.imageUrlToBase64(videoFiles.getBack_ground().getImage())); |
|
|
|
for (AiVideoParam.Material material : videoFiles.getMaterial()) { |
|
|
|