changed details

This commit is contained in:
Bartha Maxime 2024-03-14 20:04:27 +01:00
parent f0a411c031
commit 9aa425d1c3

View File

@ -4,31 +4,24 @@ import org.springframework.stereotype.Service;
import ovh.herisson.Clyde.Repositories.InscriptionRepository; import ovh.herisson.Clyde.Repositories.InscriptionRepository;
import ovh.herisson.Clyde.Tables.InscriptionRequest; import ovh.herisson.Clyde.Tables.InscriptionRequest;
import java.util.HashMap;
import java.util.Map;
@Service @Service
public class InscriptionService { public class InscriptionService {
InscriptionRepository incriptionRepo; InscriptionRepository inscriptionRepo;
public void save(InscriptionRequest inscriptionRequest){
incriptionRepo.save(inscriptionRequest);
}
public InscriptionService(InscriptionRepository inscriptionRepo){ public InscriptionService(InscriptionRepository inscriptionRepo){
this.incriptionRepo = inscriptionRepo; this.inscriptionRepo = inscriptionRepo;
}
public void save(InscriptionRequest inscriptionRequest){
inscriptionRepo.save(inscriptionRequest);
} }
public InscriptionRequest getById(long id){ public InscriptionRequest getById(long id){
InscriptionRequest inscriptionRequest = incriptionRepo.findById(id); return inscriptionRepo.findById(id);
if (inscriptionRequest == null){
return null;
}
return inscriptionRequest;
} }
public Iterable<InscriptionRequest> getAll(){ public Iterable<InscriptionRequest> getAll(){
return incriptionRepo.findAll(); return inscriptionRepo.findAll();
} }
} }