main #9
@@ -33,14 +33,14 @@ public class EmployeeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/{code}/auth")
|
@GetMapping("/{code}/auth")
|
||||||
public HttpStatus Isauth(@PathVariable String code) {
|
public ResponseEntity<?> Isauth(@PathVariable String code) {
|
||||||
if (employeeService.isCodeValid(code)) {
|
if (employeeService.isCodeValid(code)) {
|
||||||
return HttpStatus.OK;
|
return ResponseEntity.ok().build();
|
||||||
|
|
||||||
} else if (!employeeService.isCodeValid(code)){
|
} else if (!employeeService.isCodeValid(code)){
|
||||||
return HttpStatus.UNAUTHORIZED;
|
return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build();
|
||||||
} else {
|
} else {
|
||||||
return HttpStatus.BAD_REQUEST;
|
return ResponseEntity.status(HttpStatus.BAD_REQUEST).build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user