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

475 行
22 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. //TODO 设置预估时长
  191. // videoUpd.setVideoTime();
  192. }else if(EnumVoiceFrom.FROM_UPD.getCode().equals(voiceFrom)){
  193. String voiceMaterialUrl = mouldVideo.getVoiceMaterialUrl();
  194. VoiceMaterial voiceMaterial = voiceMaterialService.getById(mouldVideo.getVoiceMaterialId());
  195. if(StringUtils.isBlank(voiceMaterialUrl)){
  196. voiceMaterialService.handVideoUrl(voiceMaterial);
  197. voiceMaterialUrl = voiceMaterial.getMaterial();
  198. }
  199. if(StringUtils.isBlank(voiceMaterialUrl)){
  200. return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"未找到上传声音文件");
  201. }
  202. videoUpd.setVoiceMaterialUrl(voiceMaterialUrl);
  203. // videoUpd.setVideoTime(String.valueOf(voiceMaterial.getTime()));
  204. } else if (EnumVoiceFrom.MUSIC.getCode().equals(voiceFrom)) {
  205. Long musicId = mouldVideo.getMusicId();
  206. MusicInfo musicInfo = musicInfoService.getById(musicId);
  207. if (ObjectUtils.isEmpty(musicInfo)) {
  208. return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"未找到音乐文件");
  209. }
  210. if (StringUtils.isBlank(musicInfo.getUrl())) {
  211. return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"音乐文件错误");
  212. }
  213. if(musicInfo.getTime() == null){
  214. return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"音乐时长为空");
  215. }
  216. videoUpd.setVoiceMaterialUrl(musicInfo.getUrl());
  217. // videoUpd.setVideoTime(String.valueOf(musicInfo.getTime()));
  218. } else {
  219. return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"声音数据异常");
  220. }
  221. PhotoSpeakVideo mouldVideoUpd = new PhotoSpeakVideo();
  222. mouldVideoUpd.setId(record.getId());
  223. mouldVideoUpd.setVideoStatus(EnumVideoStatus.ing.getCode());
  224. mouldVideoUpd.setVideoMsg("");
  225. mouldVideoUpd.setCreateVideoDate(new Date());
  226. photoSpeakVideoService.saveOrUpdate(mouldVideoUpd);
  227. photoSpeakVideoService.createVideo(videoUpd);
  228. return new ResultData();
  229. }
  230. @ApiOperation("根据id查询接口")
  231. @GetMapping("/findVideo")
  232. @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
  233. public ResultData findVideo(Long id) {
  234. logger.debug("[" + getIpAddr() + "] MouldPatchController::findVideo");
  235. PhotoSpeakVideo photoSpeakVideo = photoSpeakVideoService.findVideo(id);
  236. // if(EnumVideoStatus.upload_ing.getCode().equals(userMouldVideo.getVideoStatus())
  237. // || EnumVideoStatus.upload_success.getCode().equals(userMouldVideo.getVideoStatus())
  238. // || EnumVideoStatus.upload_fail.getCode().equals(userMouldVideo.getVideoStatus())){
  239. // //上传阿里云状态 都是生成成功
  240. // userMouldVideo.setVideoStatus(EnumVideoStatus.success.getCode());
  241. // }
  242. return new ResultData(photoSpeakVideo);
  243. }
  244. @GetMapping(value = "/videoDetial")
  245. @ApiOperation("视频详情")
  246. @ApiImplicitParams({
  247. @ApiImplicitParam(name = "videoId", value = "视频编号", dataType = "String", paramType = "query", required = true)})
  248. public ResultData videoDetial(String videoId) {
  249. try {
  250. VideUploadResult videoDetail = videoFactory.getExcutor(videoType).getVideoDetailWithCache(videoId);
  251. return new ResultData(videoDetail);
  252. } catch (Exception e) {
  253. logger.error(e.getMessage());
  254. return new ResultData(ErrorCode.PICTURE_ANALYZING_ERROR);
  255. }
  256. }
  257. @AuthIgnore
  258. @SneakyThrows
  259. @GetMapping("exportVideo")
  260. public void exportVideo(Long id, HttpServletRequest request, HttpServletResponse response) {
  261. logger.debug("[" + getIpAddr() + "] UserMouldVideoController::exportVideo");
  262. response.reset();
  263. File tmpFile = null;
  264. OutputStream outputStream = null;
  265. try {
  266. outputStream = response.getOutputStream();
  267. } catch (IOException e) {
  268. throw new MallinkException(ErrorCode.SYS_SERVER_ERROR);
  269. }
  270. try{
  271. if(id == null){
  272. throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL);
  273. }
  274. PhotoSpeakVideo photoSpeakVideo = photoSpeakVideoService.getById(id);
  275. // if(mouldVideo == null || !mouldVideo.getUserId().equals(getMemberId())){
  276. // throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到用户数据");
  277. // }
  278. if(!EnumVideoStatus.upload_success.getCode().equals(photoSpeakVideo.getVideoStatus())){
  279. throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"视频未生成成功");
  280. }
  281. //获取响应的输出流
  282. InputStream inputStream = new URL(photoSpeakVideo.getVideoPlayUrl()).openStream();
  283. //获取从那个字节开始读取文件
  284. // String rangeString = request.getHeader("Range");
  285. // if(StringUtils.isNotBlank(rangeString)){
  286. // tmpFile = FileUtils.createTmpFile(inputStream, mouldVideo.getId().toString(), "mp4");
  287. // RandomAccessFile targetFile = new RandomAccessFile(tmpFile, "r");
  288. // long fileLength = targetFile.length();
  289. // long range = Long.valueOf(rangeString.substring(rangeString.indexOf("=") + 1, rangeString.indexOf("-")));
  290. // //设置内容类型
  291. // response.setHeader("Content-Type", "video/mp4");
  292. // //设置此次相应返回的数据长度
  293. // response.setHeader("Content-Length", String.valueOf(fileLength - range));
  294. // //设置此次相应返回的数据范围
  295. // response.setHeader("Content-Range", "bytes "+range+"-"+(fileLength-1)+"/"+fileLength);
  296. // //返回码需要为206,而不是200
  297. // response.setStatus(HttpServletResponse.SC_PARTIAL_CONTENT);
  298. // //设定文件读取开始位置(以字节为单位)
  299. // targetFile.seek(range);
  300. //
  301. // byte[] cache = new byte[1024 * 300];
  302. // int flag;
  303. // while ((flag = targetFile.read(cache))!=-1){
  304. // outputStream.write(cache, 0, flag);
  305. // }
  306. // }else{
  307. response.setHeader("Content-Disposition", "attachment; filename="
  308. + URLEncoder.encode(photoSpeakVideo.getId()+".mp4", "UTF-8"));
  309. //解决编码问题
  310. response.setCharacterEncoding("UTF-8");
  311. response.setHeader("Content-Type","application/octet-stream");
  312. byte[] cache = new byte[1024 * 300];
  313. int flag;
  314. while ((flag = inputStream.read(cache))!=-1){
  315. outputStream.write(cache, 0, flag);
  316. }
  317. // }
  318. }catch(MallinkException e){
  319. ResultData resultData = new ResultData(e.getErrorCode(), e.getMessage());
  320. //解决编码问题
  321. response.setCharacterEncoding("UTF-8");
  322. response.setHeader("Content-Type","application/json");
  323. outputStream.write(JSONObject.toJSONString(resultData).getBytes(StandardCharsets.UTF_8));
  324. }finally {
  325. if (tmpFile != null) {
  326. tmpFile.delete();
  327. }
  328. outputStream.flush();
  329. outputStream.close();
  330. }
  331. }
  332. @AuthIgnore
  333. @GetMapping(value = "/music")
  334. @ApiImplicitParams({
  335. @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
  336. @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
  337. @ApiOperation("获取默认音乐")
  338. public ResultData music(@ModelAttribute MusicInfo record, Integer pageNum, Integer pageSize) {
  339. logger.debug("[" + getIpAddr() + "] UserMouldVideoController::userList");
  340. if (record == null) record = new MusicInfo();
  341. PageInfo<MusicInfo> music = musicInfoService.music(pageNum, pageSize, record);
  342. return new ResultData(music);
  343. }
  344. @GetMapping(value = "/userMusic")
  345. @ApiImplicitParams({
  346. @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
  347. @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
  348. @ApiOperation("获取用户音乐")
  349. public ResultData userMusic(@ModelAttribute MusicInfo record, Integer pageNum, Integer pageSize) {
  350. logger.debug("[" + getIpAddr() + "] UserMouldVideoController::userMusic");
  351. if (record == null) record = new MusicInfo();
  352. record.setUserId(getMemberId());
  353. PageInfo<MusicInfo> music = musicInfoService.userMusic(pageNum, pageSize, record);
  354. return new ResultData(music);
  355. }
  356. @ApiOperation("新增接口")
  357. @PostMapping("/save")
  358. public ResultData save(@RequestBody MusicInfo record) {
  359. logger.debug("[" + getIpAddr() + "] UserMouldVideoController::save");
  360. if (record == null) record = new MusicInfo();
  361. record.setType(EnumMouldSendType.build.getCode());
  362. record.setUserId(getMemberId());
  363. if (record.getTitle() == null) {
  364. record.setTitle("用户自建");
  365. }
  366. return musicInfoService.saveOrUpdate(record);
  367. }
  368. @ApiOperation("根据id删除接口")
  369. @GetMapping("/delete")
  370. @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
  371. public ResultData delete(Long id) {
  372. logger.debug("[" + getIpAddr() + "] PersonPhotoController::delete");
  373. if(id == null){
  374. return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"参数为空");
  375. }
  376. MusicInfo musicInfo = musicInfoService.getById(id);
  377. if(musicInfo == null){
  378. return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到数据");
  379. }
  380. if(!musicInfo.getUserId().equals(getMemberId())){
  381. return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到用户数据");
  382. }
  383. musicInfoService.deleteById(id);
  384. return new ResultData();
  385. }
  386. @AuthIgnore
  387. @ApiOperation("视频超分")
  388. @GetMapping("/videoHy")
  389. @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
  390. public ResultData videoHy(Long id) {
  391. logger.debug("[" + getIpAddr() + "] PersonPhotoController::videoHy");
  392. if(id == null){
  393. return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"参数为空");
  394. }
  395. PhotoSpeakVideo speakVideo = photoSpeakVideoService.getById(id);
  396. if(speakVideo == null){
  397. return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到数据");
  398. }
  399. if (StringUtils.isEmpty(speakVideo.getSaveDir())){
  400. return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"save_dir为空");
  401. }
  402. // if(!speakVideo.getUserId().equals(getMemberId())){
  403. // return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"未找到用户数据");
  404. // }
  405. if(EnumVideoStatus.hy_ing.getCode().equals(speakVideo.getVideoStatus())
  406. || EnumVideoStatus.hy_success.getCode().equals(speakVideo.getVideoStatus())
  407. || EnumVideoStatus.hy_upload_ing.getCode().equals(speakVideo.getVideoStatus())
  408. || EnumVideoStatus.hy_upload_fail.getCode().equals(speakVideo.getVideoStatus())){
  409. return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"高清晰度视频生成中");
  410. }
  411. if(EnumVideoStatus.hy_upload_success.getCode().equals(speakVideo.getVideoStatus())){
  412. //上传阿里云状态 生成成功
  413. return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"高清晰度视频已生成完成");
  414. }
  415. speakVideo.setVideoStatus(EnumVideoStatus.hy_ing.getCode());
  416. speakVideo.setVideoMsg("");
  417. speakVideo.setIsHy(EnumYesOrNo.YES.getCode());
  418. speakVideo.setUpdateDate(new Date());
  419. photoSpeakVideoService.updateById(speakVideo);
  420. photoSpeakVideoService.videoHy(speakVideo);
  421. return new ResultData();
  422. }
  423. @ApiOperation("获取视频是否生成成功")
  424. @GetMapping("/checkVideoStatus")
  425. @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
  426. public ResultData checkVideoStatus(@RequestParam("list") List<Long> list) {
  427. return photoSpeakVideoService.checkVideoStatus(getMemberId(),list);
  428. }
  429. }