|
@@ -55,7 +55,8 @@ public class WebSocketMobileServer implements Concurrently {
|
|
|
* 与某个客户端的连接会话,需要通过它来给客户端发送数据
|
|
|
*/
|
|
|
private Session session = null;
|
|
|
- private String sessionId = null, ip = null, platform = null, deviceId = null, authorization = null, url = "/ws/mobile", websocketSessionId = null;
|
|
|
+ private Platform platform = null;
|
|
|
+ private String sessionId = null, ip = null, deviceId = null, authorization = null, url = "/ws/mobile", websocketSessionId = null;
|
|
|
private Long time = null, recordId = null, updateTime = null;
|
|
|
private RedisUtil redisUtil;
|
|
|
private Map<String, Object> tranMap = null;
|
|
@@ -75,18 +76,18 @@ public class WebSocketMobileServer implements Concurrently {
|
|
|
if (Objects.isNull(mapParameter.get(Constants.HEADER_PLATFORM)) || mapParameter.get(Constants.HEADER_PLATFORM).size() == 0) {
|
|
|
throw new BusinessException(ExceptionResultEnum.PLATFORM_INVALID);
|
|
|
}
|
|
|
- this.platform = String.valueOf(mapParameter.get(Constants.HEADER_PLATFORM).get(0));
|
|
|
+ this.platform = Platform.valueOf(mapParameter.get(Constants.HEADER_PLATFORM).get(0));
|
|
|
if (Objects.isNull(mapParameter.get(Constants.HEADER_DEVICE_ID)) || mapParameter.get(Constants.HEADER_DEVICE_ID).size() == 0) {
|
|
|
throw new BusinessException(ExceptionResultEnum.DEVICE_ID_INVALID);
|
|
|
}
|
|
|
- this.deviceId = String.valueOf(mapParameter.get(Constants.HEADER_DEVICE_ID).get(0));
|
|
|
- this.authorization = String.valueOf(mapParameter.get(Constants.HEADER_AUTHORIZATION).get(0));
|
|
|
- this.time = Long.parseLong(String.valueOf(mapParameter.get(Constants.HEADER_TIME).get(0)));
|
|
|
- this.recordId = Long.parseLong(String.valueOf(mapParameter.get(Constants.HEADER_RECORD_ID).get(0)));
|
|
|
+ this.deviceId = mapParameter.get(Constants.HEADER_DEVICE_ID).get(0);
|
|
|
+ this.authorization = mapParameter.get(Constants.HEADER_AUTHORIZATION).get(0);
|
|
|
+ this.time = Long.parseLong(mapParameter.get(Constants.HEADER_TIME).get(0));
|
|
|
+ this.recordId = Long.parseLong(mapParameter.get(Constants.HEADER_RECORD_ID).get(0));
|
|
|
this.source = MonitorVideoSourceEnum.valueOf(mapParameter.get(Constants.HEADER_SOURCE).get(0));
|
|
|
|
|
|
this.redisUtil = SpringContextHolder.getBean(RedisUtil.class);
|
|
|
- TBSession tbSession = AuthUtil.websocketAuthInterceptor(Platform.valueOf(platform), deviceId, authorization, Long.parseLong(mapParameter.get(Constants.HEADER_TIME).get(0)), SystemConstant.GET, url);
|
|
|
+ TBSession tbSession = AuthUtil.websocketAuthInterceptor(this.platform, this.deviceId, this.authorization, this.time, SystemConstant.GET, this.url);
|
|
|
WebsocketUtil.checkExamStatus(this.recordId);
|
|
|
this.session = session;
|
|
|
session.setMaxIdleTimeout(SystemConstant.WEBSOCKET_MAX_TIME_OUT);
|