Implémentation complète de toutes les fonctionnalités backend : ## Nouvelles Fonctionnalités ### Chat (Messagerie Instantanée) - Entities : Conversation, Message - DTOs : ConversationResponseDTO, MessageResponseDTO, SendMessageRequestDTO - Resources : MessageResource (endpoints REST) - Services : MessageService (logique métier) - Repositories : ConversationRepository, MessageRepository - WebSocket : ChatWebSocket (temps réel) ### Social (Publications Sociales) - Entities : SocialPost, SocialComment, SocialLike - DTOs : SocialPostResponseDTO, CreateSocialPostRequestDTO - Resources : SocialPostResource - Services : SocialPostService - Repositories : SocialPostRepository ### Story (Stories temporaires) - Entities : Story, StoryView - DTOs : StoryResponseDTO, CreateStoryRequestDTO - Resources : StoryResource - Services : StoryService - Repositories : StoryRepository ### Notifications (Temps Réel) - Entities : Notification - DTOs : NotificationResponseDTO - Resources : NotificationResource - Services : NotificationService, PresenceService - Repositories : NotificationRepository - WebSocket : NotificationWebSocket (temps réel) ## Améliorations ### Users & Friendship - Mise à jour UserResponseDTO avec nouveaux champs - Amélioration FriendshipResource avec séparation demandes envoyées/reçues - FriendSuggestionResponseDTO pour suggestions d'amis - Optimisations dans UsersService et FriendshipService ### Events - Améliorations EventsResource et EventService - Optimisations EventsRepository ### Configuration - Mise à jour application.properties - Configuration docker-compose.yml - Dockerfile pour développement ## Fichiers Modifiés - .dockerignore, .gitignore - README.md - docker-compose.yml - Configuration Maven wrapper
116 lines
3.0 KiB
Markdown
116 lines
3.0 KiB
Markdown
# 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<String, Object> 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)
|
|
|