Add manager methods

This commit is contained in:
Anton Romanov 2025-01-29 19:32:13 +04:00
parent 4d1844d256
commit f15a658f56
2 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,7 @@
package ru.ulstu.manager.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import ru.ulstu.manager.model.Manager;
public interface ManagerRepository extends JpaRepository<Manager, Integer> {
}

View File

@ -0,0 +1,20 @@
package ru.ulstu.manager.service;
import org.springframework.stereotype.Service;
import ru.ulstu.manager.model.Manager;
import ru.ulstu.manager.repository.ManagerRepository;
import java.util.List;
@Service
public class ManagerService {
private final ManagerRepository managerRepository;
public ManagerService(ManagerRepository managerRepository) {
this.managerRepository = managerRepository;
}
public List<Manager> getManagers() {
return managerRepository.findAll();
}
}