Fixed Controller Path mistakes

This commit is contained in:
Luedtke 2021-07-09 19:28:22 +02:00
parent 35af40ca0e
commit 18348ac839
4 changed files with 23 additions and 5 deletions

View File

@ -11,7 +11,9 @@ import java.util.List;
public class DozentController {
@GetMapping("/dozent")
public List<Dozent> getDozentList(){
public List<Dozent> getDozentList(@RequestParam(name = "searchString", required = false) String searchString){
// -> Have to query/intelligently search only when the searchString is present
List<Dozent> retList = new ArrayList<>();
//TODO IMPLEMENT
return retList;

View File

@ -8,8 +8,11 @@ import java.util.List;
@RestController
public class KlausurController {
@GetMapping("/klausur")
public List<Klausur> getKlausurList(){
public List<Klausur> getKlausurList(@RequestParam(name = "searchString", required = false) String searchString){
// -> Have to query/intelligently search only when the searchString is present
List<Klausur> retList = new ArrayList<>();
//TODO IMPLEMENT
return retList;
@ -22,12 +25,12 @@ public class KlausurController {
}
@PostMapping("/klausur")
public Klausur persistDozent(@RequestParam(name = "Klausur") Klausur pKlausur){
public Klausur persistKlausur(@RequestParam(name = "Klausur") Klausur pKlausur){
//TODO IMPLEMENT
return new Klausur();
}
@DeleteMapping("/Klausur/{id}")
@DeleteMapping("/klausur/{id}")
public void deleteKlausurByID(@PathVariable String id){
//TODO IMPLEMENT - SEARCH; IF EXISTS DELETE
}

View File

@ -1,5 +1,6 @@
package de.fswiai.klausurenmodul.controller;
import de.fswiai.klausurenmodul.model.Klausur;
import de.fswiai.klausurenmodul.model.Modul;
import org.springframework.web.bind.annotation.*;
@ -10,7 +11,9 @@ import java.util.List;
public class ModulController {
@GetMapping("/modul")
public List<Modul> getModuleList(){
public List<Modul> getModuleList(@RequestParam(name = "searchString", required = false) String searchString){
// -> Have to query/intelligently search only when the searchString is present
List<Modul> retList = new ArrayList<>();
//TODO IMPLEMENT
return retList;
@ -22,6 +25,14 @@ public class ModulController {
return new Modul();
}
@GetMapping("/module/{moduleId}/klausuren")
public List<Klausur> getKlausurListForModule(@PathVariable String moduleId){
//TODO Search/Filter Query
List<Klausur> retList = new ArrayList<>();
return retList;
}
@PostMapping("/modul")
public Modul persistModul(@RequestParam(name = "modul") Modul pModul){
//TODO IMPLEMENT
@ -31,5 +42,6 @@ public class ModulController {
@DeleteMapping("/modul/{id}")
public void deleteModuleByID(@PathVariable String id){
//TODO IMPLEMENT - SEARCH; IF EXISTS DELETE
// Also delete the Klausuren or not? (prob not the files)
}
}

View File

@ -4,6 +4,7 @@ public class Klausur {
//ID required, ID Format? -> have to check the db
private String shortname;
private String longname;
private Modul modul;
private String filepath; // Should this just be the same as longname?
private String link; // Or should we handle links differently?
//May need a 'semester' field, not sure. Have to check db again.