From ca209e26d36abe211487d278f48fc7323ab3fbbe Mon Sep 17 00:00:00 2001 From: pk9tv8hgp <1215904376@qq.com> Date: Mon, 24 Apr 2023 13:12:48 +0800 Subject: [PATCH] Add UserController --- UserController | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 UserController diff --git a/UserController b/UserController new file mode 100644 index 0000000..c565ca1 --- /dev/null +++ b/UserController @@ -0,0 +1,49 @@ +package com.controller.before; + +import javax.servlet.http.HttpSession; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; + +import com.po.Buser; +import com.service.before.UserService; + +@Controller +@RequestMapping("/user") +public class UserController { + @Autowired + private UserService userService; + @RequestMapping("/register") + public String register(@ModelAttribute Buser buser,Model model, HttpSession session, String code) { + return userService.register(buser, model, session, code); + } + @RequestMapping("/login") + public String login(@ModelAttribute Buser buser,Model model, HttpSession session, String code) { + return userService.login(buser, model, session, code); + } + /** + * 转到登录页面 + */ + @RequestMapping("/toLogin") + public String toLogin(Model model) { + return userService.toLogin(model); + } + /** + * 转到注册页面 + */ + @RequestMapping("/toRegister") + public String toRegister(Model model) { + return userService.toRegister(model); + } + /** + * 修改密码 + */ + @RequestMapping("/update") + public String update(Model model, HttpSession session, String bpwd) { + return userService.update(model, session, bpwd); + } + +} \ No newline at end of file