cleaned Services + added private final to all repos
Some checks failed
Build and test backend / Build-backend (pull_request) Failing after 1m35s
Build and test backend / Test-backend (pull_request) Failing after 1m30s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 26s

This commit is contained in:
Bartha Maxime 2024-03-16 09:02:08 +01:00
parent 13fd048cd2
commit c6198b7220
5 changed files with 7 additions and 16 deletions

View File

@ -1,8 +1,6 @@
package ovh.herisson.Clyde.Services; package ovh.herisson.Clyde.Services;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import ovh.herisson.Clyde.EndPoints.LoginController;
import ovh.herisson.Clyde.Repositories.InscriptionRepository;
import ovh.herisson.Clyde.Tables.InscriptionRequest; import ovh.herisson.Clyde.Tables.InscriptionRequest;
import ovh.herisson.Clyde.Tables.Role; import ovh.herisson.Clyde.Tables.Role;
import ovh.herisson.Clyde.Tables.Token; import ovh.herisson.Clyde.Tables.Token;

View File

@ -4,23 +4,20 @@ 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; private final InscriptionRepository inscriptionRepo;
public void save(InscriptionRequest inscriptionRequest){ public void save(InscriptionRequest inscriptionRequest){
incriptionRepo.save(inscriptionRequest); inscriptionRepo.save(inscriptionRequest);
} }
public InscriptionService(InscriptionRepository inscriptionRepo){ public InscriptionService(InscriptionRepository inscriptionRepo){
this.incriptionRepo = inscriptionRepo; this.inscriptionRepo = inscriptionRepo;
} }
public InscriptionRequest getById(long id){ public InscriptionRequest getById(long id){
InscriptionRequest inscriptionRequest = incriptionRepo.findById(id); InscriptionRequest inscriptionRequest = inscriptionRepo.findById(id);
if (inscriptionRequest == null){ if (inscriptionRequest == null){
return null; return null;
@ -29,6 +26,6 @@ public class InscriptionService {
} }
public Iterable<InscriptionRequest> getAll(){ public Iterable<InscriptionRequest> getAll(){
return incriptionRepo.findAll(); return inscriptionRepo.findAll();
} }
} }

View File

@ -4,10 +4,8 @@ import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import ovh.herisson.Clyde.Repositories.FileRepository; import ovh.herisson.Clyde.Repositories.FileRepository;
import ovh.herisson.Clyde.Tables.*; import ovh.herisson.Clyde.Tables.*;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;

View File

@ -5,16 +5,14 @@ import org.springframework.stereotype.Service;
import ovh.herisson.Clyde.Repositories.TokenRepository; import ovh.herisson.Clyde.Repositories.TokenRepository;
import ovh.herisson.Clyde.Tables.Token; import ovh.herisson.Clyde.Tables.Token;
import ovh.herisson.Clyde.Tables.User; import ovh.herisson.Clyde.Tables.User;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.security.SecureRandom; import java.security.SecureRandom;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date;
@Service @Service
public class TokenService { public class TokenService {
TokenRepository tokenRepo; private final TokenRepository tokenRepo;
public TokenService(TokenRepository tokenRepo){ public TokenService(TokenRepository tokenRepo){
this.tokenRepo = tokenRepo; this.tokenRepo = tokenRepo;

View File

@ -1,6 +1,6 @@
package ovh.herisson.Clyde.Tables; package ovh.herisson.Clyde.Tables;
import jakarta.persistence.Entity; import ja karta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;