Last change
on this file was d3cf3a1, checked in by Marija Micevska <marija_micevska@…>, 2 years ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | package project.educatum.web;
|
---|
2 |
|
---|
3 | import org.springframework.stereotype.Controller;
|
---|
4 | import org.springframework.web.bind.annotation.PathVariable;
|
---|
5 | import org.springframework.web.bind.annotation.PostMapping;
|
---|
6 | import org.springframework.web.bind.annotation.RequestMapping;
|
---|
7 | import org.springframework.web.bind.annotation.RequestMethod;
|
---|
8 | import project.educatum.repository.ClassRepository;
|
---|
9 | import project.educatum.service.ClassService;
|
---|
10 | import project.educatum.service.TeacherService;
|
---|
11 | import project.educatum.service.SubjectService;
|
---|
12 | import project.educatum.service.StudentService;
|
---|
13 |
|
---|
14 | @Controller
|
---|
15 | @RequestMapping(path = "/raspored", method = {RequestMethod.POST, RequestMethod.DELETE, RequestMethod.GET})
|
---|
16 | public class ClassController {
|
---|
17 |
|
---|
18 | private final ClassRepository classRepository;
|
---|
19 |
|
---|
20 | public ClassController(ClassRepository classRepository) {
|
---|
21 | this.classRepository = classRepository;
|
---|
22 | }
|
---|
23 |
|
---|
24 | @PostMapping("/delete/{id}")
|
---|
25 | public String deleteClass(@PathVariable String id) {
|
---|
26 | classRepository.deleteById(Integer.valueOf(id));
|
---|
27 | return "redirect:/teachers/allClasses";
|
---|
28 | }
|
---|
29 |
|
---|
30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.