исправлено 0_о
This commit is contained in:
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user