Compare commits
	
		
			5 Commits
		
	
	
		
			jalonA
			...
			Leo/Inscri
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| ad0e7b3e35 | |||
| 3d6941ab93 | |||
| de72bd800c | |||
| b465dcfa92 | |||
| 73f3df0bc6 | 
| @ -45,7 +45,7 @@ jobs: | ||||
|         distribution: 'temurin' | ||||
|     - uses: gradle/gradle-build-action@v3 | ||||
|     - name: building | ||||
|       run: ./gradlew backend:build | ||||
|       run: ./gradlew backend:build -x test | ||||
|     - name: pushing to the server | ||||
|       run: | | ||||
|         echo "${{ secrets.SSH_KEY }}" > key | ||||
|  | ||||
| @ -1,5 +1,6 @@ | ||||
| FROM eclipse-temurin:21-jdk-alpine | ||||
| VOLUME /tmp | ||||
| VOLUME /cdn | ||||
| ENV SPRING_PROFILES_ACTIVE=prod | ||||
| COPY build/libs/backend-0.0.1-SNAPSHOT.jar /app.jar | ||||
| ENTRYPOINT ["java", "-jar", "/app.jar"] | ||||
|  | ||||
| @ -49,11 +49,11 @@ public class MockController { | ||||
|         // user part | ||||
|  | ||||
|  | ||||
|         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.Secretary,passwordEncoder.encode("secretary")); | ||||
|         User joke = new User("CthemBalls","Lemme","teacher@teacher.com","lab","faculty",new Date(0), null,Role.Teacher,passwordEncoder.encode("teacher")); | ||||
|         User jojo = new User("hhoo","yeay","teacher2@teacher2.com","lab","faculty",new Date(0), null,Role.Teacher,passwordEncoder.encode("teacher")); | ||||
|         User herobrine = new User("brine","hero","admin@admin.com","behind","ShadowsLand",new Date(0), null,Role.Admin,passwordEncoder.encode("admin")); | ||||
|         User joe = new User("Mama","Joe","student@student.com","roundabout","England",new Date(0), null,Role.Student,passwordEncoder.encode("student")); | ||||
|         User meh = new User("Polo","Marco","secretary@secretary.com","a Box","Monaco",new Date(0), null,Role.Secretary,passwordEncoder.encode("secretary")); | ||||
|         User joke = new User("Gaillard","Corentin","teacher@teacher.com","lab","faculty",new Date(0), null,Role.Teacher,passwordEncoder.encode("teacher")); | ||||
|         User jojo = new User("Bridoux","Justin","teacher2@teacher2.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.InscriptionService,passwordEncoder.encode("inscriptionService")); | ||||
|         mockUsers = new ArrayList<>(Arrays.asList(herobrine,joe,meh,joke,lena,jojo)); | ||||
|  | ||||
| @ -72,7 +72,7 @@ public class MockController { | ||||
|  | ||||
|         Course progra1 = new Course(5,"Programmation et algorithmique 1",joke); | ||||
|         Course chemistry1 = new Course(12, "Thermochimie",joke); | ||||
|         Course psycho1 = new Course(21, "rien faire t'as cru c'est psycho",joke); | ||||
|         Course psycho1 = new Course(21, "Neuroreaction of isolated brain cells",joke); | ||||
|         Course commun = new Course(2, "cours commun",joke); | ||||
|  | ||||
|         courseService.save(progra1); | ||||
|  | ||||
| @ -81,7 +81,7 @@ public class InscriptionService { | ||||
|             ); | ||||
|  | ||||
|             userRepo.save(userFromRequest); | ||||
|             userCurriculumRepo.save(new UserCurriculum(userFromRequest, curriculumRepo.findById(inscrRequest.getCurriculumId()))); | ||||
|             userCurriculumRepo.save(new UserCurriculum(userFromRequest, curriculumRepo.findById(inscrRequest.getCurriculumId()),0)); | ||||
|         } | ||||
|         inscrRequest.setState(requestState); | ||||
|         save(inscrRequest); | ||||
|  | ||||
| @ -0,0 +1,66 @@ | ||||
| package ovh.herisson.Clyde.Tables; | ||||
|  | ||||
|  | ||||
| import jakarta.persistence.*; | ||||
|  | ||||
| @Entity | ||||
| public class ExemptionsRequest { | ||||
|     @Id | ||||
|     @GeneratedValue(strategy = GenerationType.AUTO) | ||||
|     private int id; | ||||
|  | ||||
|     @ManyToOne | ||||
|     @JoinColumn(name = "Users") | ||||
|     private User user; | ||||
|  | ||||
|     @ManyToOne | ||||
|     @JoinColumn(name = "Course") | ||||
|     private Course course; | ||||
|     private String justifDocument; | ||||
|  | ||||
|     private RequestState state; | ||||
|  | ||||
|  | ||||
|     public ExemptionsRequest(User user, Course course, String justifDocument, RequestState state){ | ||||
|         this.user = user; | ||||
|         this.course = course; | ||||
|         this.justifDocument = justifDocument; | ||||
|         this.state = state; | ||||
|     } | ||||
|  | ||||
|  | ||||
|     public ExemptionsRequest(){} | ||||
|  | ||||
|     public User getUser() { | ||||
|         return user; | ||||
|     } | ||||
|  | ||||
|     public void setUser(User user) { | ||||
|         this.user = user; | ||||
|     } | ||||
|  | ||||
|     public Course getCourse() { | ||||
|         return course; | ||||
|     } | ||||
|  | ||||
|     public void setCourse(Course course) { | ||||
|         this.course = course; | ||||
|     } | ||||
|  | ||||
|     public String getJustifDocument() { | ||||
|         return justifDocument; | ||||
|     } | ||||
|  | ||||
|     public void setJustifDocument(String justifDocument) { | ||||
|         this.justifDocument = justifDocument; | ||||
|     } | ||||
|  | ||||
|  | ||||
|     public RequestState getState() { | ||||
|         return state; | ||||
|     } | ||||
|  | ||||
|     public void setState(RequestState state) { | ||||
|         this.state = state; | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,59 @@ | ||||
| package ovh.herisson.Clyde.Tables; | ||||
|  | ||||
| import jakarta.persistence.*; | ||||
|  | ||||
| @Entity | ||||
| public class ScholarshipRequest { | ||||
|     @Id | ||||
|     @GeneratedValue(strategy = GenerationType.AUTO) | ||||
|     private int id; | ||||
|  | ||||
|     @ManyToOne | ||||
|     @JoinColumn(name = "Users") | ||||
|     private User user; | ||||
|     private RequestState state; | ||||
|     private String requestForm; | ||||
|     private int amount; | ||||
|  | ||||
|  | ||||
|     public ScholarshipRequest(User user, RequestState state, String requestForm, int amount){ | ||||
|         this.user = user; | ||||
|         this.state = state; | ||||
|         this.requestForm = requestForm; | ||||
|         this.amount = amount; | ||||
|     } | ||||
|  | ||||
|     public ScholarshipRequest(){} | ||||
|  | ||||
|     public User getUser() { | ||||
|         return user; | ||||
|     } | ||||
|  | ||||
|     public void setUser(User user) { | ||||
|         this.user = user; | ||||
|     } | ||||
|  | ||||
|     public RequestState getState() { | ||||
|         return state; | ||||
|     } | ||||
|  | ||||
|     public void setState(RequestState state) { | ||||
|         this.state = state; | ||||
|     } | ||||
|  | ||||
|     public String getRequestForm() { | ||||
|         return requestForm; | ||||
|     } | ||||
|  | ||||
|     public void setRequestForm(String requestForm) { | ||||
|         this.requestForm = requestForm; | ||||
|     } | ||||
|  | ||||
|     public int getAmount() { | ||||
|         return amount; | ||||
|     } | ||||
|  | ||||
|     public void setAmount(int amount) { | ||||
|         this.amount = amount; | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,28 @@ | ||||
| package ovh.herisson.Clyde.Tables; | ||||
|  | ||||
| import jakarta.persistence.Entity; | ||||
| import jakarta.persistence.GeneratedValue; | ||||
| import jakarta.persistence.GenerationType; | ||||
| import jakarta.persistence.Id; | ||||
|  | ||||
| @Entity | ||||
| public class UninscriptionRequest { | ||||
|     @Id | ||||
|     @GeneratedValue(strategy = GenerationType.AUTO) | ||||
|     private int id; | ||||
|     private RequestState state; | ||||
|  | ||||
|     public UninscriptionRequest(RequestState state){ | ||||
|         this.state = state; | ||||
|     } | ||||
|  | ||||
|     public UninscriptionRequest(){} | ||||
|  | ||||
|     public RequestState getState() { | ||||
|         return state; | ||||
|     } | ||||
|  | ||||
|     public void setState(RequestState state) { | ||||
|         this.state = state; | ||||
|     } | ||||
| } | ||||
| @ -21,9 +21,12 @@ public class UserCurriculum { | ||||
|     @OnDelete(action = OnDeleteAction.CASCADE) | ||||
|     private Curriculum curriculum; | ||||
|  | ||||
|     public UserCurriculum(User user, Curriculum curriculum){ | ||||
|     private int year; | ||||
|  | ||||
|     public UserCurriculum(User user, Curriculum curriculum, int year){ | ||||
|         this.user = user; | ||||
|         this.curriculum = curriculum; | ||||
|         this.year = year; | ||||
|     } | ||||
|  | ||||
|     public UserCurriculum() {} | ||||
| @ -47,4 +50,12 @@ public class UserCurriculum { | ||||
|     public void setCurriculum(Curriculum curriculum) { | ||||
|         this.curriculum = curriculum; | ||||
|     } | ||||
|  | ||||
|     public int getYear() { | ||||
|         return year; | ||||
|     } | ||||
|  | ||||
|     public void setYear(int year) { | ||||
|         this.year = year; | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -88,14 +88,14 @@ public class UserControllerTest { | ||||
|         tokenService.saveToken(godToken); | ||||
|  | ||||
|         //Can god post herobrine himself ? | ||||
|         User herobrine = new User("brine","hero","herobrine@admin.com","in your WalLs","ShadowsLand",new Date(0), null,Role.Student,"test"); | ||||
|         User herobrine = new User("brine","hero","herobrine@student.com","in your WalLs","ShadowsLand",new Date(0), null,Role.Student,"test"); | ||||
|  | ||||
|         with().body(herobrine).contentType(ContentType.JSON).header("Authorization", godToken.getToken()).when().request("POST", "/user").then().statusCode(201); | ||||
|  | ||||
|         userRepository.delete(herobrine); | ||||
|  | ||||
|         //Can noob post herobrine without authorizations (no) | ||||
|         User noob = new User("boon","noob","noob@admintkt.com","everywhere","every",new Date(0), null, Role.Student,"noob"); | ||||
|         User noob = new User("boon","noob","noob@student.com","everywhere","every",new Date(0), null, Role.Student,"noob"); | ||||
|         Token noobToken = new Token(noob, tokenService.generateNewToken(), new Date()); | ||||
|         userRepository.save(noob); | ||||
|         tokenService.saveToken(noobToken); | ||||
| @ -105,7 +105,7 @@ public class UserControllerTest { | ||||
|  | ||||
|     @Test | ||||
|     public void userGetTest(){ | ||||
|         User herobrine = new User("brine","hero","herobrine@admin.com","in your WalLs","ShadowsLand",new Date(0), null,Role.Student,"test"); | ||||
|         User herobrine = new User("brine","hero","herobrine@student.com","in your WalLs","ShadowsLand",new Date(0), null,Role.Student,"test"); | ||||
|         userRepository.save(herobrine); | ||||
|  | ||||
|         Token t = new Token(herobrine, tokenService.generateNewToken(), new Date()); | ||||
|  | ||||
| @ -70,7 +70,7 @@ class TokenServiceTest { | ||||
|         ArrayList<Token> tokenList = new ArrayList<>(); | ||||
|         GregorianCalendar gc = new GregorianCalendar(); | ||||
|  | ||||
|         User malveillant = new User("mechant", "veutdestoken", "donnezmoidestoken@mail.com", "secret", "secret", null, null, null, "secret"); | ||||
|         User malveillant = new User("Cargo", "John", "CargoJ@mail.com", "secret", "secret", null, null, null, "secret"); | ||||
|         userRepository.save(malveillant); | ||||
|  | ||||
|         for (int i = 0; i < 20; i++){ | ||||
|  | ||||
							
								
								
									
										24
									
								
								frontend/src/Apps/AboutStudent.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								frontend/src/Apps/AboutStudent.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,24 @@ | ||||
| <script setup> | ||||
| </script> | ||||
|  | ||||
| <template> | ||||
|   <div class="aboutbox"> | ||||
|     <h1 class="test">Coucou</h1> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <style scoped> | ||||
| .aboutbox { | ||||
|   background-color: rgb(24,24,24); | ||||
|   width: 400px; | ||||
|   display:flex; | ||||
|   justify-content: center; | ||||
|   padding: 40px; | ||||
|   border-radius: 20px; | ||||
|   box-shadow:0 5px 25px #000000; | ||||
| } | ||||
|  | ||||
| .test{ | ||||
|   color: red; | ||||
| } | ||||
| </style> | ||||
		Reference in New Issue
	
	Block a user