Update src/main/java/com/example/nto/service/impl/EmployeeServiceImpl.java
This commit is contained in:
@@ -1,12 +1,26 @@
|
||||
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 lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* TODO: ДОРАБОТАТЬ в рамках задания
|
||||
* =================================
|
||||
* МОЖНО: Добавлять методы, аннотации, зависимости
|
||||
* НЕЛЬЗЯ: Изменять название класса и пакета
|
||||
*/
|
||||
import java.util.Optional;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
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