| @@ -471,7 +471,7 @@ public class PhotoSpeakVideoController extends BaseController { | |||||
| @ApiOperation("获取视频是否生成成功") | @ApiOperation("获取视频是否生成成功") | ||||
| @GetMapping("/checkVideoStatus") | @GetMapping("/checkVideoStatus") | ||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | ||||
| public ResultData checkVideoStatus(@RequestParam("list") List<Long> list) { | |||||
| return photoSpeakVideoService.checkVideoStatus(getMemberId(),list); | |||||
| public ResultData checkVideoStatus(@RequestParam("list") List<Long> list,@RequestParam("type") Integer type) { | |||||
| return photoSpeakVideoService.checkVideoStatus(getMemberId(),list,type); | |||||
| } | } | ||||
| } | } | ||||
| @@ -23,5 +23,5 @@ public interface PhotoSpeakVideoMapper extends CommonMapper<PhotoSpeakVideo, Lon | |||||
| List<PhotoSpeakVideo> getSortList(PhotoSpeakVideo record); | List<PhotoSpeakVideo> getSortList(PhotoSpeakVideo record); | ||||
| Integer checkVideoStatus(@Param("userId") Long userId,@Param("list") List<Long> list); | |||||
| Integer checkVideoStatus(@Param("userId") Long userId, @Param("list") List<Long> list,@Param("type") Integer type); | |||||
| } | } | ||||
| @@ -65,5 +65,5 @@ public interface PhotoSpeakVideoService { | |||||
| List<PhotoSpeakVideo> getNotHyUploadList(); | List<PhotoSpeakVideo> getNotHyUploadList(); | ||||
| ResultData checkVideoStatus(Long userId, List<Long> time); | |||||
| ResultData checkVideoStatus(Long userId, List<Long> time, Integer type); | |||||
| } | } | ||||
| @@ -346,18 +346,26 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { | |||||
| param.setAudio_path(speakVideo.getAudioPath()); | param.setAudio_path(speakVideo.getAudioPath()); | ||||
| param.setTask_id(speakVideo.getId()); | param.setTask_id(speakVideo.getId()); | ||||
| param.setCallback_url(callbackUrl + "/callback/photo/speak"); | param.setCallback_url(callbackUrl + "/callback/photo/speak"); | ||||
| AiVideoHqResult result = AiVideoHelper.videoHq(param); | |||||
| if (result.isSuccess()) { | |||||
| speakVideo.setVideoHyStatus(EnumVideoStatus.success.getCode()); | |||||
| speakVideo.setVideoMsg("超分视频生成成功"); | |||||
| speakVideo.setVideoPath(result.getUrl()); | |||||
| try { | |||||
| AiVideoHqResult result = AiVideoHelper.videoHq(param); | |||||
| if (result.isSuccess()) { | |||||
| speakVideo.setVideoHyStatus(EnumVideoStatus.success.getCode()); | |||||
| speakVideo.setVideoMsg("超分视频生成成功"); | |||||
| speakVideo.setVideoPath(result.getUrl()); | |||||
| this.updateById(speakVideo); | |||||
| return new ResultData(); | |||||
| } | |||||
| speakVideo.setVideoHyStatus(EnumVideoStatus.draft.getCode()); | |||||
| speakVideo.setVideoMsg("Mata视频超分失败"); | |||||
| this.updateById(speakVideo); | |||||
| return new ResultData(result.getCode(), result.getMsgInfo(result.getCode(),result.getMsg())); | |||||
| }catch (Exception e){ | |||||
| e.printStackTrace(); | |||||
| speakVideo.setVideoHyStatus(EnumVideoStatus.draft.getCode()); | |||||
| speakVideo.setVideoMsg("Mata视频超分失败"); | |||||
| this.updateById(speakVideo); | this.updateById(speakVideo); | ||||
| return new ResultData(); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"Meta接口请求异常"); | |||||
| } | } | ||||
| speakVideo.setVideoHyStatus(EnumVideoStatus.draft.getCode()); | |||||
| speakVideo.setVideoMsg("视频超分失败"); | |||||
| this.updateById(speakVideo); | |||||
| return new ResultData(result.getCode(), result.getMsgInfo(result.getCode(),result.getMsg())); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| e.printStackTrace(); | e.printStackTrace(); | ||||
| speakVideo.setVideoHyStatus(EnumVideoStatus.draft.getCode()); | speakVideo.setVideoHyStatus(EnumVideoStatus.draft.getCode()); | ||||
| @@ -437,12 +445,15 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public ResultData checkVideoStatus(Long userId, List<Long> list) { | |||||
| public ResultData checkVideoStatus(Long userId, List<Long> list, Integer type) { | |||||
| if (CollectionUtils.isEmpty(list)){ | if (CollectionUtils.isEmpty(list)){ | ||||
| return new ResultData(ErrorCode.VIDEO_CREATING.getCode(),""); | return new ResultData(ErrorCode.VIDEO_CREATING.getCode(),""); | ||||
| } | } | ||||
| Integer integer = photoSpeakVideoMapper.checkVideoStatus(userId,list); | |||||
| if (type == null){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"类型不能为空"); | |||||
| } | |||||
| Integer integer = photoSpeakVideoMapper.checkVideoStatus(userId,list,type); | |||||
| if (integer > 0){ | if (integer > 0){ | ||||
| return new ResultData("生成视频成功"); | return new ResultData("生成视频成功"); | ||||
| } | } | ||||
| @@ -34,16 +34,16 @@ public class AiVideoHelper { | |||||
| // public static String url = "http://nas.pucao.cn:2002"; | // public static String url = "http://nas.pucao.cn:2002"; | ||||
| // public static String hy_url = "http://nas.pucao.cn:2002"; | // public static String hy_url = "http://nas.pucao.cn:2002"; | ||||
| public static String url = "http://111.198.0.15:22299"; | |||||
| public static String hy_url = "http://111.198.0.15:22288"; | |||||
| // @Value("${photo.url}") | |||||
| // private static String url; | |||||
| // @Value("${photo.hy_url}") | |||||
| // private static String hy_url; | |||||
| // @Value("${photo.talk}") | |||||
| // private static String talk_url; | |||||
| // | |||||
| // public static String url = "http://111.198.0.15:22299"; | |||||
| // public static String hy_url = "http://111.198.0.15:22288"; | |||||
| @Value("${photo.url}") | |||||
| private static String url; | |||||
| @Value("${photo.hy_url}") | |||||
| private static String hy_url; | |||||
| @Value("${photo.talk}") | |||||
| private static String talk_url; | |||||
| public static String photo_speak_suffix = "/img_talking"; | public static String photo_speak_suffix = "/img_talking"; | ||||
| public static String image_quality_suffix = "/image_qualit"; | public static String image_quality_suffix = "/image_qualit"; | ||||
| public static String voice_preview = "/tts_wav"; | public static String voice_preview = "/tts_wav"; | ||||
| @@ -159,7 +159,13 @@ | |||||
| <select id="checkVideoStatus" resultType="java.lang.Integer"> | <select id="checkVideoStatus" resultType="java.lang.Integer"> | ||||
| select count(1) | select count(1) | ||||
| from photo_speak_video | from photo_speak_video | ||||
| where video_status = 5 and user_id = #{userId} | |||||
| where user_id = #{userId} | |||||
| <if test="type == 1"> | |||||
| and video_status = 5 | |||||
| </if> | |||||
| <if test="type == 2"> | |||||
| and video_hy_status = 5 | |||||
| </if> | |||||
| <if test="list != null and list.size > 0"> | <if test="list != null and list.size > 0"> | ||||
| and id in | and id in | ||||
| <foreach collection="list" index="index" item="id" open="(" separator="," close=")"> | <foreach collection="list" index="index" item="id" open="(" separator="," close=")"> | ||||