|
@@ -35,7 +35,7 @@ import java.util.Objects;
|
|
* @Author: wangliang
|
|
* @Author: wangliang
|
|
* @Date: 2020/6/25
|
|
* @Date: 2020/6/25
|
|
*/
|
|
*/
|
|
-@Api(tags = "mobile监考监控通话信息Controller")
|
|
|
|
|
|
+@Api(tags = "oe监考监控通话信息Controller")
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("/${prefix.url.exam}/monitor")
|
|
@RequestMapping("/${prefix.url.exam}/monitor")
|
|
public class TIeInvigilateCallOeController {
|
|
public class TIeInvigilateCallOeController {
|
|
@@ -47,9 +47,6 @@ public class TIeInvigilateCallOeController {
|
|
@Resource
|
|
@Resource
|
|
MqDtoService mqDtoService;
|
|
MqDtoService mqDtoService;
|
|
|
|
|
|
- @Resource
|
|
|
|
- TIeExamInvigilateCallService tIeExamInvigilateCallService;
|
|
|
|
-
|
|
|
|
@ApiOperation(value = "监控观看地址更新接口")
|
|
@ApiOperation(value = "监控观看地址更新接口")
|
|
@RequestMapping(value = "/live_url", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/live_url", method = RequestMethod.POST)
|
|
@ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
|
|
@@ -99,6 +96,53 @@ public class TIeInvigilateCallOeController {
|
|
return ResultUtil.ok(SystemConstant.SUCCESS);
|
|
return ResultUtil.ok(SystemConstant.SUCCESS);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @ApiOperation(value = "监控状态更新接口")
|
|
|
|
+ @RequestMapping(value = "/status", method = RequestMethod.POST)
|
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
|
|
|
|
+ @Transactional
|
|
|
|
+ public Result status(@ApiJsonObject(name = "statusOe", value = {
|
|
|
|
+ @ApiJsonProperty(key = "recordId", type = "long", example = "1", description = "考试记录id", required = true),
|
|
|
|
+ @ApiJsonProperty(key = "source", description = "监考视频源", required = true),
|
|
|
|
+ @ApiJsonProperty(key = "status", description = "当前状态", required = true),
|
|
|
|
+ @ApiJsonProperty(key = "type", description = "异常类型,status=stop时需要传递")
|
|
|
|
+ }) @ApiParam(value = "监控信息", required = true) @RequestBody Map<String, Object> mapParameter) {
|
|
|
|
+ if (Objects.isNull(mapParameter.get("recordId")) || Objects.equals(mapParameter.get("recordId"), "")) {
|
|
|
|
+ throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
|
|
|
|
+ }
|
|
|
|
+ Long recordId = Long.parseLong(String.valueOf(mapParameter.get("recordId")));
|
|
|
|
+ if (Objects.isNull(mapParameter.get("source")) || Objects.equals(mapParameter.get("source"), "")) {
|
|
|
|
+ throw new BusinessException("监考视频源不能为空");
|
|
|
|
+ }
|
|
|
|
+ MonitorVideoSourceEnum source = MonitorVideoSourceEnum.valueOf(String.valueOf(mapParameter.get("source")).toUpperCase());
|
|
|
|
+ if (Objects.isNull(mapParameter.get("status")) || Objects.equals(mapParameter.get("status"), "")) {
|
|
|
|
+ throw new BusinessException("监考视频状态不能为空");
|
|
|
|
+ }
|
|
|
|
+ MonitorStatusSourceEnum status = (MonitorStatusSourceEnum) mapParameter.get("status");
|
|
|
|
+ if (Objects.equals(status, MonitorStatusSourceEnum.STOP.name()) && (Objects.isNull(mapParameter.get("type")) || Objects.equals(mapParameter.get("type"), ""))) {
|
|
|
|
+ throw new BusinessException("异常类型不能为空");
|
|
|
|
+ }
|
|
|
|
+ //获取考试记录缓存
|
|
|
|
+ Map<String, Object> objectMap = redisUtil.getHashEntries(RedisKeyHelper.examRecordCacheKey(recordId));
|
|
|
|
+ String liveUrl = null;
|
|
|
|
+ if (Objects.nonNull(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + MonitorVideoSourceEnum.CLIENT_CAMERA.name()))) {
|
|
|
|
+ liveUrl = String.valueOf(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + MonitorVideoSourceEnum.CLIENT_CAMERA.name()));
|
|
|
|
+ } else if (Objects.nonNull(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + MonitorVideoSourceEnum.CLIENT_SCREEN.name()))) {
|
|
|
|
+ liveUrl = String.valueOf(objectMap.get(SystemConstant.MONITOR_LIVE_URL_ + MonitorVideoSourceEnum.CLIENT_SCREEN.name()));
|
|
|
|
+ }
|
|
|
|
+ objectMap.put(SystemConstant.MONITOR_STATUS_ + source, status);
|
|
|
|
+ TIeExamInvigilateCallLog tIeExamInvigilateCallLog = new TIeExamInvigilateCallLog(recordId, source, liveUrl, MonitorStatusSourceEnum.START);
|
|
|
|
+ if (Objects.nonNull(mapParameter.get("type")) || !Objects.equals(mapParameter.get("type"), "")) {
|
|
|
|
+ tIeExamInvigilateCallLog.setType((ExceptionEnum) mapParameter.get("type"));
|
|
|
|
+ }
|
|
|
|
+ redisUtil.setForHash(RedisKeyHelper.examRecordCacheKey(recordId), objectMap);
|
|
|
|
+
|
|
|
|
+ //监考监控通话信息 发送mq start
|
|
|
|
+ MqDto mqDto = new MqDto(MqTopicEnum.themisTopic.getCode(), MqTagEnum.monitorLog.name(), tIeExamInvigilateCallLog, MqTagEnum.monitorLog, String.valueOf(tIeExamInvigilateCallLog.getId()), source.name());
|
|
|
|
+ mqDtoService.assembleSendOneWayMsg(mqDto);
|
|
|
|
+ //监考监控通话信息 发送mq end
|
|
|
|
+ return ResultUtil.ok(SystemConstant.SUCCESS);
|
|
|
|
+ }
|
|
|
|
+
|
|
@ApiOperation(value = "发送通话申请接口")
|
|
@ApiOperation(value = "发送通话申请接口")
|
|
@RequestMapping(value = "/call/apply", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/call/apply", method = RequestMethod.POST)
|
|
@ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
|