|
|
@@ -3,14 +3,18 @@ package com.iformall.controller; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.iformall.annotation.AuthIgnore; |
|
|
|
import com.iformall.common.ErrorCode; |
|
|
|
import com.iformall.common.Result; |
|
|
|
import com.iformall.common.ResultData; |
|
|
|
import com.iformall.domain.po.ProductOrder; |
|
|
|
import com.iformall.domain.po.base.BaseEntity; |
|
|
|
import com.iformall.domain.po.sm.PersonMould; |
|
|
|
import com.iformall.domain.po.sm.UserMouldVideo; |
|
|
|
import com.iformall.domain.po.sm.VoiceLanguage; |
|
|
|
import com.iformall.domain.po.sm.VoiceMould; |
|
|
|
import com.iformall.domain.vo.sm.PreviewVoiceVO; |
|
|
|
import com.iformall.enums.*; |
|
|
|
import com.iformall.language.LanguageDetect; |
|
|
|
import com.iformall.service.ProductOrderService; |
|
|
|
import com.iformall.service.WxCVoiceService; |
|
|
|
import com.iformall.service.sm.*; |
|
|
|
import com.iformall.sm.AiPreviewParam; |
|
|
@@ -54,6 +58,9 @@ public class VoiceMouldController extends BaseController { |
|
|
|
@Autowired |
|
|
|
private WxCVoiceService wxCVoiceService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ProductOrderService productOrderService; |
|
|
|
|
|
|
|
@AuthIgnore |
|
|
|
@ApiOperation("获取语种") |
|
|
|
@GetMapping("getLanguages") |
|
|
@@ -174,6 +181,20 @@ public class VoiceMouldController extends BaseController { |
|
|
|
@ApiImplicitParams({}) |
|
|
|
public ResultData voicePreview(@RequestBody AiPreviewParam aiPreviewParam) { |
|
|
|
logger.debug("[" + getIpAddr() + "] MouldPatchController::voicePreview"); |
|
|
|
return new ResultData(voiceInfoService.previewVoice(aiPreviewParam)); |
|
|
|
PreviewVoiceVO pv = voiceInfoService.previewVoice(aiPreviewParam); |
|
|
|
Double time = pv.getTime();//秒 |
|
|
|
if (time > 5*60 ) { |
|
|
|
return new ResultData(Result.ERROR,"视频最大时长为300秒,当前时长为"+time+"秒"); |
|
|
|
} |
|
|
|
//如果用户未支付,则只能1分钟以内,如果已支付,则可以5分钟以内 |
|
|
|
ProductOrder po = new ProductOrder(); |
|
|
|
po.setUserId(getMemberId()); |
|
|
|
Integer paidCount = productOrderService.findPaidCount(po); |
|
|
|
if (null == paidCount || paidCount <= 0 ) { |
|
|
|
if (time > 60) { |
|
|
|
return new ResultData(Result.ERROR,"视频最大时长为60秒,当前时长为"+time+"秒"); |
|
|
|
} |
|
|
|
} |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
} |