| | |
| | | RongCloudParam param = new RongCloudParam(); |
| | | param.setUserId(userId); |
| | | param.setName(name); |
| | | Map map = rongCloudClient.getToken(getRongCloudHead(), param); |
| | | Map<String,Object> map = rongCloudClient.getToken(getRongCloudHead(), param); |
| | | token = (String) map.get("token"); |
| | | log.debug("用户" + userId + "获取到融云token:" + token); |
| | | } catch (Exception ex) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map checkOnline(List<String> userIds) { |
| | | public Map<String,Object> checkOnline(List<String> userIds) { |
| | | Map<String, Object> onlineMap = new HashMap<>(); |
| | | for (String userId : userIds) { |
| | | RongCloudParam param = new RongCloudParam(); |
| | | param.setUserId(userId); |
| | | Map isOnline = rongCloudClient.checkOnline(getRongCloudHead(), param); |
| | | Map<String,Object> isOnline = rongCloudClient.checkOnline(getRongCloudHead(), param); |
| | | onlineMap.put(userId, isOnline.get("status")); |
| | | } |
| | | return onlineMap; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean checkOnline(String userId) { |
| | | RongCloudParam param = new RongCloudParam(); |
| | | param.setUserId(userId); |
| | | Map<String,Object> isOnline = rongCloudClient.checkOnline(getRongCloudHead(), param); |
| | | return isOnline.get("status").equals("1"); |
| | | } |
| | | |
| | | /** |
| | |
| | | String nonce = RandomStringUtils.randomNumeric(18); |
| | | String timestamp = String.valueOf(new Date().getTime()); |
| | | String signature = DigestUtils.sha1Hex(appSecret + nonce + timestamp);//App Secret + Nonce + T |
| | | Map<String, Object> headerMap=new HashMap<>(); |
| | | headerMap.put("App-Key",appKey); |
| | | headerMap.put("Nonce",nonce); |
| | | headerMap.put("Timestamp",timestamp); |
| | | headerMap.put("Signature",signature); |
| | | Map<String, Object> headerMap = new HashMap<>(); |
| | | headerMap.put("App-Key", appKey); |
| | | headerMap.put("Nonce", nonce); |
| | | headerMap.put("Timestamp", timestamp); |
| | | headerMap.put("Signature", signature); |
| | | return headerMap; |
| | | } |
| | | } |