From 25009ba149938c74594d53088e7c52ea5ad0fd16 Mon Sep 17 00:00:00 2001 From: Bartha Maxime <231026@umons.ac.be> Date: Sat, 16 Mar 2024 00:34:20 +0100 Subject: [PATCH] Enum in CamelCase --- .../Clyde/EndPoints/ApplicationsController.java | 14 +++++++------- .../ovh/herisson/Clyde/Tables/Applications.java | 17 +++++++---------- .../ovh/herisson/Clyde/Tables/CursusType.java | 6 +++--- .../ovh/herisson/Clyde/Tables/RequestState.java | 2 +- .../java/ovh/herisson/Clyde/Tables/Role.java | 4 ++-- 5 files changed, 20 insertions(+), 23 deletions(-) diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/ApplicationsController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/ApplicationsController.java index d044bf7..9bd32c1 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/ApplicationsController.java +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/ApplicationsController.java @@ -44,17 +44,17 @@ public class ApplicationsController { Role posterRole = authServ.getUserFromToken(token).getRole(); ArrayList authorizedApps = new ArrayList<>(); - authorizedApps.add(Applications.LOGIN); - authorizedApps.add(Applications.PROFILE); - authorizedApps.add(Applications.MSG); - authorizedApps.add(Applications.FORUM); - authorizedApps.add(Applications.RDV); + authorizedApps.add(Applications.Login); + authorizedApps.add(Applications.Profile); + authorizedApps.add(Applications.Msg); + authorizedApps.add(Applications.Forum); + authorizedApps.add(Applications.Rdv); if (posterRole == Role.Student || posterRole == Role.Admin) return authorizedApps; - if (posterRole == Role.Teacher || posterRole == Role.Secretary || posterRole == Role.Admin) authorizedApps.add(Applications.MANAGECOURSES); + if (posterRole == Role.Teacher || posterRole == Role.Secretary || posterRole == Role.Admin) authorizedApps.add(Applications.ManageCourses); - if (posterRole == Role.InscriptionService || posterRole == Role.Admin) authorizedApps.add(Applications.INSCRIPTION); + if (posterRole == Role.InscriptionService || posterRole == Role.Admin) authorizedApps.add(Applications.Inscription); return authorizedApps; } diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/Applications.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/Applications.java index 445a928..6ad6567 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Tables/Applications.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/Applications.java @@ -2,23 +2,20 @@ package ovh.herisson.Clyde.Tables; public enum Applications { // without any token - LOGIN, + Login, // with any token - PROFILE, + Profile, // Students and higher authorization - MSG, - FORUM, - RDV, + Msg, + Forum, + Rdv, // teachers and Secretary authorization - MANAGECOURSES, + ManageCourses, // InscriptionService authorization - INSCRIPTION; - - - + Inscription } diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/CursusType.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/CursusType.java index 5e9c50f..d99d47e 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Tables/CursusType.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/CursusType.java @@ -2,7 +2,7 @@ package ovh.herisson.Clyde.Tables; public enum CursusType { - infoBab1, - chemistryBab1, - psychologyBab1; + InfoBab1, + ChemistryBab1, + PsychologyBab1 } diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/RequestState.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/RequestState.java index f0345c1..d52f1c9 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Tables/RequestState.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/RequestState.java @@ -3,5 +3,5 @@ package ovh.herisson.Clyde.Tables; public enum RequestState { Accepted, Refused, - Pending; + Pending } diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/Role.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/Role.java index 4e4469b..f6f8967 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Tables/Role.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/Role.java @@ -5,5 +5,5 @@ public enum Role { Student, Admin, InscriptionService, - Secretary; -} + Secretary +} \ No newline at end of file