From e7aa951e89cae323d7f6ad4d9d570984118fbb24 Mon Sep 17 00:00:00 2001 From: xupei Date: Fri, 10 Jan 2025 16:19:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BC=8F=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ai/da/service/impl/AccountServiceImpl.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java index 3679acfa..9197b95e 100644 --- a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java @@ -2621,4 +2621,19 @@ public class AccountServiceImpl extends ServiceImpl 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); + } }