- Increased varchar limit from 100 to 250 on PhotoUrl
- Added profile update request for admin panel
This commit is contained in:
parent
34169e70d2
commit
b37e4bce34
@ -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")
|
@Operation(description = "Get user's last entries. Username is taken from Authentication", summary = "Get user's last entry")
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(responseCode = "200", description = "Request Successful."),
|
@ApiResponse(responseCode = "200", description = "Request Successful."),
|
||||||
|
@ApiResponse(responseCode = "204", description = "No Entrances."),
|
||||||
@ApiResponse(responseCode = "401", description = "Unauthorized"),
|
@ApiResponse(responseCode = "401", description = "Unauthorized"),
|
||||||
})
|
})
|
||||||
public ResponseEntity<EntranceDTO> getLastEntrance() {
|
public ResponseEntity<EntranceDTO> getLastEntrance() {
|
||||||
|
@ -41,8 +41,12 @@ public class EntranceServiceImpl implements EntranceService {
|
|||||||
public ResponseEntity<EntranceDTO> getLastEntrance(Authentication auth) {
|
public ResponseEntity<EntranceDTO> getLastEntrance(Authentication auth) {
|
||||||
Employee employee = employeeRepository.findByLogin(auth.getName());
|
Employee employee = employeeRepository.findByLogin(auth.getName());
|
||||||
List<EntranceDTO> entrances = employee.getEntrances().stream().map(EntranceMapper::convertToDTO).toList();
|
List<EntranceDTO> entrances = employee.getEntrances().stream().map(EntranceMapper::convertToDTO).toList();
|
||||||
System.out.println(entrances.getLast());
|
if(entrances.isEmpty()) {
|
||||||
return new ResponseEntity<>(entrances.getLast(), HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return new ResponseEntity<>(entrances.getLast(), HttpStatus.OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user