This commit is contained in:
2025-01-10 16:19:53 +08:00
parent ef70598180
commit e7aa951e89

View File

@@ -2621,4 +2621,19 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
accountMapper.updateById(account);
}
public void updateUserInfo(String country, String occupation){
Long accountId = UserContext.getUserHolder().getId();
Account account = accountMapper.selectById(accountId);
boolean flag = false;
if (!StringUtil.isNullOrEmpty(country) && !country.equals(account.getCountry())) {
account.setCountry(country.trim());
flag = true;
}
if (!StringUtil.isNullOrEmpty(occupation) && !occupation.equals(account.getOccupation())) {
account.setOccupation(occupation.trim());
flag = true;
}
if(flag) accountMapper.updateById(account);
}
}