- Increased varchar limit from 100 to 250 on PhotoUrl

- Added profile update request for admin panel
This commit is contained in:
Индекс Зиро 2025-02-20 12:22:42 +03:00
parent 34169e70d2
commit b37e4bce34
2 changed files with 7 additions and 2 deletions

View File

@ -35,6 +35,7 @@ public class EntranceController {
@Operation(description = "Get user's last entries. Username is taken from Authentication", summary = "Get user's last entry")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Request Successful."),
@ApiResponse(responseCode = "204", description = "No Entrances."),
@ApiResponse(responseCode = "401", description = "Unauthorized"),
})
public ResponseEntity<EntranceDTO> getLastEntrance() {

View File

@ -41,8 +41,12 @@ public class EntranceServiceImpl implements EntranceService {
public ResponseEntity<EntranceDTO> getLastEntrance(Authentication auth) {
Employee employee = employeeRepository.findByLogin(auth.getName());
List<EntranceDTO> entrances = employee.getEntrances().stream().map(EntranceMapper::convertToDTO).toList();
System.out.println(entrances.getLast());
return new ResponseEntity<>(entrances.getLast(), HttpStatus.OK);
if(entrances.isEmpty()) {
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
else {
return new ResponseEntity<>(entrances.getLast(), HttpStatus.OK);
}
}
@Override