|
|
|
@ -12,9 +12,11 @@ import java.util.Set;
|
|
|
|
|
import java.util.function.Function;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import com.github.houbb.sensitive.word.bs.SensitiveWordBs;
|
|
|
|
|
import com.luoo.user.dto.TotalCommentVo;
|
|
|
|
|
import com.luoo.user.pojo.*;
|
|
|
|
|
import com.luoo.user.service.*;
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
@ -91,6 +93,9 @@ public class MyController extends BaseController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private RabbitTemplate rabbitTemplate;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private SensitiveWordBs sensitiveWordBs;
|
|
|
|
|
|
|
|
|
|
public static String USER_AVATAR_DIRECTORY = "user/avatar/";
|
|
|
|
|
public static String USER_FEEDBACK_IMAGE_DIRECTORY = "user/feedback/";
|
|
|
|
|
|
|
|
|
@ -113,11 +118,18 @@ public class MyController extends BaseController {
|
|
|
|
|
UserLoginDto userLoginDto = getUserLoginDto(authorization);
|
|
|
|
|
UserInfo user = userInfoService.findById(userLoginDto.getUserId());
|
|
|
|
|
String nickName = userInfoUpdateDto.getNickName();
|
|
|
|
|
|
|
|
|
|
String result = sensitiveWordBs.findFirst(nickName);
|
|
|
|
|
if (StringUtils.isNotEmpty(result)) {
|
|
|
|
|
return Result.failed(StatusCode.USER_SENSITIVE_INFO);
|
|
|
|
|
}
|
|
|
|
|
if (!StringTools.isEmpty(nickName) && !nickName.equals(user.getNickName())) {
|
|
|
|
|
long count = userInfoService.countByNickName(nickName);
|
|
|
|
|
if (count > 0) {
|
|
|
|
|
return Result.failed(StatusCode.USER_NICK_NAME_HAS_BEEN_EXIST);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!StringTools.isEmpty(nickName)) {
|
|
|
|
@ -125,6 +137,10 @@ public class MyController extends BaseController {
|
|
|
|
|
rabbitTemplate.convertAndSend("userInfoCommentCache",userLoginDto.getUserId());
|
|
|
|
|
}
|
|
|
|
|
if (!StringTools.isEmpty(userInfoUpdateDto.getSignature())) {
|
|
|
|
|
String signature = sensitiveWordBs.findFirst(userInfoUpdateDto.getSignature());
|
|
|
|
|
if(StringUtils.isNotEmpty(signature)) {
|
|
|
|
|
return Result.failed(StatusCode.USER_SENSITIVE_INFO);
|
|
|
|
|
}
|
|
|
|
|
user.setSignature(userInfoUpdateDto.getSignature());
|
|
|
|
|
}
|
|
|
|
|
if (!StringTools.isEmpty(userInfoUpdateDto.getBirthDay())) {
|
|
|
|
|