Commit 0363ebf8 by Future

方法名称修改

parent f2f02b3f
......@@ -58,7 +58,7 @@ public class ImFriendController extends BaseController {
if(param == null) {
return ApiResult.fail(ApiCode.PARAMETER_EXCEPTION, null);
}
ImClient currentClient = imClientService.getCurentClient();
ImClient currentClient = imClientService.getCurrentClient();
if(currentClient == null) {
return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null);
}
......@@ -79,7 +79,7 @@ public class ImFriendController extends BaseController {
if(param == null) {
return ApiResult.fail(ApiCode.PARAMETER_EXCEPTION, null);
}
ImClient currentClient = imClientService.getCurentClient();
ImClient currentClient = imClientService.getCurrentClient();
if(currentClient == null) {
return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null);
}
......@@ -100,7 +100,7 @@ public class ImFriendController extends BaseController {
@PostMapping("/unsureFriends")
@ApiOperation(value = "待接受的好友请求列表,最多只返回1000个")
public ApiResult<List<ImFriendApplyDto>> getUnsureFriends() {
ImClient currentClient = imClientService.getCurentClient();
ImClient currentClient = imClientService.getCurrentClient();
if(currentClient == null) {
return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null);
}
......@@ -117,7 +117,7 @@ public class ImFriendController extends BaseController {
if(param == null || param.getAgree() == null) {
return ApiResult.fail(ApiCode.PARAMETER_EXCEPTION, null);
}
ImClient currentClient = imClientService.getCurentClient();
ImClient currentClient = imClientService.getCurrentClient();
if(currentClient == null) {
return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null);
}
......@@ -137,7 +137,7 @@ public class ImFriendController extends BaseController {
@PostMapping("/batchDelete")
@ApiOperation(value = "删除好友")
public ApiResult<Boolean> batchDeleteFriend(@RequestBody ImDeleteFriendParam param) {
ImClient currentClient = imClientService.getCurentClient();
ImClient currentClient = imClientService.getCurrentClient();
if(currentClient == null) {
return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null);
}
......@@ -153,7 +153,7 @@ public class ImFriendController extends BaseController {
@OperationLog(name = "好友分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "好友分页列表")
public ApiResult<Paging<ImFriendBaseDto>> getImFriendPageList(@RequestBody ImFriendPageParam pageParam) {
ImClient currentClient = imClientService.getCurentClient();
ImClient currentClient = imClientService.getCurrentClient();
if(currentClient == null) {
return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null);
}
......@@ -169,7 +169,7 @@ public class ImFriendController extends BaseController {
@OperationLog(name = "批量创建好友推荐", type = OperationLogType.PAGE)
@ApiOperation(value = "批量创建好友推荐")
public ApiResult<Boolean> batchCreateRecommend(@RequestBody ImCreateRecommendParam param) {
ImClient currentClient = imClientService.getCurentClient();
ImClient currentClient = imClientService.getCurrentClient();
if(currentClient == null) {
return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null);
}
......@@ -192,7 +192,7 @@ public class ImFriendController extends BaseController {
@OperationLog(name = "好友推荐分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "好友推荐分页列表")
public ApiResult<Paging<ImFriendRecommendDto>> getImFriendRecommendPageList(@RequestBody ImFriendPageParam pageParam) {
ImClient currentClient = imClientService.getCurentClient();
ImClient currentClient = imClientService.getCurrentClient();
if(currentClient == null) {
return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null);
}
......@@ -207,7 +207,7 @@ public class ImFriendController extends BaseController {
@PostMapping("/recommend/batchDelete")
@ApiOperation(value = "删除好友推荐")
public ApiResult<Boolean> batchDeleteRecommend(@RequestBody ImDeleteRecommendParam param) {
ImClient currentClient = imClientService.getCurentClient();
ImClient currentClient = imClientService.getCurrentClient();
if(currentClient == null) {
return ApiResult.fail(ApiCode.CLIENT_NOT_FOUNT, null);
}
......
......@@ -17,7 +17,6 @@ import com.wecloud.im.vo.MyInfoVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.service.BaseService;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
......@@ -133,7 +132,7 @@ public interface ImClientService extends BaseService<ImClient> {
*
* @return
*/
ImClient getCurentClient();
ImClient getCurrentClient();
ImClient getCacheImClient(Long applicationId, String clientId);
......
......@@ -52,7 +52,7 @@ public class ImClientBlacklistServiceImpl extends BaseServiceImpl<ImClientBlackl
@Override
@Transactional(rollbackFor = Exception.class)
public ApiResult<Boolean> addImClientBlacklist(ImClientBlacklistUpdate imClientBlacklistUpdate) throws Exception {
ImClient client = imClientService.getCurentClient();
ImClient client = imClientService.getCurrentClient();
if (client == null) {
throw new BusinessException("当前用户登录信息失效");
}
......@@ -77,7 +77,7 @@ public class ImClientBlacklistServiceImpl extends BaseServiceImpl<ImClientBlackl
@Transactional(rollbackFor = Exception.class)
public ApiResult<Boolean> removeImClientBlacklist(ImClientBlacklistUpdate imClientBlacklistUpdate) throws Exception {
// 操作者
ImClient client = imClientService.getCurentClient();
ImClient client = imClientService.getCurrentClient();
if (client == null) {
throw new BusinessException("当前用户登录信息失效");
}
......@@ -100,7 +100,7 @@ public class ImClientBlacklistServiceImpl extends BaseServiceImpl<ImClientBlackl
Page<ImClientBlacklistQueryVo> page = new PageInfo<>(imClientBlacklistPageParam);
ImClient client = imClientService.getCurentClient();
ImClient client = imClientService.getCurrentClient();
IPage<ImClientBlacklistQueryVo> imClientBlacklistPageList = imClientBlacklistMapper.getImClientBlacklistPageList(page, client.getClientId());
......
......@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.wecloud.im.entity.ImApplication;
import com.wecloud.im.entity.ImClient;
import com.wecloud.im.entity.ImClientBlacklist;
import com.wecloud.im.enums.FriendStateEnum;
import com.wecloud.im.enums.RelationEnum;
import com.wecloud.im.friend.entity.ImFriend;
......@@ -47,7 +46,6 @@ import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
......@@ -76,7 +74,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien
@Override
public MyInfoVo getMyInfo() {
ImClient currentClient = this.getCurentClient();
ImClient currentClient = this.getCurrentClient();
if (currentClient == null) {
throw new BusinessException("当前用户登录信息失效");
}
......@@ -88,7 +86,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien
@Override
@Transactional(rollbackFor = Exception.class)
public boolean updateHeadPortrait(ImClientHeadPortraitAdd imClientHeadPortraitAdd) {
ImClient curentClient = getCurentClient();
ImClient curentClient = getCurrentClient();
curentClient.setHeadPortrait(imClientHeadPortraitAdd.getHeadPortrait());
imClientMapper.updateById(curentClient);
......@@ -100,7 +98,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien
@Override
public boolean updateNickname(ImClientNicknameUpdate imClientNicknameUpdate) {
ImClient curentClient = getCurentClient();
ImClient curentClient = getCurrentClient();
curentClient.setNickname(imClientNicknameUpdate.getNickname());
imClientMapper.updateById(curentClient);
......@@ -112,7 +110,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien
@Override
public boolean updateHeadAndNickname(ImClientHeadPortraitAndNicknameUpdate imClientHeadPortraitAndNicknameUpdate) {
ImClient curentClient = getCurentClient();
ImClient curentClient = getCurrentClient();
curentClient.setHeadPortrait(imClientHeadPortraitAndNicknameUpdate.getHeadPortrait());
curentClient.setNickname(imClientHeadPortraitAndNicknameUpdate.getNickname());
imClientMapper.updateById(curentClient);
......@@ -125,7 +123,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien
@Override
public ApiResult<List<GetInfoListVo>> getInfoList(GetClientInfoParam getClientInfoParam) throws Exception {
ImClient curentClient = getCurentClient();
ImClient curentClient = getCurrentClient();
if (getClientInfoParam.getClientIds() == null || getClientInfoParam.getClientIds().isEmpty()) {
throw new BusinessException("getClientInfoParam.getClientIds() == null");
......@@ -154,7 +152,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien
@Override
public ClientInfoVo getClientInfo(ClientInfoParam param) {
ImClient currentClient = this.getCurentClient();
ImClient currentClient = this.getCurrentClient();
if (currentClient == null) {
throw new BusinessException("当前用户登录信息失效");
}
......@@ -186,7 +184,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien
@Override
@Transactional(rollbackFor = Exception.class)
public boolean updateNickname(ImClientNicknameAdd imClientNicknameAdd) throws Exception {
ImClient curentClient = getCurentClient();
ImClient curentClient = getCurrentClient();
// shiro线程中获取当前token
JwtToken curentJwtToken = JwtUtil.getCurentJwtToken();
......@@ -228,7 +226,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien
this.removeOldToken(imApplication.getId(), curentJwtToken.getToken());
}
ImClient client = getCurentClient();
ImClient client = getCurrentClient();
ImClient clientNew = new ImClient();
BeanUtils.copyProperties(imClientDevice, clientNew);
clientNew.setId(client.getId());
......@@ -243,7 +241,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien
@Override
public boolean logout() {
ImClient curentClient = getCurentClient();
ImClient curentClient = getCurrentClient();
// 清除设备token
boolean update = this.update(new UpdateWrapper<ImClient>().lambda()
......@@ -285,7 +283,7 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien
}
@Override
public ImClient getCurentClient() {
public ImClient getCurrentClient() {
// shiro线程中获取当前token
JwtToken curentJwtToken = JwtUtil.getCurentJwtToken();
......
......@@ -88,7 +88,7 @@ public class ImConversationMembersServiceImpl extends BaseServiceImpl<ImConversa
// 根据appKey查询application
ImApplication imApplication = imApplicationService.getCacheAppByAppKey(curentJwtToken.getAppKey());
ImClient imClientSender = imClientService.getCurentClient();
ImClient imClientSender = imClientService.getCurrentClient();
// 查询该成员
ImConversationMembers imConversationMember = imConversationMembersService.getOne(
......@@ -142,7 +142,7 @@ public class ImConversationMembersServiceImpl extends BaseServiceImpl<ImConversa
// 根据appKey查询application
ImApplication imApplication = imApplicationService.getCacheAppByAppKey(curentJwtToken.getAppKey());
ImClient imClientSender = imClientService.getCurentClient();
ImClient imClientSender = imClientService.getCurrentClient();
// 查询该成员
ImConversationMembers imConversationMember = imConversationMembersService.getOne(
......
......@@ -95,7 +95,7 @@ public class ImInboxServiceImpl extends BaseServiceImpl<ImInboxMapper, ImInbox>
@Override
@Transactional(rollbackFor = Exception.class)
public ApiResult<Boolean> updateImMsgReceived(ImMsgReceivedStatusUpdate imMsgReceivedUpdate) {
ImClient curentClient = imClientService.getCurentClient();
ImClient curentClient = imClientService.getCurrentClient();
// 修改已接收状态
Long aLong = imInboxMapper.updateImMsgReceivedByIds(curentClient.getId(), imMsgReceivedUpdate.getMsgIds());
......@@ -136,7 +136,7 @@ public class ImInboxServiceImpl extends BaseServiceImpl<ImInboxMapper, ImInbox>
@Override
@Transactional(rollbackFor = Exception.class)
public ApiResult<Boolean> updateImMsgRead(MsgReadStatusUpdateParam msgReadStatusUpdateParam) {
ImClient curentClient = imClientService.getCurentClient();
ImClient curentClient = imClientService.getCurrentClient();
// 修改已读状态
Long aLong = imInboxMapper.updateImMsgReadByIds(curentClient.getId(), msgReadStatusUpdateParam.getMsgIds());
......@@ -155,7 +155,7 @@ public class ImInboxServiceImpl extends BaseServiceImpl<ImInboxMapper, ImInbox>
@Override
public Boolean updateMsgReadStatusByConversation(MsgReadStatusUpdateParam msgReadStatusUpdateParam) {
ImClient currentClient = imClientService.getCurentClient();
ImClient currentClient = imClientService.getCurrentClient();
// 获取该用户该会话所有未读消息 msgId 列表
List<ImInbox> imInboxList = this.list(new QueryWrapper<ImInbox>().lambda()
.eq(ImInbox::getFkConversationId, msgReadStatusUpdateParam.getConversationId())
......
......@@ -58,7 +58,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -208,7 +207,7 @@ public class ImMessageServiceImpl extends BaseServiceImpl<ImMessageMapper, ImMes
imClientSender = imClientService.getCacheImClient(request.getSenderClientId());
imApplication = imApplicationService.getCacheById(imClientSender.getFkAppid());
} else {
imClientSender = imClientService.getCurentClient();
imClientSender = imClientService.getCurrentClient();
// 查询imApplication
imApplication = imApplicationService.getCacheById(imClientSender.getFkAppid());
}
......@@ -319,7 +318,7 @@ public class ImMessageServiceImpl extends BaseServiceImpl<ImMessageMapper, ImMes
imClientSender = imClientService.getCacheImClient(request.getSenderClientId());
imApplication = imApplicationService.getCacheById(imClientSender.getFkAppid());
} else {
imClientSender = imClientService.getCurentClient();
imClientSender = imClientService.getCurrentClient();
// 查询imApplication
imApplication = imApplicationService.getCacheById(imClientSender.getFkAppid());
}
......@@ -461,7 +460,7 @@ public class ImMessageServiceImpl extends BaseServiceImpl<ImMessageMapper, ImMes
if (request != null) {
imClientSender = imClientService.getCacheImClient(request.getSenderClientId());
} else {
imClientSender = imClientService.getCurentClient();
imClientSender = imClientService.getCurrentClient();
}
if (imClientSender == null) {
throw new BusinessException("查无发送用户信息");
......@@ -507,7 +506,7 @@ public class ImMessageServiceImpl extends BaseServiceImpl<ImMessageMapper, ImMes
// 返回数据
List<ImMessageOfflineListVo> imMessageOfflineListVoList = new ArrayList<>();
ImClient client = imClientService.getCurentClient();
ImClient client = imClientService.getCurrentClient();
// 获取加入的所有会话
List<ImConversation> myImConversationList = imConversationService.getMyImConversationList();
......
......@@ -65,7 +65,7 @@ public class ThousandChatService extends BaseServiceImpl<ImMsgReadLastestMapper,
* @return
*/
public ApiResult<Boolean> updateImMsgReceived(LastestReceivedMsg lastestReceivedMsg) {
ImClient curentClient = imClientService.getCurentClient();
ImClient curentClient = imClientService.getCurrentClient();
ImMessage lastestMsg = imMessageService.getById(lastestReceivedMsg.getLastestMsgId());
......@@ -105,7 +105,7 @@ public class ThousandChatService extends BaseServiceImpl<ImMsgReadLastestMapper,
* @return
*/
public ApiResult<Boolean> updateImMsgRead(Long lastestMsgId) {
ImClient curentClient = imClientService.getCurentClient();
ImClient curentClient = imClientService.getCurrentClient();
ImMessage lastestMsg = imMessageService.getById(lastestMsgId);
......@@ -139,7 +139,7 @@ public class ThousandChatService extends BaseServiceImpl<ImMsgReadLastestMapper,
return new ArrayList<>();
}
ImClient curentClient = imClientService.getCurentClient();
ImClient curentClient = imClientService.getCurrentClient();
List<ConversationLastestReadMsg> lastestReadMsgs = imMsgReadLastestMapper.findLastestReadMsgs(curentClient.getId());
Map<Long, ConversationLastestReadMsg> conversationMsgMap = lastestReadMsgs.stream().collect(Collectors.toMap(ConversationLastestReadMsg::getConversationId, v->v,(a,b)->a));
......
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.service.ImFriendService;
import com.wecloud.im.service.ImClientService;
import com.wecloud.im.user.param.FriendDto;
import com.wecloud.im.user.service.FriendService;
......
......@@ -44,7 +44,7 @@ public class FriendService extends BaseServiceImpl<UserMapper, User> {
public FriendDto getFriendInfo(ImFriendBaseParam param) {
ImClient currentClient = imClientService.getCurentClient();
ImClient currentClient = imClientService.getCurrentClient();
if (currentClient == null) {
throw new BusinessException("当前登录用户未找到");
}
......@@ -74,7 +74,7 @@ public class FriendService extends BaseServiceImpl<UserMapper, User> {
* 全量获取好友列表
*/
public List<FriendDto> getFriends() {
ImClient currentClient = imClientService.getCurentClient();
ImClient currentClient = imClientService.getCurrentClient();
if (currentClient == null) {
throw new BusinessException("当前登录用户未找到");
}
......@@ -116,7 +116,7 @@ public class FriendService extends BaseServiceImpl<UserMapper, User> {
* 获取好友列表申请
*/
public List<FriendDto> getApplyFriends() {
ImClient currentClient = imClientService.getCurentClient();
ImClient currentClient = imClientService.getCurrentClient();
if (currentClient == null) {
throw new BusinessException("当前登录用户未找到");
}
......
......@@ -194,7 +194,7 @@ public class UserService extends BaseServiceImpl<UserMapper, User> {
* 查找本人信息
*/
public UserBaseDto myInfo() {
ImClient currentClient = imClientService.getCurentClient();
ImClient currentClient = imClientService.getCurrentClient();
User user = this.getOne(new QueryWrapper<User>().lambda()
.eq(User::getId, currentClient.getClientId()));
if (user == null) {
......@@ -224,7 +224,7 @@ public class UserService extends BaseServiceImpl<UserMapper, User> {
userBaseDto.setRelation(RelationEnum.STRANGER.getCode());
// 查询该好友与自己关系: 陌生人、好友、被拉黑名单
ImClient currentClient = imClientService.getCurentClient();
ImClient currentClient = imClientService.getCurrentClient();
ImFriend imFriend = imFriendService.getByKey(currentClient.getClientId(), user.getId().toString());
if (imFriend != null && FriendStateEnum.CONFORM.getCode().equals(imFriend.getState())) {
userBaseDto.setRelation(RelationEnum.FRIEND.getCode());
......@@ -252,7 +252,7 @@ public class UserService extends BaseServiceImpl<UserMapper, User> {
userBaseDto.setUserId(user.getId().toString());
userBaseDto.setRelation(RelationEnum.STRANGER.getCode());
// 查询该好友与自己关系: 陌生人、好友、被拉黑名单
ImClient currentClient = imClientService.getCurentClient();
ImClient currentClient = imClientService.getCurrentClient();
ImFriend imFriend = imFriendService.getByKey(currentClient.getClientId(), user.getId().toString());
if (imFriend != null && FriendStateEnum.CONFORM.getCode().equals(imFriend.getState())) {
userBaseDto.setRelation(RelationEnum.FRIEND.getCode());
......
......@@ -78,7 +78,7 @@ public class RtcServiceImpl extends UserStateListener implements RtcService {
@Override
public ApiResult<CreateRtcChannelResult> createAndCall(CreateRtcChannelParam createRtcChannelParam) throws JsonProcessingException {
ImClient currentClient = imClientService.getCurentClient();
ImClient currentClient = imClientService.getCurrentClient();
Long rtcChannelId = SnowflakeUtil.getId();
// 判断发起方必须在线
boolean onlineStatus = userStateCacheManager.isOnline(currentClient.getId());
......@@ -116,7 +116,7 @@ public class RtcServiceImpl extends UserStateListener implements RtcService {
@Override
public ApiResult<Boolean> join(JoinRtcChannelParam joinRtcChannelParam) {
ImClient client = imClientService.getCurentClient();
ImClient client = imClientService.getCurrentClient();
// 修改缓存
mangerRtcCacheService.join(client.getId(), joinRtcChannelParam.getChannelId());
......@@ -142,7 +142,7 @@ public class RtcServiceImpl extends UserStateListener implements RtcService {
@Override
public ApiResult<Boolean> reject(RejectRtcChannelParam rejectRtcChannelParam) {
ImClient client = imClientService.getCurentClient();
ImClient client = imClientService.getCurrentClient();
// 修改缓存
mangerRtcCacheService.leave(client.getId(), rejectRtcChannelParam.getChannelId());
//获取频道内所有client
......@@ -172,7 +172,7 @@ public class RtcServiceImpl extends UserStateListener implements RtcService {
@Override
public ApiResult<Boolean> leave(LeaveRtcChannelParam leaveRtcChannelParam) {
ImClient currentClient = imClientService.getCurentClient();
ImClient currentClient = imClientService.getCurrentClient();
this.leave(leaveRtcChannelParam, currentClient);
return ApiResult.ok(true);
......@@ -209,7 +209,7 @@ public class RtcServiceImpl extends UserStateListener implements RtcService {
@Override
public ApiResult<Boolean> sdpForward(SdpForwardParam sdpForwardParam) {
ImClient client = imClientService.getCurentClient();
ImClient client = imClientService.getCurrentClient();
Long rtcChannelId = SnowflakeUtil.getId();
// 根据appKey查询appid
......@@ -250,7 +250,7 @@ public class RtcServiceImpl extends UserStateListener implements RtcService {
@Override
public ApiResult<Boolean> candidateForward(CandidateForwardParam candidateForwardParam) {
ImClient client = imClientService.getCurentClient();
ImClient client = imClientService.getCurrentClient();
Long rtcChannelId = SnowflakeUtil.getId();
// 根据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