реализация get, но пока ещё с ошибками

This commit is contained in:
lynxwq2
2025-11-26 16:04:30 +03:00
parent 0ea199cd6b
commit 5295d49a44
5 changed files with 80 additions and 5 deletions

View File

@@ -1,11 +1,12 @@
package com.example.nto.controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.example.nto.entity.Employee;
import com.example.nto.service.EmployeeService;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import java.net.http.HttpResponse;
import java.util.List;
/**
* TODO: ДОРАБОТАТЬ в рамках задания
@@ -20,4 +21,17 @@ public class EmployeeController {
public int isAuth(@PathVariable int id){
return id;
}
private final EmployeeService employeeService;
public EmployeeController(EmployeeService employeeService) {
this.employeeService = employeeService;
}
@GetMapping
@ResponseStatus(code = HttpStatus.OK)
public List<Employee> getAll() {
return employeeService.getAll();
}
}