|
@@ -105,21 +105,18 @@ public class TIeInvigilateCallMobileController {
|
|
|
@Transactional
|
|
|
public Result callApply(@ApiJsonObject(name = "callApplyMobile", value = {
|
|
|
@ApiJsonProperty(key = "recordId", type = "long", example = "1", description = "考试记录id", required = true),
|
|
|
+ @ApiJsonProperty(key = "source", description = "监考视频源", required = true)
|
|
|
}) @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")));
|
|
|
//获取考试记录缓存
|
|
|
String liveUrl = null;
|
|
|
- MonitorVideoSourceEnum source = null;
|
|
|
- if (Objects.nonNull(ExamRecordCacheUtil.getMonitorLiveUrlMobileFirst(recordId))) {
|
|
|
- source = MonitorVideoSourceEnum.MOBILE_FIRST;
|
|
|
- liveUrl = ExamRecordCacheUtil.getMonitorLiveUrlMobileFirst(recordId);
|
|
|
- } else if (Objects.nonNull(ExamRecordCacheUtil.getMonitorLiveUrlMobileSecond(recordId))) {
|
|
|
- source = MonitorVideoSourceEnum.MOBILE_SECOND;
|
|
|
- liveUrl = ExamRecordCacheUtil.getMonitorLiveUrlMobileSecond(recordId);
|
|
|
- }
|
|
|
if (Objects.isNull(source) || Objects.isNull(ExamRecordCacheUtil.getMonitorStatus(recordId, source.name()))) {
|
|
|
throw new BusinessException("推流状态为空");
|
|
|
}
|
|
@@ -172,12 +169,7 @@ public class TIeInvigilateCallMobileController {
|
|
|
if (Objects.nonNull(ExamRecordCacheUtil.getMonitorLiveUrl(recordId, source.name()))) {
|
|
|
liveUrl = ExamRecordCacheUtil.getMonitorLiveUrl(recordId, source.name());
|
|
|
}
|
|
|
- MonitorCallStatusSourceEnum callStatus = null;
|
|
|
- if (Objects.nonNull(ExamRecordCacheUtil.getMonitorCallStatus(recordId, source.name()))) {
|
|
|
- callStatus = ExamRecordCacheUtil.getMonitorCallStatus(recordId, source.name());
|
|
|
- } else {
|
|
|
- callStatus = MonitorCallStatusSourceEnum.STOP;
|
|
|
- }
|
|
|
+ MonitorCallStatusSourceEnum callStatus = Objects.nonNull(ExamRecordCacheUtil.getMonitorCallStatus(recordId, source.name())) ? ExamRecordCacheUtil.getMonitorCallStatus(recordId, source.name()) : null;
|
|
|
ExamRecordCacheUtil.setMonitorStatus(recordId, source.name(), status, true);
|
|
|
ExamRecordCacheUtil.setMonitorCallStatus(recordId, source.name(), callStatus);
|
|
|
String monitorKey = ExamRecordCacheUtil.getMonitorKey(recordId);
|
|
@@ -219,21 +211,18 @@ public class TIeInvigilateCallMobileController {
|
|
|
@Transactional
|
|
|
public Result callCancel(@ApiJsonObject(name = "callCancelExamMobile", value = {
|
|
|
@ApiJsonProperty(key = "recordId", type = "long", example = "1", description = "考试记录id", required = true),
|
|
|
+ @ApiJsonProperty(key = "source", description = "监考视频源", required = true)
|
|
|
}) @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")));
|
|
|
//获取考试记录缓存
|
|
|
String liveUrl = null;
|
|
|
- MonitorVideoSourceEnum source = null;
|
|
|
- if (Objects.nonNull(ExamRecordCacheUtil.getMonitorLiveUrlMobileFirst(recordId))) {
|
|
|
- source = MonitorVideoSourceEnum.MOBILE_FIRST;
|
|
|
- liveUrl = ExamRecordCacheUtil.getMonitorLiveUrlMobileFirst(recordId);
|
|
|
- } else if (Objects.nonNull(ExamRecordCacheUtil.getMonitorLiveUrlMobileSecond(recordId))) {
|
|
|
- source = MonitorVideoSourceEnum.MOBILE_SECOND;
|
|
|
- liveUrl = ExamRecordCacheUtil.getMonitorLiveUrlMobileSecond(recordId);
|
|
|
- }
|
|
|
if (Objects.isNull(source) || Objects.isNull(ExamRecordCacheUtil.getMonitorStatus(recordId, source.name()))) {
|
|
|
throw new BusinessException("推流状态为空");
|
|
|
}
|