新增华为融合通信类型

This commit is contained in:
wanggeng 2021-12-08 11:57:16 +08:00
parent 8650856864
commit 090de658ff
2 changed files with 16 additions and 18 deletions

View File

@ -13,7 +13,8 @@ public enum WebSocketCustomTypeEnum {
HUAWEI_RTC_CALL(11002, "华为实时通讯呼叫"), HUAWEI_RTC_CALL(11002, "华为实时通讯呼叫"),
HUAWEI_RTC_CALL_LOGIN_SUCCESS(11201, "华为实时通讯呼叫登录成功"), HUAWEI_RTC_CALL_LOGIN_SUCCESS(11201, "华为实时通讯呼叫登录成功"),
HUAWEI_RTC_CALL_NOT_SUPPORTED(11401, "华为实时通讯呼叫不支持"), HUAWEI_RTC_CALL_NOT_SUPPORTED(11401, "华为实时通讯呼叫不支持"),
HUAWEI_RTC_CALL_LOGIN_FAILED(11402, "华为实时通讯呼叫登录失败"); HUAWEI_RTC_CALL_LOGIN_FAILED(11402, "华为实时通讯呼叫登录失败"),
HUAWEI_RTC_EXIT_LOGIN(11403, "退出登录");
private int value; private int value;
private String summary; private String summary;

View File

@ -1,12 +1,11 @@
package cn.com.tenlion.usercenter.service.websocket; package cn.com.tenlion.usercenter.service.websocket;
import cn.com.tenlion.usercenter.enums.websocket.WebSocketCustomTypeEnum; import cn.com.tenlion.usercenter.enums.websocket.WebSocketCustomTypeEnum;
import cn.com.tenlion.usercenter.service.userrealtimelocation.IUserRealtimeLocationService;
import cn.com.tenlion.usercenter.service.huaweirtc.IHuaweiRtcService; import cn.com.tenlion.usercenter.service.huaweirtc.IHuaweiRtcService;
import cn.com.tenlion.usercenter.service.userrealtimelocation.IUserRealtimeLocationService;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import ink.wgink.common.base.DefaultBaseService; import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.exceptions.websocket.BaseSocketException; import ink.wgink.exceptions.websocket.BaseSocketException;
import ink.wgink.exceptions.websocket.CustomHandleException;
import ink.wgink.module.instantmessage.service.IWebSocketTextCustomService; import ink.wgink.module.instantmessage.service.IWebSocketTextCustomService;
import ink.wgink.module.instantmessage.websocket.pojo.WebSocketClientMessage; import ink.wgink.module.instantmessage.websocket.pojo.WebSocketClientMessage;
import ink.wgink.module.map.pojo.vos.userlocation.UserLocationVO; import ink.wgink.module.map.pojo.vos.userlocation.UserLocationVO;
@ -31,7 +30,6 @@ public class WebSocketTextCustomServiceImpl extends DefaultBaseService implement
@Override @Override
public void handle(Channel fromChannel, WebSocketClientMessage webSocketClientMessage) throws BaseSocketException { public void handle(Channel fromChannel, WebSocketClientMessage webSocketClientMessage) throws BaseSocketException {
try {
if (WebSocketCustomTypeEnum.LOCATION_REALTIME.getValue() == webSocketClientMessage.getType()) { if (WebSocketCustomTypeEnum.LOCATION_REALTIME.getValue() == webSocketClientMessage.getType()) {
UserLocationVO userLocationVO = JSONObject.parseObject(webSocketClientMessage.getBody(), UserLocationVO.class); UserLocationVO userLocationVO = JSONObject.parseObject(webSocketClientMessage.getBody(), UserLocationVO.class);
userRealtimeLocationService.save(userLocationVO); userRealtimeLocationService.save(userLocationVO);
@ -43,9 +41,8 @@ public class WebSocketTextCustomServiceImpl extends DefaultBaseService implement
huaweiRtcService.rtcCall(webSocketClientMessage); huaweiRtcService.rtcCall(webSocketClientMessage);
} else if (WebSocketCustomTypeEnum.HUAWEI_RTC_CALL_NOT_SUPPORTED.getValue() == webSocketClientMessage.getType()) { } else if (WebSocketCustomTypeEnum.HUAWEI_RTC_CALL_NOT_SUPPORTED.getValue() == webSocketClientMessage.getType()) {
huaweiRtcService.rtcCall(webSocketClientMessage); huaweiRtcService.rtcCall(webSocketClientMessage);
} } else if (WebSocketCustomTypeEnum.HUAWEI_RTC_EXIT_LOGIN.getValue() == webSocketClientMessage.getType()) {
} catch (Exception e) { huaweiRtcService.rtcCall(webSocketClientMessage);
throw new CustomHandleException(e.getMessage(), e);
} }
} }
} }