5 Commits

Author SHA1 Message Date
ad0e7b3e35 - Ajoute un champ year dans UserCurriculum pour différencier les anciers cursus de l'actuel pour l'étudiant
- Ajoute la table ExemptionsRequest
- Ajoute la table ScholarshipRequest
- Ajoute la table UninscriptionRequest
2024-03-23 14:08:03 +01:00
3d6941ab93 adding cdn to CI
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m57s
Build and test FrontEnd / Build-frontend (push) Successful in 23s
deploy to production / deploy-frontend (push) Successful in 27s
deploy to production / deploy-backend (push) Successful in 1m29s
2024-03-18 21:39:31 +01:00
de72bd800c CI fix
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m53s
deploy to production / deploy-frontend (push) Successful in 26s
deploy to production / deploy-backend (push) Successful in 2m3s
Build and test FrontEnd / Build-frontend (push) Successful in 23s
2024-03-18 21:13:00 +01:00
b465dcfa92 Merge pull request 'Clean le projet' (#146) from Leo/Backend/Cleaning into master
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m55s
deploy to production / deploy-frontend (push) Successful in 26s
deploy to production / deploy-backend (push) Failing after 2m51s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
Reviewed-on: #146
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
2024-03-18 21:06:02 +01:00
73f3df0bc6 Clean le projet
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m46s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-18 20:54:16 +01:00
11 changed files with 202 additions and 13 deletions

View File

@ -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

View File

@ -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"]

View File

@ -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);

View File

@ -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);

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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());

View File

@ -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++){

View 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>