[retour au README.md](../../../README.md) [Retour aux Documents](../../README_DOCUMENTS.md) ## Diagramme de classe - Ajout d'amis ```plantuml class User { + name : string } User "1" --> "*" User: friends User "1" --> "*" Notification: notifications User "1" --> "*" Ask: friendRequests class Notification { - text : string } interface INotifier { + notify() : void } INotifier --|> Observer abstract class UserManager { - currentUser : User + deleteFriend(userId : int) : void + addFriend(userId : int) : void + respondToFriendRequest(requestId : int, choice : bool) : void + getFriends(userId : int) : User[] } class Ask { - fromUser : int - toUser : int } Ask --|> Subject abstract class Subject { + attach(o : Observer) : void + detach(o : Observer) : void + notify() : void } Subject "1" --> "*" Observer interface Observer { + update() : void } UserManager ..> User UserManager o-- IUserRepository UserManager o-- INotifier interface IUserRepository { + findByUsername(username : string) : User + addUser(user : User) : bool } IUserRepository ..> User ``` ## Diagrammes de séquence - Envoi de demande d'ami : ```plantuml actor User as u boundary View as v control Controller as c entity Model as m u->v:/Friend v->c:Get : /Friends c->m:getFriends(userId) m-->c::friends : User[] c-->v:renderView(Friends) v-->u: u->v:input : name v->c:Get : searchFriends? pseudo=name c->m:searchUser(name:string) m->m:notify(from : user, to : user, action : action) m-->c:OK c-->v:OK v-->u:OK ``` - Accepter une demande d'ami : ```plantuml actor User as u boundary View as v control Controller as c entity Model as m m->c:RecevoirDemandeAmi(idUser) c->v:AfficherDemandeAmi(idUser) v->u:PageDemandeAmi(idUser) u-->v:RepondreDemandeAmi(bool) v-->c:EnregistrerReponse(bool) c-->m:EnvoyerReponse(bool) ``` - Supprimer un ami : ```plantuml actor User as u boundary View as v control Controller as c entity Model as m u->v: Request Friends Page v->c: Get /Friends c->m: getFriends(userId) alt successful retrieval m-->c: friendsList: User[] else retrieval failed m-->c: error end c-->v: renderView(friendsList) v-->u: Display Friends u->v: clickDeleteFriend(idUser) v->c: Post: deleteFriend(idUser) c->m: deleteFriend(idUser) alt successful deletion m-->c: updatedFriendsList: User[] else deletion failed m-->c: error end c-->v: renderView(updatedFriendsList) v-->u: Display Updated Friends ``` ## Diagrammes de cas d'utilisation - Gestion du compte et des amitiés ```plantuml left to right direction :Athlete: as a a --> (Ajouter un ami) a --> (Supprimer un ami) a --> (Voir mes amis) a --> (Modifier mes informations) (Ajouter un ami)->(Saisir le nom de l'ami) (Supprimer un ami)..>(S'authentifier) : <> (Ajouter un ami)..>(S'authentifier) : <> (Voir mes amis)..>(S'authentifier) : <> (Voir mes amis)..>(Lister les amis) : <> (Modifier mes informations)..>(Informations personnelles) : <> (Modifier mes informations)..>(Informations de connexion) : <> (Lister les amis)..>(Voir son profil) : <> (Voir son profil)..>(Voir ses activités) : <> (Voir son profil)..>(Voir ses statistiques) : <> (S'authentifier)..>(S'inscrire) : <> (S'authentifier)..>(Se connecter) : <> (S'inscrire)..>(Inscription Athlète) : <> ```