腾讯云音视频上窜回调防重
This commit is contained in:
@@ -102,4 +102,8 @@ public interface HyPartnerInterviewMapper {
|
||||
*/
|
||||
void addVideoUrl(@Param("roomId") String roomId, @Param("videoUrl") String videoUrl);
|
||||
|
||||
/**
|
||||
* 查询是否已有该链接
|
||||
*/
|
||||
Boolean hasVideoUrls(@Param("videoUrl") String videoUrl);
|
||||
}
|
||||
@@ -499,4 +499,10 @@
|
||||
)
|
||||
</update>
|
||||
|
||||
<select id="hasVideoUrls" resultType="java.lang.Boolean">
|
||||
SELECT COUNT(*)
|
||||
FROM hy_partner_interview
|
||||
WHERE FIND_IN_SET(#{videoUrl}, process_info)
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -374,9 +374,6 @@
|
||||
<if test="record.endTime != null and record.endTime != ''">
|
||||
and hpip.end_time <= #{record.endTime}
|
||||
</if>
|
||||
<if test="record.deleted !=null and record.deleted!=''">
|
||||
and hpip.deleted = #{deleted}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
@@ -26,6 +26,11 @@ public class TRTCVideoServiceImpl implements TRTCVideoService {
|
||||
|
||||
@Override
|
||||
public void handleVideoCallBack(VideoCallBackDTO videoCallBackDTO) {
|
||||
//防重
|
||||
Boolean hasVideoUrl = interviewMapper.hasVideoUrls(videoCallBackDTO.getEventInfo().getPayload().getTencentVod().getVideoUrl());
|
||||
if (hasVideoUrl) {
|
||||
return;
|
||||
}
|
||||
//将视频播放地址拼接到对应的面试信息字段中
|
||||
String videoUrl = videoCallBackDTO.getEventInfo().getPayload().getTencentVod().getVideoUrl();
|
||||
String roomId = videoCallBackDTO.getEventInfo().getRoomId();
|
||||
|
||||
@@ -57,7 +57,7 @@ public class VideoController {
|
||||
videoService.handleVideoCallBack(videoCallBackDTO);
|
||||
return new ResponseResult(0, "腾讯云回调音视频回调数据接收成功");
|
||||
} catch (Exception e) {
|
||||
log.error("腾讯音视频录制视频上传回调错误:request:\t{}", e.getMessage());
|
||||
log.error("腾讯音视频录制视频上传回调错误:e:\t{}", e.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user