forked from cmzalvin/giit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeptController.java
More file actions
64 lines (51 loc) · 1.57 KB
/
DeptController.java
File metadata and controls
64 lines (51 loc) · 1.57 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
package com.giit.www.college.controller;
import com.giit.www.college.service.DeptBiz;
import com.giit.www.entity.Dept;
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 javax.annotation.Resource;
/**
* Created by c0de8ug on 16-2-10.
*/
@Controller
@RequestMapping("dept.do")
public class DeptController {
@Resource(name = "deptBizImpl")
private DeptBiz deptBiz;
@RequiresRoles("admin")
@RequestMapping("dept.view")
public String deptView(Model m) {
m.addAttribute("deptList", deptBiz.findAll());
return "/admin/college/dept";
}
@RequiresRoles("admin")
@RequestMapping("dept_add.view")
public String deptAddView(Model m) {
return "/admin/college/dept_add";
}
@RequiresRoles("admin")
@RequestMapping("dept_update.view")
public String deptUpdateView(Model m) {
return "/admin/college/dept_update";
}
@RequiresRoles("admin")
@RequestMapping("add")
public String add(String deptName) {
deptBiz.add(deptName);
return "redirect:/dept.do/dept.view";
}
@RequiresRoles("admin")
@RequestMapping("update")
public String update(Dept dept) {
deptBiz.update(dept);
return "redirect:/dept.do/dept.view";
}
@RequiresRoles("admin")
@RequestMapping("delete")
public String delete(int deptId) {
deptBiz.delete(deptId);
return "redirect:/dept.do/dept.view";
}
}