This commit is contained in:
zhangchenbiao
2024-03-12 11:23:18 +08:00
parent 949960ce6d
commit e5d4b5266d
11 changed files with 323 additions and 8 deletions

View File

@@ -0,0 +1,46 @@
package com.cool.store.controller;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.dto.trtc.callback.VideoCallBackDTO;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.TRTCVideoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/video")
@Api(tags = "腾讯音视频接口")
@Slf4j
public class VideoController {
@Autowired
private TRTCVideoService videoService;
@PostMapping("/callback")
@ApiOperation("音视频回调(腾讯云回调)")
public ResponseResult videoCallback(@RequestBody VideoCallBackDTO videoCallBackDTO) {
try {
log.info("腾讯音视频上传回调开始request{}", JSONObject.toJSONString(videoCallBackDTO));
//不是音视频上传的回调
if (311 != videoCallBackDTO.getEventType()) {
return null;
}
if (0 != videoCallBackDTO.getEventInfo().getPayload().getStatus()) {
log.error("腾讯音视频录制视频上传错误request\t{}", videoCallBackDTO);
return null;
}
videoService.handleVideoCallBack(videoCallBackDTO);
return new ResponseResult(0, "腾讯云回调音视频回调数据接收成功");
} catch (Exception e) {
log.error("腾讯音视频录制视频上传回调错误e\t{}", e.toString());
}
return null;
}
}

View File

@@ -56,9 +56,9 @@ corp.id=171cddee76471740
cdn.url=https://testhsaypic.coolstore.cn
#TRTC
trtc.sdkAppId=1400811820
trtc.secretKey=4854bab106c2ca2a2fda16a8c966933e28a078a34e458999d6227e8cd8ab8219
trtc.video.callback.secretKey=1ECEAD34DBD84E838BF07FC7360EA4D8
trtc.sdkAppId=1600026212
trtc.secretKey=e036b654c665f649f053a01ff6f5652a826980027be298d4d49949f6e26434a5
trtc.video.callback.secretKey=ur4wq2iFbRI03Q35
weixin.appId=wx997f2206e276e513
weixin.appSecret=90a51574dde00480316f81a552e6b5cb

View File

@@ -56,9 +56,9 @@ corp.id=171cddee76471740
cdn.url=https://testhsaypic.coolstore.cn
#TRTC
trtc.sdkAppId=1400811820
trtc.secretKey=4854bab106c2ca2a2fda16a8c966933e28a078a34e458999d6227e8cd8ab8219
trtc.video.callback.secretKey=1ECEAD34DBD84E838BF07FC7360EA4D8
trtc.sdkAppId=1600026212
trtc.secretKey=e036b654c665f649f053a01ff6f5652a826980027be298d4d49949f6e26434a5
trtc.video.callback.secretKey=ur4wq2iFbRI03Q35
weixin.appId=wx997f2206e276e513
weixin.appSecret=90a51574dde00480316f81a552e6b5cb

View File

@@ -1,7 +1,7 @@
spring.application.name=hsay-partner-webb
spring.profiles.active=test
server.port=31000
server.port=40000
server.servlet.context-path=/xfsg/pc
#logback