forked from Olympic/NTO-2025-Backend-TeamTask
11
This commit is contained in:
@@ -22,6 +22,18 @@ import java.util.stream.Collectors;
|
|||||||
public class EmployeeController {
|
public class EmployeeController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private EmployeeService employeeService;
|
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")
|
@GetMapping("/{code}/info")
|
||||||
public ResponseEntity<?> getEmployeeInfo(@PathVariable String code) {
|
public ResponseEntity<?> getEmployeeInfo(@PathVariable String code) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user