diff --git a/src/main/java/com/kwan/springbootkwan/controller/CsdnUserController.java b/src/main/java/com/kwan/springbootkwan/controller/CsdnUserController.java index 265d7f602d15418e0b00773617dafcdd267f7d54..ee489469079c84653827e01dbbd40ebbdfaf83ff 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 bba790e620fb42086dc8b0c44ef87beff6db3ddc..09673bd59ccae013f5638b95461a10f8b1edc280 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 */