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(
......
...@@ -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