Browse Source

客服转接完善

master
La123123 10 hours ago
parent
commit
eb4497bbf6
  1. 5
      im-platform/src/main/java/com/bx/implatform/controller/UserController.java
  2. 9
      im-platform/src/main/java/com/bx/implatform/service/impl/UserServiceImpl.java

5
im-platform/src/main/java/com/bx/implatform/controller/UserController.java

@ -95,11 +95,6 @@ public class UserController {
Long targetId = jsonObject.getLong("targetId"); Long targetId = jsonObject.getLong("targetId");
Long userId = jsonObject.getLong("userId"); Long userId = jsonObject.getLong("userId");
if(ObjectUtil.isNull(customerId) || ObjectUtil.isNull(targetId) || ObjectUtil.isNull(userId)){
return ResultUtils.error(XSS_PARAM_ERROR);
}
boolean check = userService.chenckRelation(customerId,targetId, userId); boolean check = userService.chenckRelation(customerId,targetId, userId);
if(!check){ if(!check){

9
im-platform/src/main/java/com/bx/implatform/service/impl/UserServiceImpl.java

@ -1,5 +1,6 @@
package com.bx.implatform.service.impl; package com.bx.implatform.service.impl;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -20,6 +21,7 @@ import com.bx.implatform.entity.User;
import com.bx.implatform.enums.ResultCode; import com.bx.implatform.enums.ResultCode;
import com.bx.implatform.exception.GlobalException; import com.bx.implatform.exception.GlobalException;
import com.bx.implatform.mapper.UserMapper; import com.bx.implatform.mapper.UserMapper;
import com.bx.implatform.result.ResultUtils;
import com.bx.implatform.service.FriendService; import com.bx.implatform.service.FriendService;
import com.bx.implatform.service.GroupMemberService; import com.bx.implatform.service.GroupMemberService;
import com.bx.implatform.service.PrivateMessageService; import com.bx.implatform.service.PrivateMessageService;
@ -41,6 +43,8 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.bx.implatform.enums.ResultCode.XSS_PARAM_ERROR;
@Slf4j @Slf4j
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
@ -363,6 +367,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
@Override @Override
public boolean chenckRelation(Long customerId, Long targetId, Long userId) { public boolean chenckRelation(Long customerId, Long targetId, Long userId) {
// 检查参数
if(ObjectUtil.isNull(customerId) || ObjectUtil.isNull(targetId) || ObjectUtil.isNull(userId)){
return false;
}
// 检查本身之间的关系 // 检查本身之间的关系
if(customerId.equals(targetId) || customerId.equals(userId) || targetId.equals(userId)){ if(customerId.equals(targetId) || customerId.equals(userId) || targetId.equals(userId)){
return false; return false;

Loading…
Cancel
Save