From 23a46b4be35277e06ec89f48730eeb694e686be8 Mon Sep 17 00:00:00 2001
From: Kenmegne <stephanie.kenmegne@gmail.com>
Date: Thu, 18 Jun 2026 15:40:06 +0000
Subject: [PATCH] add fdx-commons and fdx-consultation
---
fdx-consultation/fdxconsultation-service-ifaces/src/main/java/com/megatim/fdxconsultation/service/ifaces/authentication/AuthenticationRS.java | 110 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 110 insertions(+), 0 deletions(-)
diff --git a/fdx-consultation/fdxconsultation-service-ifaces/src/main/java/com/megatim/fdxconsultation/service/ifaces/authentication/AuthenticationRS.java b/fdx-consultation/fdxconsultation-service-ifaces/src/main/java/com/megatim/fdxconsultation/service/ifaces/authentication/AuthenticationRS.java
new file mode 100644
index 0000000..54bc64e
--- /dev/null
+++ b/fdx-consultation/fdxconsultation-service-ifaces/src/main/java/com/megatim/fdxconsultation/service/ifaces/authentication/AuthenticationRS.java
@@ -0,0 +1,110 @@
+package com.megatim.fdxconsultation.service.ifaces.authentication;
+
+import com.megatim.fdxcommons.core.ifaces.interceptor.LoggingInterceptorBinding;
+import com.megatim.fdxconsultation.model.administration.User;
+import com.megatim.fdxconsultation.model.authentification.LoginRequest;
+import com.mgt.rs.security.core.common.Secured;
+import com.mgt.rs.security.core.common.SecuredAdmin;
+import com.mgt.rs.security.core.common.SecuredMegaAdmin;
+import com.mgt.rs.security.core.common.SecuredSuperAdmin;
+import javax.annotation.security.PermitAll;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+/**
+ *
+ * @author lenovo
+ */
+public interface AuthenticationRS {
+
+ /**
+ * Validate user credentials and issue a token for the user.
+ *
+ * @param loginRequest
+ * @return
+ */
+ @POST
+ @Consumes({MediaType.APPLICATION_JSON})
+ @Produces({MediaType.APPLICATION_JSON})
+ @PermitAll
+ @Path("login")
+ @LoggingInterceptorBinding(message = "Connexion de l'utilisateur [0.userName]")
+ public Response authenticate(LoginRequest loginRequest);
+
+ /**
+ * Permet de recuperer les informations de l'utilisateur.
+ *
+ * @param headers
+ * @param username
+ * @return
+ */
+ @GET
+ @Consumes({MediaType.APPLICATION_JSON})
+ @Produces({MediaType.APPLICATION_JSON})
+ @SecuredAdmin
+ @SecuredSuperAdmin
+ @SecuredMegaAdmin
+ @Path("info")
+ @Secured(action = "*")
+ public Response getInfoUser(@Context HttpHeaders headers);
+
+ /**
+ * Permet de savoir si un utilisateur avec le même username existe dejà
+ *
+ * @param headers
+ * @param username
+ * @return
+ */
+ @GET
+ @Consumes({MediaType.APPLICATION_JSON})
+ @Produces({MediaType.APPLICATION_JSON})
+ @Path("checkusername/{username}")
+ @Secured(action = "*")
+ @SecuredAdmin
+ @SecuredSuperAdmin
+ @SecuredMegaAdmin
+ public Response ifUserNameExist(@Context HttpHeaders headers, @PathParam("username") String username);
+
+ /**
+ * Permet de déconnecter l'utilisateur.
+ *
+ * @param headers
+ * @param entity
+ * @return
+ */
+ @POST
+ @Consumes({MediaType.APPLICATION_JSON})
+ @Produces({MediaType.APPLICATION_JSON})
+ @SecuredAdmin
+ @SecuredSuperAdmin
+ @SecuredMegaAdmin
+ @Path("logout")
+ @Secured(action = "*")
+ @LoggingInterceptorBinding(message = "Déconnexion de l'utilisateur [1.userName]")
+ public Response logout(@Context HttpHeaders headers, User entity);
+
+ /**
+ * Permet de générer les données de test
+ *
+ * @param headers
+ * @return
+ */
+ @POST
+ @Consumes({MediaType.APPLICATION_JSON})
+ @Produces({MediaType.APPLICATION_JSON})
+ @SecuredAdmin
+ @SecuredSuperAdmin
+ @SecuredMegaAdmin
+ @Path("test")
+ @Secured(action="*")
+ public Response generateDataTotTest(@Context HttpHeaders headers);
+
+}
--
Gitblit v1.10.0