Commit 0363ebf8 by Future

方法名称修改

parent f2f02b3f
...@@ -58,7 +58,7 @@ public class ImFriendController extends BaseController { ...@@ -58,7 +58,7 @@ public class ImFriendController extends BaseController {
if(param == null) { if(param == null) {
return ApiResult.fail(ApiCode.PARAMETER_EXCEPTION, null); return ApiResult.fail(ApiCode.PARAMETER_EXCEPTION, null);
} }
ImClient currentClient = imClientService.getCurentClient(); ImClient currentClient = imClientService.getCurrentClient();
if(currentClient == null) { if(currentClient == null) {
return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null); return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null);
} }
...@@ -79,7 +79,7 @@ public class ImFriendController extends BaseController { ...@@ -79,7 +79,7 @@ public class ImFriendController extends BaseController {
if(param == null) { if(param == null) {
return ApiResult.fail(ApiCode.PARAMETER_EXCEPTION, null); return ApiResult.fail(ApiCode.PARAMETER_EXCEPTION, null);
} }
ImClient currentClient = imClientService.getCurentClient(); ImClient currentClient = imClientService.getCurrentClient();
if(currentClient == null) { if(currentClient == null) {
return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null); return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null);
} }
...@@ -100,7 +100,7 @@ public class ImFriendController extends BaseController { ...@@ -100,7 +100,7 @@ public class ImFriendController extends BaseController {
@PostMapping("/unsureFriends") @PostMapping("/unsureFriends")
@ApiOperation(value = "待接受的好友请求列表,最多只返回1000个") @ApiOperation(value = "待接受的好友请求列表,最多只返回1000个")
public ApiResult<List<ImFriendApplyDto>> getUnsureFriends() { public ApiResult<List<ImFriendApplyDto>> getUnsureFriends() {
ImClient currentClient = imClientService.getCurentClient(); ImClient currentClient = imClientService.getCurrentClient();
if(currentClient == null) { if(currentClient == null) {
return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null); return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null);
} }
...@@ -117,7 +117,7 @@ public class ImFriendController extends BaseController { ...@@ -117,7 +117,7 @@ public class ImFriendController extends BaseController {
if(param == null || param.getAgree() == null) { if(param == null || param.getAgree() == null) {
return ApiResult.fail(ApiCode.PARAMETER_EXCEPTION, null); return ApiResult.fail(ApiCode.PARAMETER_EXCEPTION, null);
} }
ImClient currentClient = imClientService.getCurentClient(); ImClient currentClient = imClientService.getCurrentClient();
if(currentClient == null) { if(currentClient == null) {
return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null); return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null);
} }
...@@ -137,7 +137,7 @@ public class ImFriendController extends BaseController { ...@@ -137,7 +137,7 @@ public class ImFriendController extends BaseController {
@PostMapping("/batchDelete") @PostMapping("/batchDelete")
@ApiOperation(value = "删除好友") @ApiOperation(value = "删除好友")
public ApiResult<Boolean> batchDeleteFriend(@RequestBody ImDeleteFriendParam param) { public ApiResult<Boolean> batchDeleteFriend(@RequestBody ImDeleteFriendParam param) {
ImClient currentClient = imClientService.getCurentClient(); ImClient currentClient = imClientService.getCurrentClient();
if(currentClient == null) { if(currentClient == null) {
return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null); return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null);
} }
...@@ -153,7 +153,7 @@ public class ImFriendController extends BaseController { ...@@ -153,7 +153,7 @@ public class ImFriendController extends BaseController {
@OperationLog(name = "好友分页列表", type = OperationLogType.PAGE) @OperationLog(name = "好友分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "好友分页列表") @ApiOperation(value = "好友分页列表")
public ApiResult<Paging<ImFriendBaseDto>> getImFriendPageList(@RequestBody ImFriendPageParam pageParam) { public ApiResult<Paging<ImFriendBaseDto>> getImFriendPageList(@RequestBody ImFriendPageParam pageParam) {
ImClient currentClient = imClientService.getCurentClient(); ImClient currentClient = imClientService.getCurrentClient();
if(currentClient == null) { if(currentClient == null) {
return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null); return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null);
} }
...@@ -169,7 +169,7 @@ public class ImFriendController extends BaseController { ...@@ -169,7 +169,7 @@ public class ImFriendController extends BaseController {
@OperationLog(name = "批量创建好友推荐", type = OperationLogType.PAGE) @OperationLog(name = "批量创建好友推荐", type = OperationLogType.PAGE)
@ApiOperation(value = "批量创建好友推荐") @ApiOperation(value = "批量创建好友推荐")
public ApiResult<Boolean> batchCreateRecommend(@RequestBody ImCreateRecommendParam param) { public ApiResult<Boolean> batchCreateRecommend(@RequestBody ImCreateRecommendParam param) {
ImClient currentClient = imClientService.getCurentClient(); ImClient currentClient = imClientService.getCurrentClient();
if(currentClient == null) { if(currentClient == null) {
return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null); return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null);
} }
...@@ -192,7 +192,7 @@ public class ImFriendController extends BaseController { ...@@ -192,7 +192,7 @@ public class ImFriendController extends BaseController {
@OperationLog(name = "好友推荐分页列表", type = OperationLogType.PAGE) @OperationLog(name = "好友推荐分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "好友推荐分页列表") @ApiOperation(value = "好友推荐分页列表")
public ApiResult<Paging<ImFriendRecommendDto>> getImFriendRecommendPageList(@RequestBody ImFriendPageParam pageParam) { public ApiResult<Paging<ImFriendRecommendDto>> getImFriendRecommendPageList(@RequestBody ImFriendPageParam pageParam) {
ImClient currentClient = imClientService.getCurentClient(); ImClient currentClient = imClientService.getCurrentClient();
if(currentClient == null) { if(currentClient == null) {
return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null); return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null);
} }
...@@ -207,7 +207,7 @@ public class ImFriendController extends BaseController { ...@@ -207,7 +207,7 @@ public class ImFriendController extends BaseController {
@PostMapping("/recommend/batchDelete") @PostMapping("/recommend/batchDelete")
@ApiOperation(value = "删除好友推荐") @ApiOperation(value = "删除好友推荐")
public ApiResult<Boolean> batchDeleteRecommend(@RequestBody ImDeleteRecommendParam param) { public ApiResult<Boolean> batchDeleteRecommend(@RequestBody ImDeleteRecommendParam param) {
ImClient currentClient = imClientService.getCurentClient(); ImClient currentClient = imClientService.getCurrentClient();
if(currentClient == null) { if(currentClient == null) {
return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null); return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null);
} }
......
...@@ -17,7 +17,6 @@ import com.wecloud.im.vo.MyInfoVo; ...@@ -17,7 +17,6 @@ import com.wecloud.im.vo.MyInfoVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult; import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.service.BaseService; import io.geekidea.springbootplus.framework.common.service.BaseService;
import io.geekidea.springbootplus.framework.core.pagination.Paging; import io.geekidea.springbootplus.framework.core.pagination.Paging;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List; import java.util.List;
...@@ -133,7 +132,7 @@ public interface ImClientService extends BaseService<ImClient> { ...@@ -133,7 +132,7 @@ public interface ImClientService extends BaseService<ImClient> {
* *
* @return * @return
*/ */
ImClient getCurentClient(); ImClient getCurrentClient();
ImClient getCacheImClient(Long applicationId, String clientId); ImClient getCacheImClient(Long applicationId, String clientId);
......
...@@ -52,7 +52,7 @@ public class ImClientBlacklistServiceImpl extends BaseServiceImpl<ImClientBlackl ...@@ -52,7 +52,7 @@ public class ImClientBlacklistServiceImpl extends BaseServiceImpl<ImClientBlackl
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ApiResult<Boolean> addImClientBlacklist(ImClientBlacklistUpdate imClientBlacklistUpdate) throws Exception { public ApiResult<Boolean> addImClientBlacklist(ImClientBlacklistUpdate imClientBlacklistUpdate) throws Exception {
ImClient client = imClientService.getCurentClient(); ImClient client = imClientService.getCurrentClient();
if (client == null) { if (client == null) {
throw new BusinessException("当前用户登录信息失效"); throw new BusinessException("当前用户登录信息失效");
} }
...@@ -77,7 +77,7 @@ public class ImClientBlacklistServiceImpl extends BaseServiceImpl<ImClientBlackl ...@@ -77,7 +77,7 @@ public class ImClientBlacklistServiceImpl extends BaseServiceImpl<ImClientBlackl
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ApiResult<Boolean> removeImClientBlacklist(ImClientBlacklistUpdate imClientBlacklistUpdate) throws Exception { public ApiResult<Boolean> removeImClientBlacklist(ImClientBlacklistUpdate imClientBlacklistUpdate) throws Exception {
// 操作者 // 操作者
ImClient client = imClientService.getCurentClient(); ImClient client = imClientService.getCurrentClient();
if (client == null) { if (client == null) {
throw new BusinessException("当前用户登录信息失效"); throw new BusinessException("当前用户登录信息失效");
} }
...@@ -100,7 +100,7 @@ public class ImClientBlacklistServiceImpl extends BaseServiceImpl<ImClientBlackl ...@@ -100,7 +100,7 @@ public class ImClientBlacklistServiceImpl extends BaseServiceImpl<ImClientBlackl
Page<ImClientBlacklistQueryVo> page = new PageInfo<>(imClientBlacklistPageParam); Page<ImClientBlacklistQueryVo> page = new PageInfo<>(imClientBlacklistPageParam);
ImClient client = imClientService.getCurentClient(); ImClient client = imClientService.getCurrentClient();
IPage<ImClientBlacklistQueryVo> imClientBlacklistPageList = imClientBlacklistMapper.getImClientBlacklistPageList(page, client.getClientId()); IPage<ImClientBlacklistQueryVo> imClientBlacklistPageList = imClientBlacklistMapper.getImClientBlacklistPageList(page, client.getClientId());
......
...@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.wecloud.im.entity.ImApplication; import com.wecloud.im.entity.ImApplication;
import com.wecloud.im.entity.ImClient; import com.wecloud.im.entity.ImClient;
import com.wecloud.im.entity.ImClientBlacklist;
import com.wecloud.im.enums.FriendStateEnum; import com.wecloud.im.enums.FriendStateEnum;
import com.wecloud.im.enums.RelationEnum; import com.wecloud.im.enums.RelationEnum;
import com.wecloud.im.friend.entity.ImFriend; import com.wecloud.im.friend.entity.ImFriend;
...@@ -47,7 +46,6 @@ import org.springframework.cache.annotation.Cacheable; ...@@ -47,7 +46,6 @@ import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List; import java.util.List;
/** /**
...@@ -76,7 +74,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien ...@@ -76,7 +74,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien
@Override @Override
public MyInfoVo getMyInfo() { public MyInfoVo getMyInfo() {
ImClient currentClient = this.getCurentClient(); ImClient currentClient = this.getCurrentClient();
if (currentClient == null) { if (currentClient == null) {
throw new BusinessException("当前用户登录信息失效"); throw new BusinessException("当前用户登录信息失效");
} }
...@@ -88,7 +86,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien ...@@ -88,7 +86,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean updateHeadPortrait(ImClientHeadPortraitAdd imClientHeadPortraitAdd) { public boolean updateHeadPortrait(ImClientHeadPortraitAdd imClientHeadPortraitAdd) {
ImClient curentClient = getCurentClient(); ImClient curentClient = getCurrentClient();
curentClient.setHeadPortrait(imClientHeadPortraitAdd.getHeadPortrait()); curentClient.setHeadPortrait(imClientHeadPortraitAdd.getHeadPortrait());
imClientMapper.updateById(curentClient); imClientMapper.updateById(curentClient);
...@@ -100,7 +98,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien ...@@ -100,7 +98,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien
@Override @Override
public boolean updateNickname(ImClientNicknameUpdate imClientNicknameUpdate) { public boolean updateNickname(ImClientNicknameUpdate imClientNicknameUpdate) {
ImClient curentClient = getCurentClient(); ImClient curentClient = getCurrentClient();
curentClient.setNickname(imClientNicknameUpdate.getNickname()); curentClient.setNickname(imClientNicknameUpdate.getNickname());
imClientMapper.updateById(curentClient); imClientMapper.updateById(curentClient);
...@@ -112,7 +110,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien ...@@ -112,7 +110,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien
@Override @Override
public boolean updateHeadAndNickname(ImClientHeadPortraitAndNicknameUpdate imClientHeadPortraitAndNicknameUpdate) { public boolean updateHeadAndNickname(ImClientHeadPortraitAndNicknameUpdate imClientHeadPortraitAndNicknameUpdate) {
ImClient curentClient = getCurentClient(); ImClient curentClient = getCurrentClient();
curentClient.setHeadPortrait(imClientHeadPortraitAndNicknameUpdate.getHeadPortrait()); curentClient.setHeadPortrait(imClientHeadPortraitAndNicknameUpdate.getHeadPortrait());
curentClient.setNickname(imClientHeadPortraitAndNicknameUpdate.getNickname()); curentClient.setNickname(imClientHeadPortraitAndNicknameUpdate.getNickname());
imClientMapper.updateById(curentClient); imClientMapper.updateById(curentClient);
...@@ -125,7 +123,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien ...@@ -125,7 +123,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien
@Override @Override
public ApiResult<List<GetInfoListVo>> getInfoList(GetClientInfoParam getClientInfoParam) throws Exception { public ApiResult<List<GetInfoListVo>> getInfoList(GetClientInfoParam getClientInfoParam) throws Exception {
ImClient curentClient = getCurentClient(); ImClient curentClient = getCurrentClient();
if (getClientInfoParam.getClientIds() == null || getClientInfoParam.getClientIds().isEmpty()) { if (getClientInfoParam.getClientIds() == null || getClientInfoParam.getClientIds().isEmpty()) {
throw new BusinessException("getClientInfoParam.getClientIds() == null"); throw new BusinessException("getClientInfoParam.getClientIds() == null");
...@@ -154,7 +152,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien ...@@ -154,7 +152,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien
@Override @Override
public ClientInfoVo getClientInfo(ClientInfoParam param) { public ClientInfoVo getClientInfo(ClientInfoParam param) {
ImClient currentClient = this.getCurentClient(); ImClient currentClient = this.getCurrentClient();
if (currentClient == null) { if (currentClient == null) {
throw new BusinessException("当前用户登录信息失效"); throw new BusinessException("当前用户登录信息失效");
} }
...@@ -186,7 +184,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien ...@@ -186,7 +184,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean updateNickname(ImClientNicknameAdd imClientNicknameAdd) throws Exception { public boolean updateNickname(ImClientNicknameAdd imClientNicknameAdd) throws Exception {
ImClient curentClient = getCurentClient(); ImClient curentClient = getCurrentClient();
// shiro线程中获取当前token // shiro线程中获取当前token
JwtToken curentJwtToken = JwtUtil.getCurentJwtToken(); JwtToken curentJwtToken = JwtUtil.getCurentJwtToken();
...@@ -228,7 +226,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien ...@@ -228,7 +226,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien
this.removeOldToken(imApplication.getId(), curentJwtToken.getToken()); this.removeOldToken(imApplication.getId(), curentJwtToken.getToken());
} }
ImClient client = getCurentClient(); ImClient client = getCurrentClient();
ImClient clientNew = new ImClient(); ImClient clientNew = new ImClient();
BeanUtils.copyProperties(imClientDevice, clientNew); BeanUtils.copyProperties(imClientDevice, clientNew);
clientNew.setId(client.getId()); clientNew.setId(client.getId());
...@@ -243,7 +241,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien ...@@ -243,7 +241,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien
@Override @Override
public boolean logout() { public boolean logout() {
ImClient curentClient = getCurentClient(); ImClient curentClient = getCurrentClient();
// 清除设备token // 清除设备token
boolean update = this.update(new UpdateWrapper<ImClient>().lambda() boolean update = this.update(new UpdateWrapper<ImClient>().lambda()
...@@ -285,7 +283,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien ...@@ -285,7 +283,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien
} }
@Override @Override
public ImClient getCurentClient() { public ImClient getCurrentClient() {
// shiro线程中获取当前token // shiro线程中获取当前token
JwtToken curentJwtToken = JwtUtil.getCurentJwtToken(); JwtToken curentJwtToken = JwtUtil.getCurentJwtToken();
......
...@@ -88,7 +88,7 @@ public class ImConversationMembersServiceImpl extends BaseServiceImpl<ImConversa ...@@ -88,7 +88,7 @@ public class ImConversationMembersServiceImpl extends BaseServiceImpl<ImConversa
// 根据appKey查询application // 根据appKey查询application
ImApplication imApplication = imApplicationService.getCacheAppByAppKey(curentJwtToken.getAppKey()); ImApplication imApplication = imApplicationService.getCacheAppByAppKey(curentJwtToken.getAppKey());
ImClient imClientSender = imClientService.getCurentClient(); ImClient imClientSender = imClientService.getCurrentClient();
// 查询该成员 // 查询该成员
ImConversationMembers imConversationMember = imConversationMembersService.getOne( ImConversationMembers imConversationMember = imConversationMembersService.getOne(
...@@ -142,7 +142,7 @@ public class ImConversationMembersServiceImpl extends BaseServiceImpl<ImConversa ...@@ -142,7 +142,7 @@ public class ImConversationMembersServiceImpl extends BaseServiceImpl<ImConversa
// 根据appKey查询application // 根据appKey查询application
ImApplication imApplication = imApplicationService.getCacheAppByAppKey(curentJwtToken.getAppKey()); ImApplication imApplication = imApplicationService.getCacheAppByAppKey(curentJwtToken.getAppKey());
ImClient imClientSender = imClientService.getCurentClient(); ImClient imClientSender = imClientService.getCurrentClient();
// 查询该成员 // 查询该成员
ImConversationMembers imConversationMember = imConversationMembersService.getOne( ImConversationMembers imConversationMember = imConversationMembersService.getOne(
......
...@@ -14,7 +14,6 @@ import com.wecloud.im.entity.ImMessage; ...@@ -14,7 +14,6 @@ import com.wecloud.im.entity.ImMessage;
import com.wecloud.im.entity.ImMessageOnlineSend; import com.wecloud.im.entity.ImMessageOnlineSend;
import com.wecloud.im.enums.ChatTypeEnum; import com.wecloud.im.enums.ChatTypeEnum;
import com.wecloud.im.enums.GroupRoleEnum; import com.wecloud.im.enums.GroupRoleEnum;
import com.wecloud.im.enums.MutedEnum;
import com.wecloud.im.mapper.ImConversationMapper; import com.wecloud.im.mapper.ImConversationMapper;
import com.wecloud.im.param.ImClientSimpleDto; import com.wecloud.im.param.ImClientSimpleDto;
import com.wecloud.im.param.ListConversationMembersParam; import com.wecloud.im.param.ListConversationMembersParam;
...@@ -59,7 +58,6 @@ import org.apache.commons.collections4.CollectionUtils; ...@@ -59,7 +58,6 @@ import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig; import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -111,7 +109,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap ...@@ -111,7 +109,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ApiResult<ImConversationCreateVo> createImConversation(ImConversationCreate imConversationCreate) { public ApiResult<ImConversationCreateVo> createImConversation(ImConversationCreate imConversationCreate) {
ImClient createClient = imClientService.getCurentClient(); ImClient createClient = imClientService.getCurrentClient();
if (CollectionUtils.isEmpty(imConversationCreate.getClientIds())) { if (CollectionUtils.isEmpty(imConversationCreate.getClientIds())) {
log.info("未找到群成员信息"); log.info("未找到群成员信息");
return ApiResult.fail(ApiCode.PARAMETER_EXCEPTION, null); return ApiResult.fail(ApiCode.PARAMETER_EXCEPTION, null);
...@@ -267,7 +265,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap ...@@ -267,7 +265,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
// 根据appKey查询application // 根据appKey查询application
ImApplication imApplication = imApplicationService.getCacheAppByAppKey(curentJwtToken.getAppKey()); ImApplication imApplication = imApplicationService.getCacheAppByAppKey(curentJwtToken.getAppKey());
ImClient imClientSender = imClientService.getCurentClient(); ImClient imClientSender = imClientService.getCurrentClient();
// 查询该会话所有成员 // 查询该会话所有成员
List<ImConversationMembers> membersList = imConversationMembersService.list( List<ImConversationMembers> membersList = imConversationMembersService.list(
...@@ -402,7 +400,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap ...@@ -402,7 +400,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
// 根据appKey查询application // 根据appKey查询application
ImApplication imApplication = imApplicationService.getCacheAppByAppKey(curentJwtToken.getAppKey()); ImApplication imApplication = imApplicationService.getCacheAppByAppKey(curentJwtToken.getAppKey());
ImClient imClientSender = imClientService.getCurentClient(); ImClient imClientSender = imClientService.getCurrentClient();
// 判断是否为群主 // 判断是否为群主
ImConversationMembers conversationMember = imConversationMembersService.getOne( ImConversationMembers conversationMember = imConversationMembersService.getOne(
...@@ -515,13 +513,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap ...@@ -515,13 +513,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ApiResult<Boolean> leaveConversation(ImClientLeaveConversation imClientToConversation) throws Exception { public ApiResult<Boolean> leaveConversation(ImClientLeaveConversation imClientToConversation) throws Exception {
ImClient currentClient = imClientService.getCurrentClient();
// shiro线程中获取当前token
JwtToken curentJwtToken = JwtUtil.getCurentJwtToken();
// 根据appKey查询application
ImApplication imApplication = imApplicationService.getCacheAppByAppKey(curentJwtToken.getAppKey());
ImClient imClientSender = imClientService.getCurentClient();
ImConversation imConversationById = imConversationService.getById(imClientToConversation.getConversationId()); ImConversation imConversationById = imConversationService.getById(imClientToConversation.getConversationId());
if (imConversationById == null) { if (imConversationById == null) {
...@@ -533,7 +525,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap ...@@ -533,7 +525,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
new QueryWrapper<ImConversationMembers>().lambda() new QueryWrapper<ImConversationMembers>().lambda()
.eq(ImConversationMembers::getFkConversationId, imClientToConversation.getConversationId()) .eq(ImConversationMembers::getFkConversationId, imClientToConversation.getConversationId())
.orderByAsc(ImConversationMembers::getCreateTime) .orderByAsc(ImConversationMembers::getCreateTime)
.notIn(ImConversationMembers::getFkClientId, imClientSender.getId()) .notIn(ImConversationMembers::getFkClientId, currentClient.getId())
); );
if (membersList.isEmpty()) { if (membersList.isEmpty()) {
...@@ -543,9 +535,9 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap ...@@ -543,9 +535,9 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
// 判断用户是否在该会话 // 判断用户是否在该会话
ImConversationMembers members = imConversationMembersService.getOne(new QueryWrapper<ImConversationMembers>().lambda() ImConversationMembers members = imConversationMembersService.getOne(new QueryWrapper<ImConversationMembers>().lambda()
.eq(ImConversationMembers::getFkAppid, imApplication.getId()) .eq(ImConversationMembers::getFkAppid, currentClient.getFkAppid())
.eq(ImConversationMembers::getFkConversationId, imClientToConversation.getConversationId()) .eq(ImConversationMembers::getFkConversationId, imClientToConversation.getConversationId())
.eq(ImConversationMembers::getFkClientId, imClientSender.getId()) .eq(ImConversationMembers::getFkClientId, currentClient.getId())
); );
// 将client从会话移除 // 将client从会话移除
...@@ -555,7 +547,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap ...@@ -555,7 +547,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
} }
// 将群成员数量减1 // 将群成员数量减1
imConversationMapper.addMemberCount(imApplication.getId(), imClientToConversation.getConversationId(), -1); imConversationMapper.addMemberCount(currentClient.getFkAppid(), imClientToConversation.getConversationId(), -1);
// ws 退出事件通知给群内其他人 ---------- // ws 退出事件通知给群内其他人 ----------
...@@ -568,8 +560,8 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap ...@@ -568,8 +560,8 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
imMessage.setId(messageId); imMessage.setId(messageId);
imMessage.setMsgType(MsgTypeEnum.LEAVE_CONVERSATION.getUriCode()); imMessage.setMsgType(MsgTypeEnum.LEAVE_CONVERSATION.getUriCode());
imMessage.setCreateTime(new Date()); imMessage.setCreateTime(new Date());
imMessage.setFkAppid(imApplication.getId()); imMessage.setFkAppid(currentClient.getFkAppid());
imMessage.setSender(imClientSender.getId()); imMessage.setSender(currentClient.getId());
imMessage.setWithdraw(false); imMessage.setWithdraw(false);
imMessage.setEvent(true); imMessage.setEvent(true);
imMessage.setSystemFlag(false); imMessage.setSystemFlag(false);
...@@ -585,7 +577,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap ...@@ -585,7 +577,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
// 查询接收方 // 查询接收方
ImClient imClientReceiver = imClientService.getOne(new QueryWrapper<ImClient>().lambda() ImClient imClientReceiver = imClientService.getOne(new QueryWrapper<ImClient>().lambda()
.eq(ImClient::getFkAppid, imApplication.getId()) .eq(ImClient::getFkAppid, currentClient.getFkAppid())
.eq(ImClient::getId, conversationMembers.getFkClientId())); .eq(ImClient::getId, conversationMembers.getFkClientId()));
if (imClientReceiver == null) { if (imClientReceiver == null) {
continue; continue;
...@@ -597,7 +589,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap ...@@ -597,7 +589,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
imMessageOnlineSend.setMsgId(messageId); imMessageOnlineSend.setMsgId(messageId);
imMessageOnlineSend.setCreateTime(new Date()); imMessageOnlineSend.setCreateTime(new Date());
imMessageOnlineSend.setType(MsgTypeEnum.LEAVE_CONVERSATION.getUriCode()); imMessageOnlineSend.setType(MsgTypeEnum.LEAVE_CONVERSATION.getUriCode());
imMessageOnlineSend.setSender(imClientSender.getClientId()); imMessageOnlineSend.setSender(currentClient.getClientId());
imMessageOnlineSend.setConversationId(conversationMembers.getFkConversationId()); imMessageOnlineSend.setConversationId(conversationMembers.getFkConversationId());
imMessageOnlineSend.setWithdraw(Boolean.FALSE); imMessageOnlineSend.setWithdraw(Boolean.FALSE);
imMessageOnlineSend.setEvent(Boolean.TRUE); imMessageOnlineSend.setEvent(Boolean.TRUE);
...@@ -637,7 +629,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap ...@@ -637,7 +629,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
JwtToken curentJwtToken = JwtUtil.getCurentJwtToken(); JwtToken curentJwtToken = JwtUtil.getCurentJwtToken();
// 根据appKey查询application // 根据appKey查询application
ImApplication imApplication = imApplicationService.getCacheAppByAppKey(curentJwtToken.getAppKey()); ImApplication imApplication = imApplicationService.getCacheAppByAppKey(curentJwtToken.getAppKey());
ImClient imClientSender = imClientService.getCurentClient(); ImClient imClientSender = imClientService.getCurrentClient();
// 判断操作人是否为群主 // 判断操作人是否为群主
ImConversationMembers currentMember = imConversationMembersService.getOne( ImConversationMembers currentMember = imConversationMembersService.getOne(
...@@ -670,7 +662,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap ...@@ -670,7 +662,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
*/ */
@Override @Override
public Boolean setAdmins(SetAdminsParam param) { public Boolean setAdmins(SetAdminsParam param) {
ImClient currentClient = imClientService.getCurentClient(); ImClient currentClient = imClientService.getCurrentClient();
// 判断操作人是否为群主 // 判断操作人是否为群主
ImConversationMembers currentMember = imConversationMembersService.getOne( ImConversationMembers currentMember = imConversationMembersService.getOne(
new QueryWrapper<ImConversationMembers>().lambda() new QueryWrapper<ImConversationMembers>().lambda()
...@@ -698,7 +690,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap ...@@ -698,7 +690,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
*/ */
@Override @Override
public Boolean mutedGroup(MutedGroupParam param) { public Boolean mutedGroup(MutedGroupParam param) {
ImClient currentClient = imClientService.getCurentClient(); ImClient currentClient = imClientService.getCurrentClient();
if (!imConversationService.isBelongToRole(currentClient.getClientId(), param.getConversationId(), if (!imConversationService.isBelongToRole(currentClient.getClientId(), param.getConversationId(),
Lists.newArrayList(GroupRoleEnum.OWNER.getCode(), GroupRoleEnum.ADMIN.getCode()))) { Lists.newArrayList(GroupRoleEnum.OWNER.getCode(), GroupRoleEnum.ADMIN.getCode()))) {
// 当前操作人不属于群主或管理人员 // 当前操作人不属于群主或管理人员
...@@ -715,7 +707,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap ...@@ -715,7 +707,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
@Override @Override
public Boolean mutedGroupMember(MutedGroupParam param) { public Boolean mutedGroupMember(MutedGroupParam param) {
ImClient currentClient = imClientService.getCurentClient(); ImClient currentClient = imClientService.getCurrentClient();
if (!imConversationService.isBelongToRole(currentClient.getClientId(), param.getConversationId(), if (!imConversationService.isBelongToRole(currentClient.getClientId(), param.getConversationId(),
Lists.newArrayList(GroupRoleEnum.OWNER.getCode(), GroupRoleEnum.ADMIN.getCode()))) { Lists.newArrayList(GroupRoleEnum.OWNER.getCode(), GroupRoleEnum.ADMIN.getCode()))) {
// 当前操作人不属于群主或管理人员 // 当前操作人不属于群主或管理人员
...@@ -771,7 +763,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap ...@@ -771,7 +763,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
// 根据appKey查询application // 根据appKey查询application
ImApplication imApplication = imApplicationService.getCacheAppByAppKey(curentJwtToken.getAppKey()); ImApplication imApplication = imApplicationService.getCacheAppByAppKey(curentJwtToken.getAppKey());
ImClient imClientSender = imClientService.getCurentClient(); ImClient imClientSender = imClientService.getCurrentClient();
ImConversation imConversationById = imConversationService.getById(imConversationNameUpdate.getConversationId()); ImConversation imConversationById = imConversationService.getById(imConversationNameUpdate.getConversationId());
...@@ -854,7 +846,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap ...@@ -854,7 +846,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
// 根据appKey查询application // 根据appKey查询application
ImApplication imApplication = imApplicationService.getCacheAppByAppKey(curentJwtToken.getAppKey()); ImApplication imApplication = imApplicationService.getCacheAppByAppKey(curentJwtToken.getAppKey());
ImClient imClientSender = imClientService.getCurentClient(); ImClient imClientSender = imClientService.getCurrentClient();
ImConversation imConversationById = imConversationService.getById(imConversationAttrUpdate.getConversationId()); ImConversation imConversationById = imConversationService.getById(imConversationAttrUpdate.getConversationId());
// 判断是否为群主 // 判断是否为群主
...@@ -947,7 +939,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap ...@@ -947,7 +939,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public boolean updateDisplayConversation(ImConversationDisplayUpdate imConversationDisplayUpdate) { public boolean updateDisplayConversation(ImConversationDisplayUpdate imConversationDisplayUpdate) {
ImClient curentClient = imClientService.getCurentClient(); ImClient curentClient = imClientService.getCurrentClient();
for (Long id : imConversationDisplayUpdate.getConversationIds()) { for (Long id : imConversationDisplayUpdate.getConversationIds()) {
// 修改为删除隐藏状态 // 修改为删除隐藏状态
boolean update = imConversationMembersService.update(new UpdateWrapper<ImConversationMembers>() boolean update = imConversationMembersService.update(new UpdateWrapper<ImConversationMembers>()
...@@ -981,7 +973,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap ...@@ -981,7 +973,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
@Override @Override
public List<ConversationVo> getMyImConversationListAndMsgCount() throws Exception { public List<ConversationVo> getMyImConversationListAndMsgCount() throws Exception {
ImClient currentClient = imClientService.getCurentClient(); ImClient currentClient = imClientService.getCurrentClient();
// 查询用户加入的所有会话 与每个会话的未读条数 成员 // 查询用户加入的所有会话 与每个会话的未读条数 成员
List<ConversationVo> myImConversationListAndMsgCount = imConversationMapper.getMyImConversationListAndMsgCount(currentClient.getId(), null); List<ConversationVo> myImConversationListAndMsgCount = imConversationMapper.getMyImConversationListAndMsgCount(currentClient.getId(), null);
...@@ -1007,7 +999,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap ...@@ -1007,7 +999,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
@Override @Override
public ConversationVo infoImConversationAndMsgCount(ImConversationQueryParam param) throws Exception { public ConversationVo infoImConversationAndMsgCount(ImConversationQueryParam param) throws Exception {
ImClient client = imClientService.getCurentClient(); ImClient client = imClientService.getCurrentClient();
// 查询用户加入的所有会话 与每个会话的未读条数 成员 // 查询用户加入的所有会话 与每个会话的未读条数 成员
List<ConversationVo> conversationList = imConversationMapper.getMyImConversationListAndMsgCount(client.getId(), param.getId()); List<ConversationVo> conversationList = imConversationMapper.getMyImConversationListAndMsgCount(client.getId(), param.getId());
if (CollectionUtils.isEmpty(conversationList)) { if (CollectionUtils.isEmpty(conversationList)) {
...@@ -1025,7 +1017,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap ...@@ -1025,7 +1017,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
@Override @Override
public List<ImConversation> getMyImConversationList() throws Exception { public List<ImConversation> getMyImConversationList() throws Exception {
ImClient client = imClientService.getCurentClient(); ImClient client = imClientService.getCurrentClient();
return imConversationMapper.getMyImConversationList(client.getId()); return imConversationMapper.getMyImConversationList(client.getId());
} }
......
...@@ -95,7 +95,7 @@ public class ImInboxServiceImpl extends BaseServiceImpl<ImInboxMapper, ImInbox> ...@@ -95,7 +95,7 @@ public class ImInboxServiceImpl extends BaseServiceImpl<ImInboxMapper, ImInbox>
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ApiResult<Boolean> updateImMsgReceived(ImMsgReceivedStatusUpdate imMsgReceivedUpdate) { public ApiResult<Boolean> updateImMsgReceived(ImMsgReceivedStatusUpdate imMsgReceivedUpdate) {
ImClient curentClient = imClientService.getCurentClient(); ImClient curentClient = imClientService.getCurrentClient();
// 修改已接收状态 // 修改已接收状态
Long aLong = imInboxMapper.updateImMsgReceivedByIds(curentClient.getId(), imMsgReceivedUpdate.getMsgIds()); Long aLong = imInboxMapper.updateImMsgReceivedByIds(curentClient.getId(), imMsgReceivedUpdate.getMsgIds());
...@@ -136,7 +136,7 @@ public class ImInboxServiceImpl extends BaseServiceImpl<ImInboxMapper, ImInbox> ...@@ -136,7 +136,7 @@ public class ImInboxServiceImpl extends BaseServiceImpl<ImInboxMapper, ImInbox>
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ApiResult<Boolean> updateImMsgRead(MsgReadStatusUpdateParam msgReadStatusUpdateParam) { public ApiResult<Boolean> updateImMsgRead(MsgReadStatusUpdateParam msgReadStatusUpdateParam) {
ImClient curentClient = imClientService.getCurentClient(); ImClient curentClient = imClientService.getCurrentClient();
// 修改已读状态 // 修改已读状态
Long aLong = imInboxMapper.updateImMsgReadByIds(curentClient.getId(), msgReadStatusUpdateParam.getMsgIds()); Long aLong = imInboxMapper.updateImMsgReadByIds(curentClient.getId(), msgReadStatusUpdateParam.getMsgIds());
...@@ -155,7 +155,7 @@ public class ImInboxServiceImpl extends BaseServiceImpl<ImInboxMapper, ImInbox> ...@@ -155,7 +155,7 @@ public class ImInboxServiceImpl extends BaseServiceImpl<ImInboxMapper, ImInbox>
@Override @Override
public Boolean updateMsgReadStatusByConversation(MsgReadStatusUpdateParam msgReadStatusUpdateParam) { public Boolean updateMsgReadStatusByConversation(MsgReadStatusUpdateParam msgReadStatusUpdateParam) {
ImClient currentClient = imClientService.getCurentClient(); ImClient currentClient = imClientService.getCurrentClient();
// 获取该用户该会话所有未读消息 msgId 列表 // 获取该用户该会话所有未读消息 msgId 列表
List<ImInbox> imInboxList = this.list(new QueryWrapper<ImInbox>().lambda() List<ImInbox> imInboxList = this.list(new QueryWrapper<ImInbox>().lambda()
.eq(ImInbox::getFkConversationId, msgReadStatusUpdateParam.getConversationId()) .eq(ImInbox::getFkConversationId, msgReadStatusUpdateParam.getConversationId())
......
...@@ -58,7 +58,6 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -58,7 +58,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -208,7 +207,7 @@ public class ImMessageServiceImpl extends BaseServiceImpl<ImMessageMapper, ImMes ...@@ -208,7 +207,7 @@ public class ImMessageServiceImpl extends BaseServiceImpl<ImMessageMapper, ImMes
imClientSender = imClientService.getCacheImClient(request.getSenderClientId()); imClientSender = imClientService.getCacheImClient(request.getSenderClientId());
imApplication = imApplicationService.getCacheById(imClientSender.getFkAppid()); imApplication = imApplicationService.getCacheById(imClientSender.getFkAppid());
} else { } else {
imClientSender = imClientService.getCurentClient(); imClientSender = imClientService.getCurrentClient();
// 查询imApplication // 查询imApplication
imApplication = imApplicationService.getCacheById(imClientSender.getFkAppid()); imApplication = imApplicationService.getCacheById(imClientSender.getFkAppid());
} }
...@@ -319,7 +318,7 @@ public class ImMessageServiceImpl extends BaseServiceImpl<ImMessageMapper, ImMes ...@@ -319,7 +318,7 @@ public class ImMessageServiceImpl extends BaseServiceImpl<ImMessageMapper, ImMes
imClientSender = imClientService.getCacheImClient(request.getSenderClientId()); imClientSender = imClientService.getCacheImClient(request.getSenderClientId());
imApplication = imApplicationService.getCacheById(imClientSender.getFkAppid()); imApplication = imApplicationService.getCacheById(imClientSender.getFkAppid());
} else { } else {
imClientSender = imClientService.getCurentClient(); imClientSender = imClientService.getCurrentClient();
// 查询imApplication // 查询imApplication
imApplication = imApplicationService.getCacheById(imClientSender.getFkAppid()); imApplication = imApplicationService.getCacheById(imClientSender.getFkAppid());
} }
...@@ -461,7 +460,7 @@ public class ImMessageServiceImpl extends BaseServiceImpl<ImMessageMapper, ImMes ...@@ -461,7 +460,7 @@ public class ImMessageServiceImpl extends BaseServiceImpl<ImMessageMapper, ImMes
if (request != null) { if (request != null) {
imClientSender = imClientService.getCacheImClient(request.getSenderClientId()); imClientSender = imClientService.getCacheImClient(request.getSenderClientId());
} else { } else {
imClientSender = imClientService.getCurentClient(); imClientSender = imClientService.getCurrentClient();
} }
if (imClientSender == null) { if (imClientSender == null) {
throw new BusinessException("查无发送用户信息"); throw new BusinessException("查无发送用户信息");
...@@ -507,7 +506,7 @@ public class ImMessageServiceImpl extends BaseServiceImpl<ImMessageMapper, ImMes ...@@ -507,7 +506,7 @@ public class ImMessageServiceImpl extends BaseServiceImpl<ImMessageMapper, ImMes
// 返回数据 // 返回数据
List<ImMessageOfflineListVo> imMessageOfflineListVoList = new ArrayList<>(); List<ImMessageOfflineListVo> imMessageOfflineListVoList = new ArrayList<>();
ImClient client = imClientService.getCurentClient(); ImClient client = imClientService.getCurrentClient();
// 获取加入的所有会话 // 获取加入的所有会话
List<ImConversation> myImConversationList = imConversationService.getMyImConversationList(); List<ImConversation> myImConversationList = imConversationService.getMyImConversationList();
......
...@@ -65,7 +65,7 @@ public class ThousandChatService extends BaseServiceImpl<ImMsgReadLastestMapper, ...@@ -65,7 +65,7 @@ public class ThousandChatService extends BaseServiceImpl<ImMsgReadLastestMapper,
* @return * @return
*/ */
public ApiResult<Boolean> updateImMsgReceived(LastestReceivedMsg lastestReceivedMsg) { public ApiResult<Boolean> updateImMsgReceived(LastestReceivedMsg lastestReceivedMsg) {
ImClient curentClient = imClientService.getCurentClient(); ImClient curentClient = imClientService.getCurrentClient();
ImMessage lastestMsg = imMessageService.getById(lastestReceivedMsg.getLastestMsgId()); ImMessage lastestMsg = imMessageService.getById(lastestReceivedMsg.getLastestMsgId());
...@@ -105,7 +105,7 @@ public class ThousandChatService extends BaseServiceImpl<ImMsgReadLastestMapper, ...@@ -105,7 +105,7 @@ public class ThousandChatService extends BaseServiceImpl<ImMsgReadLastestMapper,
* @return * @return
*/ */
public ApiResult<Boolean> updateImMsgRead(Long lastestMsgId) { public ApiResult<Boolean> updateImMsgRead(Long lastestMsgId) {
ImClient curentClient = imClientService.getCurentClient(); ImClient curentClient = imClientService.getCurrentClient();
ImMessage lastestMsg = imMessageService.getById(lastestMsgId); ImMessage lastestMsg = imMessageService.getById(lastestMsgId);
...@@ -139,7 +139,7 @@ public class ThousandChatService extends BaseServiceImpl<ImMsgReadLastestMapper, ...@@ -139,7 +139,7 @@ public class ThousandChatService extends BaseServiceImpl<ImMsgReadLastestMapper,
return new ArrayList<>(); return new ArrayList<>();
} }
ImClient curentClient = imClientService.getCurentClient(); ImClient curentClient = imClientService.getCurrentClient();
List<ConversationLastestReadMsg> lastestReadMsgs = imMsgReadLastestMapper.findLastestReadMsgs(curentClient.getId()); List<ConversationLastestReadMsg> lastestReadMsgs = imMsgReadLastestMapper.findLastestReadMsgs(curentClient.getId());
Map<Long, ConversationLastestReadMsg> conversationMsgMap = lastestReadMsgs.stream().collect(Collectors.toMap(ConversationLastestReadMsg::getConversationId, v->v,(a,b)->a)); Map<Long, ConversationLastestReadMsg> conversationMsgMap = lastestReadMsgs.stream().collect(Collectors.toMap(ConversationLastestReadMsg::getConversationId, v->v,(a,b)->a));
......
package com.wecloud.im.user.controller; package com.wecloud.im.user.controller;
import com.wecloud.im.entity.ImClient;
import com.wecloud.im.friend.param.ImFriendApplyDto;
import com.wecloud.im.friend.param.ImFriendBaseParam; import com.wecloud.im.friend.param.ImFriendBaseParam;
import com.wecloud.im.friend.service.ImFriendService;
import com.wecloud.im.service.ImClientService; import com.wecloud.im.service.ImClientService;
import com.wecloud.im.user.param.FriendDto; import com.wecloud.im.user.param.FriendDto;
import com.wecloud.im.user.service.FriendService; import com.wecloud.im.user.service.FriendService;
......
...@@ -44,7 +44,7 @@ public class FriendService extends BaseServiceImpl<UserMapper, User> { ...@@ -44,7 +44,7 @@ public class FriendService extends BaseServiceImpl<UserMapper, User> {
public FriendDto getFriendInfo(ImFriendBaseParam param) { public FriendDto getFriendInfo(ImFriendBaseParam param) {
ImClient currentClient = imClientService.getCurentClient(); ImClient currentClient = imClientService.getCurrentClient();
if (currentClient == null) { if (currentClient == null) {
throw new BusinessException("当前登录用户未找到"); throw new BusinessException("当前登录用户未找到");
} }
...@@ -74,7 +74,7 @@ public class FriendService extends BaseServiceImpl<UserMapper, User> { ...@@ -74,7 +74,7 @@ public class FriendService extends BaseServiceImpl<UserMapper, User> {
* 全量获取好友列表 * 全量获取好友列表
*/ */
public List<FriendDto> getFriends() { public List<FriendDto> getFriends() {
ImClient currentClient = imClientService.getCurentClient(); ImClient currentClient = imClientService.getCurrentClient();
if (currentClient == null) { if (currentClient == null) {
throw new BusinessException("当前登录用户未找到"); throw new BusinessException("当前登录用户未找到");
} }
...@@ -116,7 +116,7 @@ public class FriendService extends BaseServiceImpl<UserMapper, User> { ...@@ -116,7 +116,7 @@ public class FriendService extends BaseServiceImpl<UserMapper, User> {
* 获取好友列表申请 * 获取好友列表申请
*/ */
public List<FriendDto> getApplyFriends() { public List<FriendDto> getApplyFriends() {
ImClient currentClient = imClientService.getCurentClient(); ImClient currentClient = imClientService.getCurrentClient();
if (currentClient == null) { if (currentClient == null) {
throw new BusinessException("当前登录用户未找到"); throw new BusinessException("当前登录用户未找到");
} }
......
...@@ -194,7 +194,7 @@ public class UserService extends BaseServiceImpl<UserMapper, User> { ...@@ -194,7 +194,7 @@ public class UserService extends BaseServiceImpl<UserMapper, User> {
* 查找本人信息 * 查找本人信息
*/ */
public UserBaseDto myInfo() { public UserBaseDto myInfo() {
ImClient currentClient = imClientService.getCurentClient(); ImClient currentClient = imClientService.getCurrentClient();
User user = this.getOne(new QueryWrapper<User>().lambda() User user = this.getOne(new QueryWrapper<User>().lambda()
.eq(User::getId, currentClient.getClientId())); .eq(User::getId, currentClient.getClientId()));
if (user == null) { if (user == null) {
...@@ -224,7 +224,7 @@ public class UserService extends BaseServiceImpl<UserMapper, User> { ...@@ -224,7 +224,7 @@ public class UserService extends BaseServiceImpl<UserMapper, User> {
userBaseDto.setRelation(RelationEnum.STRANGER.getCode()); userBaseDto.setRelation(RelationEnum.STRANGER.getCode());
// 查询该好友与自己关系: 陌生人、好友、被拉黑名单 // 查询该好友与自己关系: 陌生人、好友、被拉黑名单
ImClient currentClient = imClientService.getCurentClient(); ImClient currentClient = imClientService.getCurrentClient();
ImFriend imFriend = imFriendService.getByKey(currentClient.getClientId(), user.getId().toString()); ImFriend imFriend = imFriendService.getByKey(currentClient.getClientId(), user.getId().toString());
if (imFriend != null && FriendStateEnum.CONFORM.getCode().equals(imFriend.getState())) { if (imFriend != null && FriendStateEnum.CONFORM.getCode().equals(imFriend.getState())) {
userBaseDto.setRelation(RelationEnum.FRIEND.getCode()); userBaseDto.setRelation(RelationEnum.FRIEND.getCode());
...@@ -252,7 +252,7 @@ public class UserService extends BaseServiceImpl<UserMapper, User> { ...@@ -252,7 +252,7 @@ public class UserService extends BaseServiceImpl<UserMapper, User> {
userBaseDto.setUserId(user.getId().toString()); userBaseDto.setUserId(user.getId().toString());
userBaseDto.setRelation(RelationEnum.STRANGER.getCode()); userBaseDto.setRelation(RelationEnum.STRANGER.getCode());
// 查询该好友与自己关系: 陌生人、好友、被拉黑名单 // 查询该好友与自己关系: 陌生人、好友、被拉黑名单
ImClient currentClient = imClientService.getCurentClient(); ImClient currentClient = imClientService.getCurrentClient();
ImFriend imFriend = imFriendService.getByKey(currentClient.getClientId(), user.getId().toString()); ImFriend imFriend = imFriendService.getByKey(currentClient.getClientId(), user.getId().toString());
if (imFriend != null && FriendStateEnum.CONFORM.getCode().equals(imFriend.getState())) { if (imFriend != null && FriendStateEnum.CONFORM.getCode().equals(imFriend.getState())) {
userBaseDto.setRelation(RelationEnum.FRIEND.getCode()); userBaseDto.setRelation(RelationEnum.FRIEND.getCode());
......
...@@ -78,7 +78,7 @@ public class RtcServiceImpl extends UserStateListener implements RtcService { ...@@ -78,7 +78,7 @@ public class RtcServiceImpl extends UserStateListener implements RtcService {
@Override @Override
public ApiResult<CreateRtcChannelResult> createAndCall(CreateRtcChannelParam createRtcChannelParam) throws JsonProcessingException { public ApiResult<CreateRtcChannelResult> createAndCall(CreateRtcChannelParam createRtcChannelParam) throws JsonProcessingException {
ImClient currentClient = imClientService.getCurentClient(); ImClient currentClient = imClientService.getCurrentClient();
Long rtcChannelId = SnowflakeUtil.getId(); Long rtcChannelId = SnowflakeUtil.getId();
// 判断发起方必须在线 // 判断发起方必须在线
boolean onlineStatus = userStateCacheManager.isOnline(currentClient.getId()); boolean onlineStatus = userStateCacheManager.isOnline(currentClient.getId());
...@@ -116,7 +116,7 @@ public class RtcServiceImpl extends UserStateListener implements RtcService { ...@@ -116,7 +116,7 @@ public class RtcServiceImpl extends UserStateListener implements RtcService {
@Override @Override
public ApiResult<Boolean> join(JoinRtcChannelParam joinRtcChannelParam) { public ApiResult<Boolean> join(JoinRtcChannelParam joinRtcChannelParam) {
ImClient client = imClientService.getCurentClient(); ImClient client = imClientService.getCurrentClient();
// 修改缓存 // 修改缓存
mangerRtcCacheService.join(client.getId(), joinRtcChannelParam.getChannelId()); mangerRtcCacheService.join(client.getId(), joinRtcChannelParam.getChannelId());
...@@ -142,7 +142,7 @@ public class RtcServiceImpl extends UserStateListener implements RtcService { ...@@ -142,7 +142,7 @@ public class RtcServiceImpl extends UserStateListener implements RtcService {
@Override @Override
public ApiResult<Boolean> reject(RejectRtcChannelParam rejectRtcChannelParam) { public ApiResult<Boolean> reject(RejectRtcChannelParam rejectRtcChannelParam) {
ImClient client = imClientService.getCurentClient(); ImClient client = imClientService.getCurrentClient();
// 修改缓存 // 修改缓存
mangerRtcCacheService.leave(client.getId(), rejectRtcChannelParam.getChannelId()); mangerRtcCacheService.leave(client.getId(), rejectRtcChannelParam.getChannelId());
//获取频道内所有client //获取频道内所有client
...@@ -172,7 +172,7 @@ public class RtcServiceImpl extends UserStateListener implements RtcService { ...@@ -172,7 +172,7 @@ public class RtcServiceImpl extends UserStateListener implements RtcService {
@Override @Override
public ApiResult<Boolean> leave(LeaveRtcChannelParam leaveRtcChannelParam) { public ApiResult<Boolean> leave(LeaveRtcChannelParam leaveRtcChannelParam) {
ImClient currentClient = imClientService.getCurentClient(); ImClient currentClient = imClientService.getCurrentClient();
this.leave(leaveRtcChannelParam, currentClient); this.leave(leaveRtcChannelParam, currentClient);
return ApiResult.ok(true); return ApiResult.ok(true);
...@@ -209,7 +209,7 @@ public class RtcServiceImpl extends UserStateListener implements RtcService { ...@@ -209,7 +209,7 @@ public class RtcServiceImpl extends UserStateListener implements RtcService {
@Override @Override
public ApiResult<Boolean> sdpForward(SdpForwardParam sdpForwardParam) { public ApiResult<Boolean> sdpForward(SdpForwardParam sdpForwardParam) {
ImClient client = imClientService.getCurentClient(); ImClient client = imClientService.getCurrentClient();
Long rtcChannelId = SnowflakeUtil.getId(); Long rtcChannelId = SnowflakeUtil.getId();
// 根据appKey查询appid // 根据appKey查询appid
...@@ -250,7 +250,7 @@ public class RtcServiceImpl extends UserStateListener implements RtcService { ...@@ -250,7 +250,7 @@ public class RtcServiceImpl extends UserStateListener implements RtcService {
@Override @Override
public ApiResult<Boolean> candidateForward(CandidateForwardParam candidateForwardParam) { public ApiResult<Boolean> candidateForward(CandidateForwardParam candidateForwardParam) {
ImClient client = imClientService.getCurentClient(); ImClient client = imClientService.getCurrentClient();
Long rtcChannelId = SnowflakeUtil.getId(); Long rtcChannelId = SnowflakeUtil.getId();
// 根据appKey查询appid // 根据appKey查询appid
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment