This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user