增加腾讯音视频上传完成回调成功日志及修改mapper

This commit is contained in:
pserimal
2023-06-26 14:21:29 +08:00
parent 14d9066a6e
commit 9abdbfcb2a
6 changed files with 23 additions and 6 deletions

View File

@@ -93,4 +93,12 @@ public interface HyPartnerInterviewMapper {
* @return * @return
*/ */
String getStatus(String interviewPlanId); String getStatus(String interviewPlanId);
/**
* 在面试信息表中添加面试录制视频链接
* @param roomId
* @param videoUrl
*/
void addVideoUrl(@Param("roomId") String roomId, @Param("videoUrl") String videoUrl);
} }

View File

@@ -478,4 +478,15 @@
WHERE interview_plan_id = #{interviewPlanId} WHERE interview_plan_id = #{interviewPlanId}
</select> </select>
<!-- 根据 room_id 添加 process_info -->
<update id="addVideoUrl">
UPDATE hy_partner_interview
SET process_info = IF(process_info IS NULL, #{videoUrl}, CONCAT(process_info, ',' ,#{videoUrl}))
WHERE interview_plan_id = (
SELECT id
FROM hy_partner_interview_plan
WHERE room_id = #{roomId}
)
</update>
</mapper> </mapper>

View File

@@ -3,7 +3,6 @@ package com.cool.store.service.impl;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;

View File

@@ -2,7 +2,6 @@ package com.cool.store.service.impl;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.cool.store.dao.HyInterviewDAO; import com.cool.store.dao.HyInterviewDAO;
import com.cool.store.dto.partner.EnterInterviewDto; import com.cool.store.dto.partner.EnterInterviewDto;
@@ -19,7 +18,6 @@ import com.cool.store.request.ModifyInterviewTimeReq;
import com.cool.store.service.PartnerInterviewService; import com.cool.store.service.PartnerInterviewService;
import com.cool.store.utils.TRTCUtils; import com.cool.store.utils.TRTCUtils;
import com.cool.store.vo.EnterInterviewVO; import com.cool.store.vo.EnterInterviewVO;
import com.cool.store.vo.EnterpriseUserBaseInfoVO;
import com.cool.store.vo.PartnerInterviewInfoVO; import com.cool.store.vo.PartnerInterviewInfoVO;
import com.cool.store.vo.PartnerPassLetterDetailVO; import com.cool.store.vo.PartnerPassLetterDetailVO;
import com.cool.store.vo.interview.InterviewVO; import com.cool.store.vo.interview.InterviewVO;

View File

@@ -1,6 +1,6 @@
package com.cool.store.service.impl; package com.cool.store.service.impl;
import com.cool.store.mapper.TRTCVideoCallBackMapper; import com.cool.store.mapper.HyPartnerInterviewMapper;
import com.cool.store.request.TRTCVideoCallBackReq; import com.cool.store.request.TRTCVideoCallBackReq;
import com.cool.store.service.TRTCVideoService; import com.cool.store.service.TRTCVideoService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -10,7 +10,7 @@ import org.springframework.stereotype.Service;
public class TRTCVideoServiceImpl implements TRTCVideoService { public class TRTCVideoServiceImpl implements TRTCVideoService {
@Autowired @Autowired
private TRTCVideoCallBackMapper videoCallBackMapper; private HyPartnerInterviewMapper interviewMapper;
/** /**
* 音视频上传成功后的回调处理 * 音视频上传成功后的回调处理
@@ -20,7 +20,7 @@ public class TRTCVideoServiceImpl implements TRTCVideoService {
//将视频播放地址拼接到对应的面试信息字段中 //将视频播放地址拼接到对应的面试信息字段中
String videoUrl = req.getEventInfo().getPayLoad().getTencentVod().getVideoUrl(); String videoUrl = req.getEventInfo().getPayLoad().getTencentVod().getVideoUrl();
String roomId = req.getEventInfo().getRoomId(); String roomId = req.getEventInfo().getRoomId();
videoCallBackMapper.addVideoUrl(roomId, videoUrl); interviewMapper.addVideoUrl(roomId, videoUrl);
} }
} }

View File

@@ -25,6 +25,7 @@ public class VideoController {
@PostMapping("/callback") @PostMapping("/callback")
@ApiOperation("音视频回调(腾讯云回调)") @ApiOperation("音视频回调(腾讯云回调)")
public ResponseResult videoCallback(@RequestBody String requestBody) { public ResponseResult videoCallback(@RequestBody String requestBody) {
log.info("腾讯音视频上传完成回调request{}", JSONObject.toJSONString(requestBody));
//由于腾讯云恶事做尽,它的回调参数不是驼峰法,首字母是大写,导致 SpringMVC 映射不上,只能手动映射了 //由于腾讯云恶事做尽,它的回调参数不是驼峰法,首字母是大写,导致 SpringMVC 映射不上,只能手动映射了
TRTCVideoCallBackReq req = JSONObject.parseObject(requestBody, TRTCVideoCallBackReq.class); TRTCVideoCallBackReq req = JSONObject.parseObject(requestBody, TRTCVideoCallBackReq.class);
//不是音视频上传的回调 //不是音视频上传的回调