source: src/main/java/project/educatum/web/SubjectController.java

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.0 KB
Line 
1package project.educatum.web;
2
3import org.springframework.stereotype.Controller;
4import org.springframework.web.bind.annotation.*;
5import project.educatum.service.SubjectService;
6import project.educatum.service.StudentService;
7import project.educatum.service.InterestService;
8
9@Controller
10@RequestMapping(path = "/subjects", method = {RequestMethod.POST, RequestMethod.DELETE, RequestMethod.GET})
11
12public class SubjectController {
13
14 private final StudentService studentService;
15 private final SubjectService subjectService;
16 private final InterestService interestService;
17
18 public SubjectController(StudentService studentService, SubjectService subjectService, InterestService interestService) {
19 this.studentService = studentService;
20 this.subjectService = subjectService;
21 this.interestService = interestService;
22 }
23
24
25 @PostMapping("/delete/{id}")
26 public String deleteSubject(@PathVariable String id) {
27 subjectService.delete(Integer.parseInt(id));
28 return "redirect:/admin/allSubjects";
29 }
30
31}
Note: See TracBrowser for help on using the repository browser.