|
@@ -1,50 +1,28 @@ |
|
|
package com.iformall.controller; |
|
|
package com.iformall.controller; |
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.baomidou.mybatisplus.extension.api.R; |
|
|
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
|
|
import com.iformall.annotation.AuthIgnore; |
|
|
import com.iformall.annotation.AuthIgnore; |
|
|
import com.iformall.common.ErrorCode; |
|
|
import com.iformall.common.ErrorCode; |
|
|
import com.iformall.common.ResultData; |
|
|
import com.iformall.common.ResultData; |
|
|
import com.iformall.domain.po.base.BaseEntity; |
|
|
|
|
|
import com.iformall.domain.po.sm.*; |
|
|
import com.iformall.domain.po.sm.*; |
|
|
import com.iformall.enums.EnumDigitalAvatarOrderStatus; |
|
|
import com.iformall.enums.EnumDigitalAvatarOrderStatus; |
|
|
import com.iformall.enums.EnumVideoStatus; |
|
|
import com.iformall.enums.EnumVideoStatus; |
|
|
import com.iformall.exception.MallinkException; |
|
|
|
|
|
import com.iformall.service.sm.*; |
|
|
import com.iformall.service.sm.*; |
|
|
import com.iformall.sm.DigitalAvatarResult; |
|
|
|
|
|
import com.iformall.video.VideoFactory; |
|
|
|
|
|
import com.iformall.video.aliyun.sdk.server.UploadCacheHelper; |
|
|
|
|
|
import com.iformall.video.entity.VideUploadResult; |
|
|
|
|
|
import io.swagger.annotations.Api; |
|
|
import io.swagger.annotations.Api; |
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
import io.swagger.annotations.ApiOperation; |
|
|
import lombok.SneakyThrows; |
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.flowable.idm.engine.impl.persistence.entity.UserEntity; |
|
|
|
|
|
import org.slf4j.Logger; |
|
|
import org.slf4j.Logger; |
|
|
import org.slf4j.LoggerFactory; |
|
|
import org.slf4j.LoggerFactory; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
|
import java.io.File; |
|
|
|
|
|
import java.io.IOException; |
|
|
|
|
|
import java.io.InputStream; |
|
|
|
|
|
import java.io.OutputStream; |
|
|
|
|
|
import java.net.URL; |
|
|
|
|
|
import java.net.URLEncoder; |
|
|
|
|
|
import java.nio.charset.StandardCharsets; |
|
|
|
|
|
import java.util.*; |
|
|
import java.util.*; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RestController |
|
|
@RestController |
|
|
@RequestMapping("/callback") |
|
|
@RequestMapping("/callback") |
|
|
@Api(description = "视频回调") |
|
|
@Api(description = "视频回调") |
|
|
public class CallbackController extends BaseController { |
|
|
|
|
|
|
|
|
public class CallbackSmController extends BaseController { |
|
|
private final Logger logger = LoggerFactory.getLogger(this.getClass()); |
|
|
private final Logger logger = LoggerFactory.getLogger(this.getClass()); |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
@@ -57,7 +35,7 @@ public class CallbackController extends BaseController { |
|
|
@ApiOperation("视频回调") |
|
|
@ApiOperation("视频回调") |
|
|
@PostMapping(value = "/photo/speak") |
|
|
@PostMapping(value = "/photo/speak") |
|
|
public ResultData photoSpeak(@RequestBody Map<String, Object> paranMap) { |
|
|
public ResultData photoSpeak(@RequestBody Map<String, Object> paranMap) { |
|
|
logger.debug("[" + getIpAddr() + "] VideoCallbackController::photoSpeak"); |
|
|
|
|
|
|
|
|
logger.debug("[" + getIpAddr() + "] CallbackSmController::photoSpeak"); |
|
|
logger.info("照片生成视频结果通知{}"+JSONObject.toJSONString(paranMap)); |
|
|
logger.info("照片生成视频结果通知{}"+JSONObject.toJSONString(paranMap)); |
|
|
Long task_id = (Long) paranMap.get("task_id");//任务ID |
|
|
Long task_id = (Long) paranMap.get("task_id");//任务ID |
|
|
String code = (String) paranMap.get("code");//code |
|
|
String code = (String) paranMap.get("code");//code |
|
@@ -133,7 +111,7 @@ public class CallbackController extends BaseController { |
|
|
@ApiOperation("生成照片回调") |
|
|
@ApiOperation("生成照片回调") |
|
|
@PostMapping(value = "/create/photo") |
|
|
@PostMapping(value = "/create/photo") |
|
|
public ResultData createPhoto(@RequestBody Map<String, Object> paranMap) { |
|
|
public ResultData createPhoto(@RequestBody Map<String, Object> paranMap) { |
|
|
logger.debug("[" + getIpAddr() + "] VideoCallbackController::photoSpeak"); |
|
|
|
|
|
|
|
|
logger.debug("[" + getIpAddr() + "] CallbackSmController::photoSpeak"); |
|
|
logger.info("照片生成视频结果通知{}"+JSONObject.toJSONString(paranMap)); |
|
|
logger.info("照片生成视频结果通知{}"+JSONObject.toJSONString(paranMap)); |
|
|
Long task_id = (Long) paranMap.get("task_id");//任务ID |
|
|
Long task_id = (Long) paranMap.get("task_id");//任务ID |
|
|
Integer code = (Integer) paranMap.get("code");//code |
|
|
Integer code = (Integer) paranMap.get("code");//code |