Update src/main/java/com/example/nto/service/impl/EmployeeServiceImpl.java

This commit is contained in:
2025-12-08 12:05:48 +00:00
parent 4cd71ec9ad
commit b513cfb282

View File

@@ -1,12 +1,26 @@
package com.example.nto.service.impl; 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 com.example.nto.service.EmployeeService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
/** import java.util.Optional;
* TODO: ДОРАБОТАТЬ в рамках задания
* ================================= @Service
* МОЖНО: Добавлять методы, аннотации, зависимости @RequiredArgsConstructor
* НЕЛЬЗЯ: Изменять название класса и пакета
*/
public class EmployeeServiceImpl implements EmployeeService { public class EmployeeServiceImpl implements EmployeeService {
private final EmployeeRepository employeeRepository;
@Override
public boolean existsByCode(String code) {
return employeeRepository.existsByCode(code);
}
@Override
public Optional<Employee> findByCode(String code) {
return employeeRepository.findByCode(code);
}
} }