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