student-30864-patch-1 #11

Closed
student-30864 wants to merge 19 commits from student-30864/NTO-2025-Backend-TeamTask-1:student-30864-patch-1 into main
Showing only changes of commit b513cfb282 - Show all commits

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);
}
} }