From e96ed8dd32026c8fb698eac180e0c335f908aa93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E8=8B=B1=E6=9D=B0?= <327782001@qq.com> Date: Wed, 25 Oct 2023 16:00:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=9B=B4=E6=96=B0=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kwan/springbootkwan/controller/CsdnUserController.java | 5 ++++- .../kwan/springbootkwan/entity/query/CsdnUserInfoQuery.java | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/kwan/springbootkwan/controller/CsdnUserController.java b/src/main/java/com/kwan/springbootkwan/controller/CsdnUserController.java index 265d7f6..ee48946 100644 --- a/src/main/java/com/kwan/springbootkwan/controller/CsdnUserController.java +++ b/src/main/java/com/kwan/springbootkwan/controller/CsdnUserController.java @@ -110,7 +110,10 @@ public class CsdnUserController { @PostMapping("/update") public Result update(@RequestBody CsdnUserInfoQuery query) { CsdnUserInfo csdnUserInfo = new CsdnUserInfo(); - BeanUtils.copyProperties(query, csdnUserInfo); + csdnUserInfo.setId(query.getId()); + csdnUserInfo.setUserName(query.getUserName()); + csdnUserInfo.setNickName(query.getNickName()); + csdnUserInfo.setUserWeight(query.getUserWeight()); return Result.ok(this.csdnUserInfoService.updateById(csdnUserInfo)); } diff --git a/src/main/java/com/kwan/springbootkwan/entity/query/CsdnUserInfoQuery.java b/src/main/java/com/kwan/springbootkwan/entity/query/CsdnUserInfoQuery.java index bba790e..09673bd 100644 --- a/src/main/java/com/kwan/springbootkwan/entity/query/CsdnUserInfoQuery.java +++ b/src/main/java/com/kwan/springbootkwan/entity/query/CsdnUserInfoQuery.java @@ -4,6 +4,10 @@ import lombok.Data; @Data public class CsdnUserInfoQuery { + /** + * 主键id + */ + private Integer id; /** * 用户code */ -- GitLab