Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
eadl:bloc3:dev_av:td1 [2025/09/16 15:52] – créée jcheron | eadl:bloc3:dev_av:td1 [2025/09/16 20:22] (Version actuelle) – [Spécifications] jcheron | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ====== | + | ====== 1 - Initialisation et structuration de projet |
- | Initialisation et structuration de projet | + | Séance 1 (4h) |
+ | ===== API E-commerce - Architecture ===== | ||
+ | |||
+ | <WRAP round bloc info> | ||
+ | **IA : avec modération** | ||
+ | * Générative : uniquement pour correction/ | ||
+ | * Assistant de codage, type copilot : avec contrôle des productions | ||
+ | |||
+ | </ | ||
+ | |||
+ | ==== Stack technique ==== | ||
+ | * Spring Boot 3+ | ||
+ | * Base de données : H2 (fichier) | ||
+ | * JPA (Hibernate) | ||
+ | * Build : Maven | ||
+ | * Tests : JUnit 5 | ||
+ | * GitHub classRoom | ||
+ | |||
+ | ==== Spécifications ==== | ||
+ | Mise en place d'une API REST pour la gestion des utilisateurs, | ||
+ | |||
+ | === End points === | ||
+ | |||
+ | == Users == | ||
+ | |||
+ | < | ||
+ | POST /users - Créer un utilisateur | ||
+ | GET /users/{id} - Récupérer un utilisateur | ||
+ | GET / | ||
+ | </ | ||
+ | |||
+ | == Products == | ||
+ | |||
+ | < | ||
+ | POST /products - Créer un produit | ||
+ | GET / | ||
+ | PUT / | ||
+ | GET /products - Lister les produits (avec filtres optionnels) | ||
+ | </ | ||
+ | |||
+ | == Orders == | ||
+ | |||
+ | < | ||
+ | POST /orders - Créer une commande | ||
+ | GET / | ||
+ | GET / | ||
+ | </ | ||
+ | |||
+ | |||
+ | === Modèle de données === | ||
+ | < | ||
+ | <uml> | ||
+ | @startuml | ||
+ | |||
+ | package " | ||
+ | class User { | ||
+ | - UUID id | ||
+ | - String name | ||
+ | - String email | ||
+ | } | ||
+ | |||
+ | class Product { | ||
+ | - UUID id | ||
+ | - String name | ||
+ | - BigDecimal price | ||
+ | - Integer stock | ||
+ | } | ||
+ | |||
+ | class Category { | ||
+ | - UUID id | ||
+ | - String name | ||
+ | - String description | ||
+ | } | ||
+ | |||
+ | class Order { | ||
+ | - UUID id | ||
+ | - BigDecimal totalAmount | ||
+ | - OrderStatus status | ||
+ | - LocalDateTime createdAt | ||
+ | } | ||
+ | |||
+ | class OrderItem { | ||
+ | - UUID id | ||
+ | - Integer quantity | ||
+ | - BigDecimal unitPrice | ||
+ | } | ||
+ | |||
+ | enum OrderStatus { | ||
+ | PENDING | ||
+ | CONFIRMED | ||
+ | SHIPPED | ||
+ | DELIVERED | ||
+ | CANCELLED | ||
+ | } | ||
+ | } | ||
+ | |||
+ | ' Relations avec cardinalités | ||
+ | Order " | ||
+ | Order " | ||
+ | OrderItem " | ||
+ | User " | ||
+ | Product " | ||
+ | |||
+ | @enduml | ||
+ | </ | ||
+ | < | ||
+ | |||
+ | === Données exemple === | ||
+ | |||
+ | == User == | ||
+ | <sxh json; | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | == Product == | ||
+ | |||
+ | <sxh json; | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | == Order == | ||
+ | |||
+ | <sxh json; | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | == Order item == | ||
+ | |||
+ | <sxh json; | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | == Category == | ||
+ | |||
+ | <sxh json; | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | === Attendus === | ||
+ | == Architecture == | ||
+ | |||
+ | * Séparation couche métier/ | ||
+ | * Controllers (API REST) | ||
+ | * Services (logique métier) | ||
+ | * Repositories (accès données) | ||
+ | * DTOs pour les échanges API | ||
+ | * Entities pour le domaine métier | ||
+ | |||
+ | == Tests == | ||
+ | |||
+ | * Tests unitaires sur les services principaux | ||
+ | * Tests d' | ||
+ | |||
+ | == CI/CD == | ||
+ | |||
+ | * GitHub Actions : exécution tests sur push/PR | ||
+ | * Pas de déploiement (tests uniquement) | ||
+ | |||
+ | |||
+ | <WRAP round bloc todo> | ||
+ | == Priorités (4h) == | ||
+ | |||
+ | * Entities : User, Product, Category | ||
+ | * CRUD Product + tests unitaires/ | ||
+ | * Pipeline CI/CD fonctionnel | ||
+ | |||
+ | </ | ||
+ | |||
+ | <WRAP round bloc info> | ||
+ | * Privilégier la qualité | ||
+ | * Toutes les bonnes initiatives sont les bienvenues | ||
+ | </ |