package com.example.osservice.Controller; import com.example.osservice.Service.SubjectService; import com.example.osservice.VO.Response; import com.example.osservice.VO.Subject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; @RestController @RequestMapping("/api/subject") public class SubjectController { @Autowired private SubjectService subjectService; @PostMapping("/") public Response createSubject(@RequestBody long userId, @RequestBody String name, @RequestBody String description){ return subjectService.createSubject(); } @PutMapping("/{subjectId}") public Response updateSubject(@PathVariable long subjectId,@RequestBody long userId, @RequestBody String name, @RequestBody String description){ return subjectService.updateSubject(); } @DeleteMapping("/{subjectId}") public Response deleteSubject(@PathVariable long subjectId){ return subjectService.deleteSubject(); } @GetMapping("/{subjectId}") public Response getSubject(@PathVariable long subjectId){ return subjectService.getSubject(); } @GetMapping("/list/{userId}") public Response> getSubjectsByUserId(@PathVariable long userId){ return subjectService.getSubjectsByUserId(); } @GetMapping("/list") public Response> getAllSubjects(){ return subjectService.getAllSubjects(); } }