后台服务
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

482 行
23 KiB

  1. package com.iformall.controller;
  2. import com.alibaba.fastjson.JSONObject;
  3. import com.github.pagehelper.PageInfo;
  4. import com.iformall.annotation.AuthIgnore;
  5. import com.iformall.common.ErrorCode;
  6. import com.iformall.common.ResultData;
  7. import com.iformall.domain.po.base.BaseEntity;
  8. import com.iformall.domain.po.sm.*;
  9. import com.iformall.enums.*;
  10. import com.iformall.exception.MallinkException;
  11. import com.iformall.service.sm.*;
  12. import com.iformall.video.VideoFactory;
  13. import com.iformall.video.entity.VideUploadResult;
  14. import io.swagger.annotations.Api;
  15. import io.swagger.annotations.ApiImplicitParam;
  16. import io.swagger.annotations.ApiImplicitParams;
  17. import io.swagger.annotations.ApiOperation;
  18. import lombok.SneakyThrows;
  19. import org.apache.commons.lang3.StringUtils;
  20. import org.checkerframework.checker.units.qual.A;
  21. import org.slf4j.Logger;
  22. import org.slf4j.LoggerFactory;
  23. import org.springframework.beans.factory.annotation.Autowired;
  24. import org.springframework.scheduling.annotation.AsyncResult;
  25. import org.springframework.util.ObjectUtils;
  26. import org.springframework.web.bind.annotation.*;
  27. import javax.servlet.http.HttpServletRequest;
  28. import javax.servlet.http.HttpServletResponse;
  29. import java.io.File;
  30. import java.io.IOException;
  31. import java.io.InputStream;
  32. import java.io.OutputStream;
  33. import java.net.URL;
  34. import java.net.URLEncoder;
  35. import java.nio.charset.StandardCharsets;
  36. import java.util.Date;
  37. import java.util.List;
  38. @RestController
  39. @RequestMapping("/api/userPhotoVideo")
  40. @Api(description = "模板接口")
  41. public class PhotoSpeakVideoController extends BaseController {
  42. private final Logger logger = LoggerFactory.getLogger(this.getClass());
  43. @Autowired
  44. private PhotoSpeakVideoService photoSpeakVideoService;
  45. @Autowired
  46. private MouldPatchService mouldPatchService;
  47. @Autowired
  48. private VoiceInfoService voiceInfoService;
  49. @Autowired
  50. private VideoFactory videoFactory;
  51. @Autowired
  52. String videoType;
  53. @Autowired
  54. private MusicInfoService musicInfoService;
  55. @Autowired
  56. private VoiceMaterialService voiceMaterialService;
  57. @ApiOperation("分页列表接口")
  58. @GetMapping("list")
  59. @ApiImplicitParams({
  60. @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
  61. @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
  62. public ResultData list(@ModelAttribute PhotoSpeakVideo record, Integer pageNum, Integer pageSize) {
  63. logger.debug("[" + getIpAddr() + "] UserMouldVideoController::list");
  64. if (record == null) record = new PhotoSpeakVideo();
  65. record.setUserId(getMemberId());
  66. record.setSortColumns(BaseEntity.SortField.UpdateDate_DESC);
  67. final PageInfo<PhotoSpeakVideo> page = photoSpeakVideoService.cListAsPage(record, pageNum, pageSize);
  68. return new ResultData(page);
  69. }
  70. @ApiOperation("根据id查询接口")
  71. @GetMapping("/findById")
  72. @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
  73. public ResultData findById(Long id) {
  74. logger.debug("[" + getIpAddr() + "] MouldPatchController::findById");
  75. if(id == null){
  76. return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"参数为空");
  77. }
  78. PhotoSpeakVideo photoSpeakVideo = photoSpeakVideoService.getById(id);
  79. if(photoSpeakVideo == null || !photoSpeakVideo.getUserId().equals(getMemberId())){
  80. return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到用户数据");
  81. }
  82. if(photoSpeakVideo.getVoiceMouldId() != null){
  83. VoiceInfo voiceInfo = voiceInfoService.getById(photoSpeakVideo.getVoiceMouldId());
  84. photoSpeakVideo.setVoiceInfo(voiceInfo);
  85. }
  86. if(photoSpeakVideo.getVoiceMaterialId() != null){
  87. VoiceMaterial voiceMaterial = voiceMaterialService.getById(photoSpeakVideo.getVoiceMaterialId());
  88. photoSpeakVideo.setVoiceMaterial(voiceMaterial);
  89. }
  90. return new ResultData(photoSpeakVideo);
  91. }
  92. @ApiOperation("根据id删除接口")
  93. @GetMapping("/del")
  94. @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
  95. public ResultData del(Long id) {
  96. logger.debug("[" + getIpAddr() + "] MouldPatchController::del");
  97. if(id == null){
  98. return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"参数为空");
  99. }
  100. PhotoSpeakVideo photoSpeakVideo = photoSpeakVideoService.getById(id);
  101. if(photoSpeakVideo == null || !photoSpeakVideo.getUserId().equals(getMemberId())){
  102. return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到用户数据");
  103. }
  104. // if(EnumVideoStatus.ing.getCode().equals(mouldVideo.getVideoStatus())
  105. // || EnumVideoStatus.success.getCode().equals(mouldVideo.getVideoStatus())
  106. // || EnumVideoStatus.upload_ing.getCode().equals(mouldVideo.getVideoStatus())
  107. // || EnumVideoStatus.upload_fail.getCode().equals(mouldVideo.getVideoStatus())){
  108. // return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"视频生成中");
  109. // }
  110. photoSpeakVideoService.deleteById(id);
  111. return new ResultData();
  112. }
  113. @ApiOperation("新增接口")
  114. @PostMapping("saveOrUpdate")
  115. public ResultData saveOrUpdate(@RequestBody PhotoSpeakVideo record) {
  116. logger.debug("[" + getIpAddr() + "] MouldPatchController::saveOrUpdate");
  117. record.setUserId(getMemberId());
  118. if(record.getId() != null){
  119. PhotoSpeakVideo photoSpeakVideo = photoSpeakVideoService.findVideo(record.getId());
  120. if(photoSpeakVideo == null){
  121. return new ResultData(ErrorCode.SYS_SERVER_ERROR);
  122. }
  123. if(EnumVideoStatus.ing.getCode().equals(photoSpeakVideo.getVideoStatus())
  124. || EnumVideoStatus.success.getCode().equals(photoSpeakVideo.getVideoStatus())
  125. || EnumVideoStatus.upload_ing.getCode().equals(photoSpeakVideo.getVideoStatus())
  126. || EnumVideoStatus.upload_fail.getCode().equals(photoSpeakVideo.getVideoStatus())){
  127. return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"视频生成中");
  128. }
  129. if(EnumVideoStatus.upload_success.getCode().equals(photoSpeakVideo.getVideoStatus())){
  130. //上传阿里云状态 生成成功
  131. return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"视频已生成完成");
  132. }
  133. }
  134. if(record.getPersonPhotoId() == null){
  135. return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未选择照片");
  136. }
  137. return photoSpeakVideoService.saveOrUpdate(record);
  138. }
  139. @ApiOperation("生成视频")
  140. @PostMapping("createVideo")
  141. public ResultData create(@RequestBody PhotoSpeakVideo record) {
  142. logger.debug("[" + getIpAddr() + "] MouldPatchController::saveOrUpdate");
  143. if(record.getId() == null){
  144. return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
  145. }
  146. PhotoSpeakVideo mouldVideo = photoSpeakVideoService.getById(record.getId());
  147. logger.info("TEST--"+ JSONObject.toJSONString(mouldVideo));
  148. if(mouldVideo == null || !mouldVideo.getUserId().equals(getMemberId())){
  149. return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到用户数据");
  150. }
  151. if(EnumVideoStatus.ing.getCode().equals(mouldVideo.getVideoStatus())
  152. || EnumVideoStatus.success.getCode().equals(mouldVideo.getVideoStatus())
  153. || EnumVideoStatus.upload_ing.getCode().equals(mouldVideo.getVideoStatus())
  154. || EnumVideoStatus.upload_fail.getCode().equals(mouldVideo.getVideoStatus())){
  155. return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"视频生成中");
  156. }
  157. if(EnumVideoStatus.upload_success.getCode().equals(mouldVideo.getVideoStatus())){
  158. //上传阿里云状态 生成成功
  159. return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"视频已生成完成");
  160. }
  161. PhotoSpeakVideo videoUpd = new PhotoSpeakVideo();
  162. videoUpd.setId(record.getId());
  163. if (mouldVideo.getPersonPhotoId() == null) {
  164. return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"未查询到人物照片");
  165. }
  166. if(StringUtils.isBlank(mouldVideo.getPersonPhotoUrl())){
  167. return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"未查询到人物照片地址");
  168. }
  169. videoUpd.setPersonPhotoId(mouldVideo.getPersonPhotoId());
  170. videoUpd.setPersonPhotoUrl(mouldVideo.getPersonPhotoUrl());
  171. Integer voiceFrom = mouldVideo.getVoiceFrom();
  172. videoUpd.setVoiceFrom(voiceFrom);
  173. if(EnumVoiceFrom.FROM_MOULD.getCode().equals(voiceFrom)){
  174. String voiceMouldSmId = null;
  175. try{
  176. JSONObject personMouldObject = JSONObject.parseObject(mouldVideo.getVoiceMouldSm());
  177. voiceMouldSmId = personMouldObject.getString("mouldSmId");
  178. videoUpd.setVoiceMouldSm(voiceMouldSmId);
  179. videoUpd.setPaperwork(mouldVideo.getPaperwork());
  180. videoUpd.setVoiceMouldSm(mouldVideo.getVoiceMouldSm());
  181. }catch(Exception e){
  182. logger.info(e.getMessage());
  183. }
  184. if(StringUtils.isBlank(voiceMouldSmId)){
  185. return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"参数错误,未找到声音模板数据");
  186. }
  187. if(StringUtils.isBlank(mouldVideo.getPaperwork())){
  188. return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"未填写视频文案数据");
  189. }
  190. if (record.getSubtitleEnabled()==1){
  191. //开启字幕
  192. videoUpd.setSubtitleParams(record.getSubtitleParams());
  193. }
  194. //TODO 设置预估时长
  195. // videoUpd.setVideoTime();
  196. }else if(EnumVoiceFrom.FROM_UPD.getCode().equals(voiceFrom)){
  197. String voiceMaterialUrl = mouldVideo.getVoiceMaterialUrl();
  198. VoiceMaterial voiceMaterial = voiceMaterialService.getById(mouldVideo.getVoiceMaterialId());
  199. if(StringUtils.isBlank(voiceMaterialUrl)){
  200. voiceMaterialService.handVideoUrl(voiceMaterial);
  201. voiceMaterialUrl = voiceMaterial.getMaterial();
  202. }
  203. if(StringUtils.isBlank(voiceMaterialUrl)){
  204. return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"未找到上传声音文件");
  205. }
  206. videoUpd.setVoiceMaterialUrl(voiceMaterialUrl);
  207. // videoUpd.setVideoTime(String.valueOf(voiceMaterial.getTime()));
  208. } else if (EnumVoiceFrom.MUSIC.getCode().equals(voiceFrom)) {
  209. Long musicId = mouldVideo.getMusicId();
  210. MusicInfo musicInfo = musicInfoService.getById(musicId);
  211. if (ObjectUtils.isEmpty(musicInfo)) {
  212. return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"未找到音乐文件");
  213. }
  214. if (StringUtils.isBlank(musicInfo.getUrl())) {
  215. return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"音乐文件错误");
  216. }
  217. if(musicInfo.getTime() == null){
  218. return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"音乐时长为空");
  219. }
  220. videoUpd.setVoiceMaterialUrl(musicInfo.getUrl());
  221. // videoUpd.setVideoTime(String.valueOf(musicInfo.getTime()));
  222. } else {
  223. return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"声音数据异常");
  224. }
  225. PhotoSpeakVideo mouldVideoUpd = new PhotoSpeakVideo();
  226. mouldVideoUpd.setId(record.getId());
  227. mouldVideoUpd.setVideoStatus(EnumVideoStatus.ing.getCode());
  228. mouldVideoUpd.setVideoMsg("");
  229. mouldVideoUpd.setCreateVideoDate(new Date());
  230. photoSpeakVideoService.saveOrUpdate(mouldVideoUpd);
  231. photoSpeakVideoService.createVideo(videoUpd);
  232. return new ResultData();
  233. }
  234. @ApiOperation("根据id查询接口")
  235. @GetMapping("/findVideo")
  236. @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
  237. public ResultData findVideo(Long id) {
  238. logger.debug("[" + getIpAddr() + "] MouldPatchController::findVideo");
  239. PhotoSpeakVideo photoSpeakVideo = photoSpeakVideoService.findVideo(id);
  240. // if(EnumVideoStatus.upload_ing.getCode().equals(userMouldVideo.getVideoStatus())
  241. // || EnumVideoStatus.upload_success.getCode().equals(userMouldVideo.getVideoStatus())
  242. // || EnumVideoStatus.upload_fail.getCode().equals(userMouldVideo.getVideoStatus())){
  243. // //上传阿里云状态 都是生成成功
  244. // userMouldVideo.setVideoStatus(EnumVideoStatus.success.getCode());
  245. // }
  246. return new ResultData(photoSpeakVideo);
  247. }
  248. @GetMapping(value = "/videoDetial")
  249. @ApiOperation("视频详情")
  250. @ApiImplicitParams({
  251. @ApiImplicitParam(name = "videoId", value = "视频编号", dataType = "String", paramType = "query", required = true)})
  252. public ResultData videoDetial(String videoId) {
  253. try {
  254. VideUploadResult videoDetail = videoFactory.getExcutor(videoType).getVideoDetailWithCache(videoId,true);
  255. return new ResultData(videoDetail);
  256. } catch (Exception e) {
  257. logger.error(e.getMessage());
  258. return new ResultData(ErrorCode.PICTURE_ANALYZING_ERROR);
  259. }
  260. }
  261. @AuthIgnore
  262. @SneakyThrows
  263. @GetMapping("exportVideo")
  264. public void exportVideo(Long id, HttpServletRequest request, HttpServletResponse response) {
  265. logger.debug("[" + getIpAddr() + "] UserMouldVideoController::exportVideo");
  266. response.reset();
  267. File tmpFile = null;
  268. OutputStream outputStream = null;
  269. try {
  270. outputStream = response.getOutputStream();
  271. } catch (IOException e) {
  272. throw new MallinkException(ErrorCode.SYS_SERVER_ERROR);
  273. }
  274. try{
  275. if(id == null){
  276. throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL);
  277. }
  278. PhotoSpeakVideo photoSpeakVideo = photoSpeakVideoService.getById(id);
  279. // if(mouldVideo == null || !mouldVideo.getUserId().equals(getMemberId())){
  280. // throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到用户数据");
  281. // }
  282. if(!EnumVideoStatus.upload_success.getCode().equals(photoSpeakVideo.getVideoStatus())){
  283. throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"视频未生成成功");
  284. }
  285. //获取响应的输出流
  286. InputStream inputStream = new URL(photoSpeakVideo.getVideoPlayUrl()).openStream();
  287. //获取从那个字节开始读取文件
  288. // String rangeString = request.getHeader("Range");
  289. // if(StringUtils.isNotBlank(rangeString)){
  290. // tmpFile = FileUtils.createTmpFile(inputStream, mouldVideo.getId().toString(), "mp4");
  291. // RandomAccessFile targetFile = new RandomAccessFile(tmpFile, "r");
  292. // long fileLength = targetFile.length();
  293. // long range = Long.valueOf(rangeString.substring(rangeString.indexOf("=") + 1, rangeString.indexOf("-")));
  294. // //设置内容类型
  295. // response.setHeader("Content-Type", "video/mp4");
  296. // //设置此次相应返回的数据长度
  297. // response.setHeader("Content-Length", String.valueOf(fileLength - range));
  298. // //设置此次相应返回的数据范围
  299. // response.setHeader("Content-Range", "bytes "+range+"-"+(fileLength-1)+"/"+fileLength);
  300. // //返回码需要为206,而不是200
  301. // response.setStatus(HttpServletResponse.SC_PARTIAL_CONTENT);
  302. // //设定文件读取开始位置(以字节为单位)
  303. // targetFile.seek(range);
  304. //
  305. // byte[] cache = new byte[1024 * 300];
  306. // int flag;
  307. // while ((flag = targetFile.read(cache))!=-1){
  308. // outputStream.write(cache, 0, flag);
  309. // }
  310. // }else{
  311. response.setHeader("Content-Disposition", "attachment; filename="
  312. + URLEncoder.encode(photoSpeakVideo.getId()+".mp4", "UTF-8"));
  313. //解决编码问题
  314. response.setCharacterEncoding("UTF-8");
  315. response.setHeader("Content-Type","application/octet-stream");
  316. byte[] cache = new byte[1024 * 300];
  317. int flag;
  318. while ((flag = inputStream.read(cache))!=-1){
  319. outputStream.write(cache, 0, flag);
  320. }
  321. // }
  322. }catch(MallinkException e){
  323. ResultData resultData = new ResultData(e.getErrorCode(), e.getMessage());
  324. //解决编码问题
  325. response.setCharacterEncoding("UTF-8");
  326. response.setHeader("Content-Type","application/json");
  327. outputStream.write(JSONObject.toJSONString(resultData).getBytes(StandardCharsets.UTF_8));
  328. }finally {
  329. if (tmpFile != null) {
  330. tmpFile.delete();
  331. }
  332. outputStream.flush();
  333. outputStream.close();
  334. }
  335. }
  336. @AuthIgnore
  337. @GetMapping(value = "/music")
  338. @ApiImplicitParams({
  339. @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
  340. @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
  341. @ApiOperation("获取默认音乐")
  342. public ResultData music(@ModelAttribute MusicInfo record, Integer pageNum, Integer pageSize) {
  343. logger.debug("[" + getIpAddr() + "] UserMouldVideoController::userList");
  344. if (record == null) record = new MusicInfo();
  345. PageInfo<MusicInfo> music = musicInfoService.music(pageNum, pageSize, record);
  346. return new ResultData(music);
  347. }
  348. @GetMapping(value = "/userMusic")
  349. @ApiImplicitParams({
  350. @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
  351. @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
  352. @ApiOperation("获取用户音乐")
  353. public ResultData userMusic(@ModelAttribute MusicInfo record, Integer pageNum, Integer pageSize) {
  354. logger.debug("[" + getIpAddr() + "] UserMouldVideoController::userMusic");
  355. if (record == null) record = new MusicInfo();
  356. record.setUserId(getMemberId());
  357. PageInfo<MusicInfo> music = musicInfoService.userMusic(pageNum, pageSize, record);
  358. return new ResultData(music);
  359. }
  360. @ApiOperation("新增接口")
  361. @PostMapping("/save")
  362. public ResultData save(@RequestBody MusicInfo record) {
  363. logger.debug("[" + getIpAddr() + "] UserMouldVideoController::save");
  364. if (record == null) record = new MusicInfo();
  365. record.setType(EnumMouldSendType.build.getCode());
  366. record.setUserId(getMemberId());
  367. if (record.getTitle() == null) {
  368. record.setTitle("用户自建");
  369. }
  370. return musicInfoService.saveOrUpdate(record);
  371. }
  372. @ApiOperation("根据id删除接口")
  373. @GetMapping("/delete")
  374. @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
  375. public ResultData delete(Long id) {
  376. logger.debug("[" + getIpAddr() + "] PersonPhotoController::delete");
  377. if(id == null){
  378. return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"参数为空");
  379. }
  380. MusicInfo musicInfo = musicInfoService.getById(id);
  381. if(musicInfo == null){
  382. return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到数据");
  383. }
  384. if(!musicInfo.getUserId().equals(getMemberId())){
  385. return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到用户数据");
  386. }
  387. musicInfoService.deleteById(id);
  388. return new ResultData();
  389. }
  390. @AuthIgnore
  391. @ApiOperation("视频超分")
  392. @GetMapping("/videoHy")
  393. @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
  394. public ResultData videoHy(Long id) {
  395. logger.debug("[" + getIpAddr() + "] PersonPhotoController::videoHy");
  396. if(id == null){
  397. return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"参数为空");
  398. }
  399. PhotoSpeakVideo speakVideo = photoSpeakVideoService.getById(id);
  400. if(speakVideo == null){
  401. return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到数据");
  402. }
  403. if (StringUtils.isEmpty(speakVideo.getSaveDir())){
  404. return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"save_dir为空");
  405. }
  406. // if(!speakVideo.getUserId().equals(getMemberId())){
  407. // return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"未找到用户数据");
  408. // }
  409. if(EnumVideoStatus.hy_ing.getCode().equals(speakVideo.getVideoStatus())
  410. || EnumVideoStatus.hy_success.getCode().equals(speakVideo.getVideoStatus())
  411. || EnumVideoStatus.hy_upload_ing.getCode().equals(speakVideo.getVideoStatus())
  412. || EnumVideoStatus.hy_upload_fail.getCode().equals(speakVideo.getVideoStatus())){
  413. return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"高清晰度视频生成中");
  414. }
  415. if(EnumVideoStatus.hy_upload_success.getCode().equals(speakVideo.getVideoStatus())){
  416. //上传阿里云状态 生成成功
  417. return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"高清晰度视频已生成完成");
  418. }
  419. speakVideo.setVideoStatus(EnumVideoStatus.hy_ing.getCode());
  420. speakVideo.setVideoMsg("");
  421. speakVideo.setIsHy(EnumYesOrNo.YES.getCode());
  422. speakVideo.setUpdateDate(new Date());
  423. photoSpeakVideoService.updateById(speakVideo);
  424. photoSpeakVideoService.videoHy(speakVideo);
  425. return new ResultData();
  426. }
  427. @ApiOperation("获取视频是否生成成功")
  428. @GetMapping("/checkVideoStatus")
  429. @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
  430. public ResultData checkVideoStatus(@RequestParam("list") List<Long> list) {
  431. return photoSpeakVideoService.checkVideoStatus(getMemberId(),list);
  432. }
  433. }