student-30864-patch-1 #11
@@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user