forked from cmzalvin/giit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSectionController.java
More file actions
67 lines (58 loc) · 2.02 KB
/
SectionController.java
File metadata and controls
67 lines (58 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package com.giit.www.college.controller;
import com.giit.www.college.service.SectionBiz;
import com.giit.www.entity.Section;
import com.giit.www.entity.Timetable;
import com.giit.www.util.TermContainer;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import sun.misc.Timeable;
import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
/**
* Created by c0de8ug on 16-2-12.
*/
@Controller
@RequestMapping("section.do")
public class SectionController {
@Resource(name = "sectionBizImpl")
private SectionBiz sectionBiz;
@RequiresRoles("admin")
@RequestMapping("section.view")
public String sectionView(Model m) {
m.addAttribute("sectionList", sectionBiz.findAllCustom());
return "/admin/college/section";
}
@RequiresRoles("admin")
@RequestMapping("section_add.view")
public String sectionAddView(Model m) {
m.addAttribute("courseTitleList", sectionBiz.findAllCourseTitle());
m.addAttribute("staffList", sectionBiz.findAllStaff());
m.addAttribute("termList", TermContainer.getTermList());
return "/admin/college/section_add";
}
@RequiresRoles("admin")
@RequestMapping("section_timetable_add.view")
public String sectionTimetableAdd(Model m) {
return "/admin/college/section_timetable_add";
}
@RequiresRoles("admin")
@RequestMapping("add")
public String add(Section section, HttpSession session) {
sectionBiz.add(section);
return "redirect:section.view";
}
@RequiresRoles("admin")
@RequestMapping("addTimetable")
public String addTimetable(Timetable timetable) {
sectionBiz.addTimetable(timetable);
return "redirect:section.view";
}
@RequiresRoles("admin")
@RequestMapping("delete")
public String delete(int secId) {
sectionBiz.delete(secId);
return "redirect:section.view";
}
}