@@ -1,9 +1,11 @@ | |||
package com.tuoheng.admin.controller.callback; | |||
import com.alibaba.fastjson.JSONObject; | |||
import com.tuoheng.admin.entity.request.third.DspCallbackRequest; | |||
import com.tuoheng.admin.entity.request.third.DspRecordingCallbackRequest; | |||
import com.tuoheng.admin.service.third.dsp.IDspCallbackService; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.*; | |||
@@ -17,6 +19,7 @@ import javax.validation.constraints.Pattern; | |||
* @author 拓恒 | |||
* @since 2021-09-01 | |||
*/ | |||
@Slf4j | |||
@RestController | |||
@RequestMapping("/dsp/callback") | |||
public class DspCallbackController { | |||
@@ -38,13 +41,14 @@ public class DspCallbackController { | |||
} | |||
/** | |||
* 视频地址回调接口 | |||
* 录制视频地址回调接口 | |||
* | |||
* @param request 回调请求体 | |||
* @return JsonResult | |||
*/ | |||
@PostMapping("/recording") | |||
public JsonResult recordingCallBack(@Valid @RequestBody DspRecordingCallbackRequest request) { | |||
log.info("DSP服务回调地址接收成功, 录制视频,request:{}", JSONObject.toJSONString(request)); | |||
return dspCallbackService.recordingCallbackData(request); | |||
} | |||
} |
@@ -2,6 +2,7 @@ package com.tuoheng.admin.service.third.dsp.callback; | |||
import cn.hutool.core.util.ObjectUtil; | |||
import com.alibaba.fastjson.JSON; | |||
import com.alibaba.fastjson.JSONObject; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.tuoheng.admin.entity.domain.*; | |||
@@ -52,7 +53,14 @@ public class DspRecordingCallbackService { | |||
* @return | |||
*/ | |||
public JsonResult callback(DspRecordingCallbackRequest request) { | |||
log.info("DSP服务回调地址接收成功, request:{}", request); | |||
if (ObjectUtil.isEmpty(request)) { | |||
log.info("DSP服务回调地址接收成功, 数据为空"); | |||
return JsonResult.success("DSP服务回调地址接收成功, 数据为空"); | |||
} | |||
if (StringUtils.isEmpty(request.getRecordingVideoUrl())) { | |||
log.info("DSP服务回调地址接收成功, 录屏视频地址为空"); | |||
return JsonResult.success("DSP服务回调地址接收成功, 录屏视频地址为空"); | |||
} | |||
// 查询业务表数据 | |||
Business business = businessMapper.selectOne(new LambdaQueryWrapper<Business>() |