Skip to content

Commit

Permalink
fix: set student id
Browse files Browse the repository at this point in the history
  • Loading branch information
Pleasurecruise committed Nov 14, 2024
1 parent 4699292 commit 192ae1b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public Result update(@RequestBody StudentDTO studentDTO, HttpServletRequest requ
Integer id = getCurrentStudentId(request);
Student student = studentService.getById(id);
log.info("当前学生信息:{}", student);

studentDTO.setId(id);
studentDTO.setUsername(Optional.ofNullable(studentDTO.getUsername()).orElse(student.getUsername()));
studentDTO.setAvatar(Optional.ofNullable(studentDTO.getAvatar()).orElse(student.getAvatar()));
studentDTO.setSex(Optional.ofNullable(studentDTO.getSex()).orElse(student.getSex()));
Expand Down

0 comments on commit 192ae1b

Please sign in to comment.