| | |
| | | package com.ruoyi.rongcloud.service.Impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dtflys.forest.exceptions.ForestRuntimeException; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | |
| | | Map<String, Object> map = rongCloudClient.getToken(getRongCloudHead(), param); |
| | | token = (String) map.get("token"); |
| | | log.debug("用户" + userId + "获取到融云token:" + token); |
| | | } catch (Exception ex) { |
| | | log.error("获取token异常:" + ex.getMessage()); |
| | | }catch(ForestRuntimeException ex) |
| | | { |
| | | log.error("获取融云token异常:" + ex.getMessage()); |
| | | } |
| | | return token; |
| | | } |
| | |
| | | Map<String, Object> groupMap = rongCloudClient.groupQuit(getRongCloudHead(), groupParam); |
| | | Integer code = (Integer) groupMap.get("code"); |
| | | if (code.equals(200)) { |
| | | ArdRongGroup ardRongGroup = ardRongGroupMapper.selectById(groupParam.getGroupId()); |
| | | ardRongGroup.setGroupName(groupParam.getGroupName()); |
| | | ardRongGroupMapper.updateById(ardRongGroup); |
| | | List<String> list = groupParam.getUserId(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | String userId = list.get(i); |
| | | QueryWrapper<ArdRongGroupUser> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("group_id",groupParam.getGroupId()) |
| | | .eq("user_id",userId); |
| | | ardRongGroupUserMapper.delete(queryWrapper); |
| | | } |
| | | } |
| | | groupMap.put("groupId", groupParam.getGroupId()); |
| | | groupMap.put("groupName", groupParam.getGroupName()); |