From 093fac278c7931e8160209a428729d5a82d5cd72 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期日, 27 十月 2024 21:29:09 +0800 Subject: [PATCH] 一个班级可以有多个老师 --- src/main/java/com/ycl/jxkg/controller/RegisterController.java | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/ycl/jxkg/controller/RegisterController.java b/src/main/java/com/ycl/jxkg/controller/RegisterController.java index dafb2d3..5e32121 100644 --- a/src/main/java/com/ycl/jxkg/controller/RegisterController.java +++ b/src/main/java/com/ycl/jxkg/controller/RegisterController.java @@ -2,6 +2,7 @@ import com.ycl.jxkg.base.Result; import com.ycl.jxkg.domain.form.RegisterForm; +import com.ycl.jxkg.service.AuthenticationService; import com.ycl.jxkg.service.UserService; import lombok.RequiredArgsConstructor; import org.springframework.validation.annotation.Validated; @@ -22,15 +23,18 @@ public class RegisterController { private final UserService userService; + private final AuthenticationService authenticationService; @PostMapping("/teacher") public Result teacherRegister(@RequestBody @Validated RegisterForm form) { + form.setPassword(authenticationService.pwdEncode(form.getPassword())); userService.teacherRegister(form); return Result.ok("娉ㄥ唽鎴愬姛"); } @PostMapping("/student") public Result studentRegister(@RequestBody @Validated RegisterForm form) { + form.setPassword(authenticationService.pwdEncode(form.getPassword())); userService.studentRegister(form); return Result.ok("娉ㄥ唽鎴愬姛"); } -- Gitblit v1.8.0