Compare commits

..

No commits in common. "c6198b7220931156195ebeb7901cd3cda13dd926" and "25009ba149938c74594d53088e7c52ea5ad0fd16" have entirely different histories.

6 changed files with 17 additions and 9 deletions

View File

@ -43,8 +43,7 @@ public class MockController {
User joe = new User("Mama","Joe","student@student.com","roundabout","DaWarudo",new Date(0), null,Role.Student,passwordEncoder.encode("student"));
User meh = new User("Inspiration","lackOf","secretary@secretary.com","a Box","the street",new Date(0), null,Role.Teacher,passwordEncoder.encode("secretary"));
User joke = new User("CthemBalls","Lemme","teacher@teacher.com","lab","faculty",new Date(0), null,Role.Teacher,passwordEncoder.encode("teacher"));
User lena = new User("Louille","Lena","inscriptionService@InscriptionService.com","no","yes",new Date(0), null,Role.Teacher,passwordEncoder.encode("inscriptionService"));
mockUsers = new ArrayList<>(Arrays.asList(herobrine,joe,meh,joke));
mockUsers = new ArrayList<User>(Arrays.asList(herobrine,joe,meh,joke));
userRepo.saveAll(mockUsers);
}

View File

@ -1,6 +1,8 @@
package ovh.herisson.Clyde.Services;
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.Role;
import ovh.herisson.Clyde.Tables.Token;

View File

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

View File

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

View File

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

View File

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