123
This commit is contained in:
@@ -17,6 +17,7 @@ import com.ruoyi.cai.enums.GenderEnum;
|
||||
import com.ruoyi.cai.enums.SystemConfigEnum;
|
||||
import com.ruoyi.cai.enums.user.UserPictureAuditType;
|
||||
import com.ruoyi.cai.executor.ExecutorConstant;
|
||||
import com.ruoyi.cai.im.ImManager;
|
||||
import com.ruoyi.cai.service.*;
|
||||
import com.ruoyi.cai.util.UserUtil;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
@@ -50,12 +51,16 @@ public class CurrentUserManager {
|
||||
private AccountService accountService;
|
||||
@Autowired
|
||||
private AccountBankcardService accountBankcardService;
|
||||
@Resource
|
||||
private ImUserRefClient userClient;
|
||||
@Autowired
|
||||
private UserPictureAuditService userPictureAuditService;
|
||||
@Autowired
|
||||
private SystemConfigManager systemConfigManager;
|
||||
@Autowired
|
||||
private CitysService citysService;
|
||||
@Autowired
|
||||
private CaiLoginManager loginManager;
|
||||
@Autowired
|
||||
private ImManager imManager;
|
||||
|
||||
public CurrentUserInfoVo currentInfo() {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
@@ -166,6 +171,8 @@ public class CurrentUserManager {
|
||||
updateFlag=true;
|
||||
updateYunxin=true;
|
||||
}
|
||||
String imAvatar = null;
|
||||
Integer imGender = null;
|
||||
if(res.getGender() != null){
|
||||
GenderEnum genderEnum = GenderEnum.getByCode(res.getGender());
|
||||
if(genderEnum == null){
|
||||
@@ -174,11 +181,10 @@ public class CurrentUserManager {
|
||||
if(user.getGender() != 0 && !user.getGender().equals(res.getGender())){
|
||||
throw new ServiceException("性别不可以修改");
|
||||
}
|
||||
String cosDomain = systemConfigManager.getSystemConfig(SystemConfigEnum.COS_DOMAIN);
|
||||
update.set(User::getGender,genderEnum.getCode());
|
||||
update.set(User::getAvatar,genderEnum.getDefaultAvatar());
|
||||
uinfoReq.setGender(genderEnum.getCode()+"");
|
||||
uinfoReq.setIcon(cosDomain + genderEnum.getDefaultAvatar());
|
||||
imAvatar = systemConfigManager.getSystemConfig(SystemConfigEnum.COS_DOMAIN);
|
||||
imGender = genderEnum.getCode();
|
||||
updateFlag=true;
|
||||
updateYunxin=true;
|
||||
}
|
||||
@@ -201,10 +207,7 @@ public class CurrentUserManager {
|
||||
if(flag){
|
||||
userService.checkFinishStatus(res.getUserId());
|
||||
if(updateYunxin){
|
||||
YxCommonR r = userClient.updateUinfo(uinfoReq);
|
||||
if(!r.isSuccess()){
|
||||
log.error("云信更新失败,需要检查!{}", JSON.toJSONString(r));
|
||||
}
|
||||
imManager.updateImInfo(user.getId(), imAvatar,res.getNickname(), imGender);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -234,11 +237,6 @@ public class CurrentUserManager {
|
||||
accountBankcardService.saveOrUpdate(bankcard);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private UserPictureAuditService userPictureAuditService;
|
||||
@Autowired
|
||||
private SystemConfigManager systemConfigManager;
|
||||
|
||||
public UserAvatarMinVo updateAvatar(UserUpdateAvatarReq res) {
|
||||
UserPictureAudit audit = userPictureAuditService.getOneUserAuditRunningPic(UserPictureAuditType.AVATAR.getCode(), res.getUserId());
|
||||
if(audit != null){
|
||||
@@ -268,7 +266,9 @@ public class CurrentUserManager {
|
||||
.set(User::getAvatar, res.getAvatar())
|
||||
.set(User::getAvatarState, 1));
|
||||
vo.setAuditStatus(AuditStatusEnum.SUCCESS.getCode());
|
||||
imManager.updateImInfo(res.getUserId(),res.getAvatar(),null,null);
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,11 @@ public class LockManager {
|
||||
public static final String LOCK_SEND_GIFT_REDIS = RedisHttpConstant.REDIS_P + "lock:sendGift:%s";
|
||||
public static final String LOCK_VIDEO_SETTLE_REDIS = RedisHttpConstant.REDIS_P + "lock:videoSettle:%s";
|
||||
public static final String LOCK_ONLINE_LOGIN_NOTICE_REDIS = RedisHttpConstant.REDIS_P + "lockHand:loginFansNotice:%s";
|
||||
public static final String LOCK_USER_STAR_REDIS = RedisHttpConstant.REDIS_P + "userStar:%s-%s";
|
||||
|
||||
public static String getUserStarRedis(Long userId,Long starUserId){
|
||||
return String.format(LOCK_USER_STAR_REDIS,userId,starUserId);
|
||||
}
|
||||
|
||||
public static String getRegisterLockKey(String mobile){
|
||||
return String.format(LOCK_REGISTER_REDIS,mobile);
|
||||
|
||||
Reference in New Issue
Block a user