123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- package cn.com.qmth.examcloud.tool.controller;
- import cn.com.qmth.examcloud.tool.config.Constants;
- import cn.com.qmth.examcloud.tool.service.CommonService;
- import cn.com.qmth.examcloud.tool.vo.user.User;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Controller;
- import org.springframework.ui.Model;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.RequestParam;
- @Controller
- public class IndexController extends BaseController {
- @Autowired
- private CommonService commonService;
- @GetMapping(value = "/")
- public String index() {
- return "index";
- }
- @GetMapping(value = "/logout")
- public String logout() {
- currentSession().removeAttribute(Constants.LOGIN_USER);
- return "redirect:/login";
- }
- @GetMapping(value = "/login")
- public String login() {
- if (currentLoginUser() != null) {
- return "redirect:/admin/workspace";
- }
- return "login";
- }
- @PostMapping(value = "/login")
- public void doLogin(@RequestParam String domain,
- @RequestParam String loginName,
- @RequestParam String password) {
- User user = commonService.login(domain, loginName, password);
- currentSession().setAttribute(Constants.LOGIN_USER, user);
- }
- @GetMapping(value = "/admin/workspace")
- public String workspace() {
- return "admin/workspace";
- }
- /**
- * 任务列表
- */
- @GetMapping(value = "/admin/taskList")
- public String taskList(Model model) {
- model.addAttribute("menuIndex", 2);
- return "admin/taskList";
- }
- /**
- * 导出考生试题作答和得分明细
- */
- @GetMapping(value = "/admin/exportStudentAnswerAndScoreDetail")
- public String exportStudentAnswerAndScoreDetail() {
- return "admin/exportStudentAnswerAndScoreDetail";
- }
- /**
- * 更新正确答案并重新算分
- */
- @GetMapping(value = "/admin/updateCorrectAnswerAndReFixScore")
- public String updateCorrectAnswerAndReFixScore() {
- return "admin/updateCorrectAnswerAndReFixScore";
- }
- /**
- * 配置考试调卷规则
- */
- @GetMapping(value = "/admin/configExamPaper")
- public String configExamPaper() {
- return "admin/configExamPaper";
- }
- }
|