Leo/Backend (#82)
Ce merge enverra dans main : le timeout des token, la limite de 5 token par user, les nouvelles tables pour les demandes d'inscriptions Co-authored-by: Anthony Debucquoy <debucquoy.anthony@gmail.com> Reviewed-on: PGL/Clyde#82 Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com> Reviewed-by: Maxime <231026@umons.ac.be> Reviewed-by: Wal <karpinskiwal@gmail.com> Co-authored-by: LeoMoulin <leomoulin125@gmail.com> Co-committed-by: LeoMoulin <leomoulin125@gmail.com>
This commit is contained in:
@@ -7,12 +7,14 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import ovh.herisson.Clyde.Repositories.TokenRepository;
|
||||
import ovh.herisson.Clyde.Repositories.UserRepository;
|
||||
import ovh.herisson.Clyde.Services.TokenService;
|
||||
import ovh.herisson.Clyde.Tables.Role;
|
||||
import ovh.herisson.Clyde.Tables.Token;
|
||||
import ovh.herisson.Clyde.Tables.User;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
@RestController
|
||||
@@ -23,13 +25,14 @@ public class MockController {
|
||||
|
||||
public final UserRepository userRepo;
|
||||
public final TokenRepository tokenRepo;
|
||||
|
||||
public final TokenService tokenService;
|
||||
ArrayList<User> mockUsers;
|
||||
|
||||
|
||||
public MockController(UserRepository userRepo, TokenRepository tokenRepo){
|
||||
public MockController(UserRepository userRepo, TokenRepository tokenRepo, TokenService tokenService){
|
||||
this.tokenRepo = tokenRepo;
|
||||
this.userRepo = userRepo;
|
||||
this.tokenService = tokenService;
|
||||
}
|
||||
|
||||
/** Saves an example of each user type by :
|
||||
@@ -41,10 +44,10 @@ public class MockController {
|
||||
@PostMapping("/mock")
|
||||
public void postMock(){
|
||||
|
||||
User herobrine = new User("brine","hero","admin@admin.com","in your WalLs","ShadowsLand",new Date(0), "none",Role.Admin,passwordEncoder.encode("admin"));
|
||||
User joe = new User("Mama","Joe","student@student.com","roundabout","DaWarudo",new Date(0), "None",Role.Student,passwordEncoder.encode("student"));
|
||||
User meh = new User("Inspiration","lackOf","secretary@secretary.com","a Box","the street",new Date(0),"none", Role.Teacher,passwordEncoder.encode("secretary"));
|
||||
User joke = new User("CthemBalls","Lemme","teacher@teacher.com","lab","faculty",new Date(0), "none",Role.Teacher,passwordEncoder.encode("teacher"));
|
||||
User herobrine = new User("brine","hero","admin@admin.com","in your WalLs","ShadowsLand",new Date(0), null,Role.Admin,passwordEncoder.encode("admin"));
|
||||
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"));
|
||||
|
||||
mockUsers = new ArrayList<User>(Arrays.asList(herobrine,joe,meh,joke));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user