исправлено 0_о

This commit is contained in:
lynxwq2
2025-11-28 17:40:53 +03:00
parent 4a22c9d466
commit 94a8cddd51
5 changed files with 19 additions and 14 deletions

View File

@@ -1,8 +1,10 @@
package com.example.nto.controller;
import com.example.nto.entity.Employee;
import com.example.nto.repository.EmployeeRepository;
import com.example.nto.service.EmployeeService;
import com.example.nto.service.impl.EmployeeServiceImpl;
import org.hibernate.resource.beans.container.spi.BeanLifecycleStrategy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@@ -28,13 +30,14 @@ public class EmployeeController {
this.employeeService = employeeService;
}
@GetMapping("/{id}/auth")
public HttpStatus Isauth(@PathVariable long id){
if(employeeService.isIdValid(id)){
@GetMapping("/{code}/auth")
public HttpStatus Isauth(@PathVariable String code){
if(employeeService.isCodeValid(code)){
return HttpStatus.OK;
}
else
return HttpStatus.NOT_FOUND;
return HttpStatus.UNAUTHORIZED;
}