Lecturer Dashboard Finished Version
This commit is contained in:
@@ -9,6 +9,9 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
public class SemesterController
|
||||
{
|
||||
@@ -60,6 +63,23 @@ public class SemesterController
|
||||
return new ResponseEntity<>(HttpStatus.FORBIDDEN);
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@GetMapping("/semester/id/all")
|
||||
public ResponseEntity<Semester[]> getSemestersAll(@RequestParam(name="ids") String ids, @RequestParam(name="sessionid") String sessionid)
|
||||
{
|
||||
String[] idsSplit = ids.split("a");
|
||||
|
||||
List<Semester> resultList = new ArrayList<>();
|
||||
|
||||
for(int i = 0; i < idsSplit.length; i++)
|
||||
{
|
||||
int currentID = Integer.parseInt(idsSplit[i]);
|
||||
resultList.add(db.getSemester(currentID));
|
||||
}
|
||||
|
||||
return new ResponseEntity<>(resultList.toArray(new Semester[0]), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@GetMapping("/semester/all")
|
||||
public ResponseEntity<Semester[]> getSemester(@RequestParam(name="sessionid") String sessionid)
|
||||
|
||||
Reference in New Issue
Block a user