Compare commits
No commits in common. "385290d1a2c18d782af59d0a11691e6e0d72cd7a" and "cf2deb983deae06caacb50243812e92bcbd0533e" have entirely different histories.
385290d1a2
...
cf2deb983d
@ -83,6 +83,7 @@ public class UserController {
|
||||
|
||||
@GetMapping("/teachers")
|
||||
public ResponseEntity<Iterable<HashMap<String,Object>>> getAllTeachers(@RequestHeader("Authorization") String token){
|
||||
|
||||
if (authServ.getUserFromToken(token) == null)
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
@ -90,15 +91,5 @@ public class UserController {
|
||||
|
||||
return new ResponseEntity<>(ProtectionService.usersWithoutPasswords(teachers), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/students")
|
||||
public ResponseEntity<Iterable<HashMap<String,Object>>> getAllStudent(@RequestHeader("Authorization") String token){
|
||||
if (authServ.getUserFromToken(token) == null)
|
||||
return new UnauthorizedResponse<>(null);
|
||||
|
||||
Iterable<User> students = userService.getAllStudents();
|
||||
|
||||
return new ResponseEntity<>(ProtectionService.usersWithoutPasswords(students), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,4 @@ public interface UserRepository extends CrudRepository<User, Long> {
|
||||
|
||||
@Query("select u from User u where u.role = ovh.herisson.Clyde.Tables.Role.Teacher")
|
||||
Iterable<User> findAllTeachers();
|
||||
|
||||
@Query("select u from User u where u.role = ovh.herisson.Clyde.Tables.Role.Student")
|
||||
Iterable<User> findAllStudents();
|
||||
}
|
@ -115,7 +115,6 @@ public class UserService {
|
||||
}
|
||||
|
||||
|
||||
public Iterable<User> getAllTeachers (){return userRepo.findAllTeachers();}
|
||||
|
||||
public Iterable<User> getAllStudents(){return userRepo.findAllStudents();}
|
||||
public Iterable<User> getAllTeachers (){return userRepo.findAllTeachers();}
|
||||
}
|
Loading…
Reference in New Issue
Block a user