реализация 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,6 +1,11 @@
package com.example.nto.service.impl;
import com.example.nto.entity.Employee;
import com.example.nto.repository.EmployeeRepository;
import com.example.nto.service.EmployeeService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* TODO: ДОРАБОТАТЬ в рамках задания
@@ -8,5 +13,23 @@ import com.example.nto.service.EmployeeService;
* МОЖНО: Добавлять методы, аннотации, зависимости
* НЕЛЬЗЯ: Изменять название класса и пакета
*/
@Service
public class EmployeeServiceImpl implements EmployeeService {
private final EmployeeRepository employeeRepository;
public EmployeeServiceImpl(EmployeeRepository employeeRepository) {
this.employeeRepository = employeeRepository;
}
@Override
public List<Employee> getAll() {
return employeeRepository.findAll();
}
@Override
public Employee getById(long id) {
return employeeRepository.findById(id);
}
}