профили
This commit is contained in:
@@ -193,6 +193,16 @@ public class SpecialityController {
|
||||
));
|
||||
}
|
||||
|
||||
@GetMapping("/profiles")
|
||||
public List<SpecialtyProfileDto> getAllProfiles() {
|
||||
logger.info("Получен запрос на получение всех профилей обучения");
|
||||
return specialtyProfileRepository.findAll().stream()
|
||||
.filter(profile -> profile.getSpeciality().isActiveRecord())
|
||||
.sorted((a, b) -> a.getName().compareToIgnoreCase(b.getName()))
|
||||
.map(this::toProfileDto)
|
||||
.toList();
|
||||
}
|
||||
|
||||
@GetMapping("/{specialtyId}/profiles")
|
||||
public ResponseEntity<?> getProfiles(@PathVariable Long specialtyId) {
|
||||
if (!specialtiesRepository.existsById(specialtyId)) {
|
||||
|
||||
Reference in New Issue
Block a user