腾讯云音视频上窜回调防重

This commit is contained in:
pserimal
2023-06-30 14:54:51 +08:00
parent a927cab8ee
commit df0a5be343
5 changed files with 16 additions and 4 deletions

View File

@@ -102,4 +102,8 @@ public interface HyPartnerInterviewMapper {
*/
void addVideoUrl(@Param("roomId") String roomId, @Param("videoUrl") String videoUrl);
/**
* 查询是否已有该链接
*/
Boolean hasVideoUrls(@Param("videoUrl") String videoUrl);
}

View File

@@ -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>

View File

@@ -374,9 +374,6 @@
<if test="record.endTime != null and record.endTime != ''">
and hpip.end_time &lt;= #{record.endTime}
</if>
<if test="record.deleted !=null and record.deleted!=''">
and hpip.deleted = #{deleted}
</if>
</where>
</select>

View File

@@ -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();

View File

@@ -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;
}