From 9c3c368a5398718c2c30e23c769e5997762fb62a Mon Sep 17 00:00:00 2001 From: pk9tv8hgp <1215904376@qq.com> Date: Mon, 24 Apr 2023 13:07:30 +0800 Subject: [PATCH] Add AdminController --- AdminController | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 AdminController diff --git a/AdminController b/AdminController new file mode 100644 index 0000000..2174886 --- /dev/null +++ b/AdminController @@ -0,0 +1,22 @@ +package com.controller.admin; +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.Auser; +import com.service.admin.AdminService; +@Controller +public class AdminController { + @Autowired + private AdminService adminService; + @RequestMapping("/admin") + public String toLogin(@ModelAttribute Auser auser) { + return "admin/login"; + } + @RequestMapping("admin/login") + public String login(@ModelAttribute Auser auser, Model model, HttpSession session) { + return adminService.login(auser, model, session); + } +} \ No newline at end of file