11
Some checks failed
Android Test / validate-and-test (pull_request) Has been cancelled

This commit is contained in:
Bhumi Shah
2025-12-06 08:45:46 +03:00
parent 3b64ad9626
commit c4bb98b321

View File

@@ -22,6 +22,18 @@ import java.util.stream.Collectors;
public class EmployeeController {
@Autowired
private EmployeeService employeeService;
@GetMapping("/{code}/auth")
public ResponseEntity<Void> checkAuth(
@PathVariable String code) {
try {
employeeService.getEmployeeByCode(code);
return ResponseEntity.ok().build();
} catch (IllegalArgumentException e) {
return ResponseEntity.status(HttpStatus.BAD_REQUEST).build();
} catch (EmployeeNotFoundException e) {
return ResponseEntity.status(HttpStatus.NOT_FOUND).build();
}
}
@GetMapping("/{code}/info")
public ResponseEntity<?> getEmployeeInfo(@PathVariable String code) {
try {