# Endpoints Backend à Créer - AfterWork ## 📋 Vue d'ensemble Ce document liste tous les endpoints backend manquants nécessaires pour une application complète et professionnelle. --- ## 🔔 1. Notifications (`/notifications`) ### Entité à créer - `com.lions.dev.entity.notification.Notification.java` ### Endpoints à créer - `GET /notifications/user/{userId}` - Récupérer les notifications d'un utilisateur - `PUT /notifications/{id}/read` - Marquer une notification comme lue - `PUT /notifications/user/{userId}/mark-all-read` - Marquer toutes comme lues - `DELETE /notifications/{id}` - Supprimer une notification - `POST /notifications` - Créer une notification ### Resource à créer - `com.lions.dev.resource.NotificationResource.java` ### Service à créer - `com.lions.dev.service.NotificationService.java` ### Repository à créer - `com.lions.dev.repository.NotificationRepository.java` --- ## 📱 2. Posts Sociaux (`/posts`) ### Entité à créer - `com.lions.dev.entity.social.SocialPost.java` ### Endpoints à créer - `GET /posts` - Récupérer tous les posts (avec pagination) - `POST /posts` - Créer un post - `GET /posts/{id}` - Récupérer un post par ID - `PUT /posts/{id}` - Mettre à jour un post - `DELETE /posts/{id}` - Supprimer un post - `GET /posts/search?q={query}` - Rechercher des posts - `POST /posts/{id}/like` - Liker un post - `POST /posts/{id}/comment` - Commenter un post - `POST /posts/{id}/share` - Partager un post ### Resource à créer - `com.lions.dev.resource.SocialPostResource.java` ### Service à créer - `com.lions.dev.service.SocialPostService.java` ### Repository à créer - `com.lions.dev.repository.SocialPostRepository.java` --- ## 📝 Structure des Entités ### Notification ```java @Entity @Table(name = "notifications") public class Notification extends BaseEntity { private String title; private String message; private String type; // event, friend, reminder, other private boolean isRead; private UUID userId; private UUID eventId; // optionnel private Map metadata; // optionnel } ``` ### SocialPost ```java @Entity @Table(name = "social_posts") public class SocialPost extends BaseEntity { private String content; private UUID userId; private String imageUrl; // optionnel private int likesCount; private int commentsCount; private int sharesCount; @ManyToOne private Users user; } ``` --- ## 🚀 Ordre d'Implémentation Recommandé 1. **Notifications** (plus simple, moins de dépendances) 2. **Posts Sociaux** (plus complexe, nécessite interactions) --- ## ✅ Checklist - [ ] Créer entité Notification - [ ] Créer NotificationRepository - [ ] Créer NotificationService - [ ] Créer NotificationResource - [ ] Créer entité SocialPost - [ ] Créer SocialPostRepository - [ ] Créer SocialPostService - [ ] Créer SocialPostResource - [ ] Créer les DTOs correspondants - [ ] Tester tous les endpoints - [ ] Documenter l'API (OpenAPI)