更新用户信息接口限制 头像昵称
This commit is contained in:
@@ -973,6 +973,8 @@ public enum BusiStatus {
|
||||
PACK_NUM_NOT_ENOUGH(500, "礼包数量不足"),
|
||||
|
||||
PACK_EXPIRE(500, "PACK EXPIRE"),
|
||||
|
||||
UPDATE_USER_NICK_AVATAR_LIMIT(500, "您的功能已被限制,请联系客服了解详情"),
|
||||
;
|
||||
|
||||
private final int value;
|
||||
|
@@ -4,6 +4,6 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UserConfigVo {
|
||||
public int avatarSetStatus = 1;
|
||||
public int nickSetStatus = 1;
|
||||
public int avatarSetStatus = 1;//1=可更改,0-不可更改
|
||||
public int nickSetStatus = 1;//1=可更改,0-不可更改
|
||||
}
|
||||
|
@@ -38,6 +38,7 @@ import com.accompany.business.vo.UserRoomCardVo;
|
||||
import com.accompany.business.vo.activity.RankActVo;
|
||||
import com.accompany.business.vo.home.PlayRoomVo;
|
||||
import com.accompany.business.vo.skillcard.SkillCardHomePageVo;
|
||||
import com.accompany.business.vo.user.UserConfigVo;
|
||||
import com.accompany.common.config.SystemConfig;
|
||||
import com.accompany.common.constant.ApplicationConstant;
|
||||
import com.accompany.common.constant.Constant;
|
||||
@@ -162,6 +163,8 @@ public class UsersService extends BaseService {
|
||||
private RegionInfoService regionInfoService;
|
||||
@Autowired
|
||||
private UploadAvatarService uploadAvatarService;
|
||||
@Autowired
|
||||
private UserConfigService userConfigService;
|
||||
|
||||
public Users getUsersByUid(Long uid) {
|
||||
if (uid == null) {
|
||||
@@ -477,6 +480,17 @@ public class UsersService extends BaseService {
|
||||
throw new ServiceException(BusiStatus.USERNOTEXISTS);
|
||||
}
|
||||
Users userDb = usersMapper.selectByPrimaryKey(users.getUid());
|
||||
if (userDb != null) {
|
||||
UserConfigVo userConfig = userConfigService.getUserConfig(users.getUid());
|
||||
if (StringUtils.isNotEmpty(users.getAvatar())
|
||||
&& !users.getAvatar().equals(userDb.getAvatar()) && userConfig.getAvatarSetStatus() == 0) {
|
||||
throw new ServiceException(BusiStatus.UPDATE_USER_NICK_AVATAR_LIMIT);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(users.getNick())
|
||||
&& !users.getNick().equals(userDb.getNick()) && userConfig.getNickSetStatus() == 0) {
|
||||
throw new ServiceException(BusiStatus.UPDATE_USER_NICK_AVATAR_LIMIT);
|
||||
}
|
||||
}
|
||||
|
||||
boolean isReview = false;
|
||||
String avatarUrl = users.getAvatar();
|
||||
|
Reference in New Issue
Block a user