GithubHelp home page GithubHelp logo

mdd050's Introduction

mdd050's People

Contributors

fabricerenecorail avatar

Watchers

 avatar

mdd050's Issues

Correction

En cours d'acquisition. Du travail fourni mais de trop nombreuses erreurs et une gestion d'erreur quasi inexistante. A approfondir !

Ton package controller n'est pas au bon endroit puisque tu l'as mis à la racine au lieu de le mettre dans com.ipiecoles.java.eval.mdd050. Tes contrôleurs ne sont donc pas scannés par Spring, ce qui les empêche de marcher (comment as-tu pu tester l'application ?).

id ne peut pas être null sinon on ne rentre pas dans ce mapping. Si jamais il pouvait l'être ce serait une 400 qui devrait être renvoyée. La 404 doit être renvoyée si l'id est renseigné mais qu'il n'existe pas en base (ce que tu ne testes pas)

if(id==null) {
ResponseEntity.notFound().build();

Idem pour ça
if(name==null) {
ResponseEntity.notFound().build();

Idem ici (+non gestion de la 404)
if (id == null) {
return ResponseEntity.badRequest().body("Cannot remove character with null ID");

Les conventions REST ne sont pas respectées => /artists?name=

L'erreur 409 (conflit) n'est pas gérée

artist = artisteService.save(artist);

La 404 n'est pas gérée

return artisteService.save(id);

Tu castes AlbumService en AlbumService ?? 409 non gérée

album = ((AlbumService) albumService).save(album);

Le save de l'album appelé dans le service appelle cette méthode qui ne fait rien

public Album save(Album album) {
// TODO Auto-generated method stub
return null;
}

404 non gérée dans la suppression d'un album

400 non gérée lorsque les paramètres d'entrée sont incorrects

Sort sort = Sort.by(Sort.Direction.fromString(sortDirection),sortProperty);

Ca c'est bien, le seul problème, c'est que tu n'as pas de GlobalExceptionHandler pour gérer l'EntityNotFoundException. Le code HTTP généré sera donc 500 et non 404.

public Artist findById(Long id) {
Optional<Artist> artist = this.artistRepository.findById(id);
if(!artist.isPresent()){
throw new EntityNotFoundException("Impossible de trouver l'artiste d'identifiant " + id);
}
return artist.get();
}

Ta suppression d'artiste ne supprime pas les albums liés, elle ne fonctionnera que si l'artiste n'a pas d'album sinon elle plantera en erreur 500

??

public Artist save(Artist artist) {
// TODO Auto-generated method stub
return null;
}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.