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-impl/src/main/java/com/megatim/fdxconsultation/service/impl/chat/UserChatListRSImpl.java | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 49 insertions(+), 0 deletions(-)
diff --git a/fdx-consultation/fdxconsultation-service-impl/src/main/java/com/megatim/fdxconsultation/service/impl/chat/UserChatListRSImpl.java b/fdx-consultation/fdxconsultation-service-impl/src/main/java/com/megatim/fdxconsultation/service/impl/chat/UserChatListRSImpl.java
new file mode 100644
index 0000000..ca91504
--- /dev/null
+++ b/fdx-consultation/fdxconsultation-service-impl/src/main/java/com/megatim/fdxconsultation/service/impl/chat/UserChatListRSImpl.java
@@ -0,0 +1,49 @@
+package com.megatim.fdxconsultation.service.impl.chat;
+
+import com.megatim.fdxconsultation.core.ifaces.administration.UserManager;
+import com.megatim.fdxconsultation.model.administration.User;
+import com.megatim.fdxconsultation.model.searchentities.UserSearch;
+import com.megatim.fdxconsultation.service.ifaces.chat.UserChatListRS;
+import com.megatim.fdxconsultation.tools.context.AppCommonContext;
+import com.mgt.rs.security.core.common.AuthenticatedUser;
+import com.mgt.rs.security.core.common.SecuredClass;
+import java.util.stream.Collectors;
+import javax.enterprise.event.Observes;
+import javax.inject.Inject;
+import javax.ws.rs.Path;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.Response;
+
+/**
+ *
+ * @author Gabuntu
+ */
+@SecuredClass(module = AppCommonContext.MODULE_ADMINISTRATION, path = "Utilisateurs pour le chat", description = "Utilisateurs pour le chat")
+@Path("user-chat-list")
+public class UserChatListRSImpl implements UserChatListRS {
+
+ @Inject
+ private UserManager manager;
+
+ @AuthenticatedUser
+ private User utilisateurConnecte;
+
+ public void handleAuthenticationEvent(@Observes @AuthenticatedUser String username) {
+ utilisateurConnecte = manager.recuperUtilisateur(username);
+ }
+
+ @Override
+ public Response findAll(HttpHeaders headers, UserSearch searchEntity) {
+ return Response.ok(
+ manager.getAll(searchEntity, utilisateurConnecte)
+ .stream()
+ .collect(Collectors.toList())
+ ).build();
+ }
+
+ @Override
+ public Long count(HttpHeaders headers, UserSearch searchEntity) {
+ return manager.size(searchEntity);
+ }
+
+}
--
Gitblit v1.10.0