package Ġfr . z ak ao ai . cold library backend . test Package . controller Ċ Ċ import Ġfr . z ak ao ai . cold library backend . anime . DTO . An ime DTO Ċ import Ġfr . z ak ao ai . cold library backend . anime . repository . An ime Repository Ċ import Ġorg . springframework . http . HttpStatus Ċ import Ġorg . springframework . http . MediaType Ċ import Ġorg . springframework . web . bind . annotation .* Ċ Ċ @ RestController Ċ @ RequestMapping ( path Ġ= Ġ["/ anime Repo "], Ġproduces Ġ= Ġ[ MediaType . APPLICATION _ JSON _ VALUE ]) Ċ class ĠAn ime Repository Controller ( private Ġval Ġrepo : ĠAn ime Repository ) Ġ{ ĊĊĠĠĠ Ġ@ GetMapping ĊĠĠĠ Ġfun ĠgetAll () Ġ= Ġrepo . findAll () ĊĊĠĠĠ Ġ@ GetMapping ("/ { mal Id }") ĊĠĠĠ Ġfun ĠgetBy LastName (@ PathVariable Ġmal Id : ĠInt ) Ġ= Ġrepo . findBy Mal Id ( mal Id ) ĊĊĠĠĠ Ġ@ PostMapping ĊĠĠĠ Ġ@ ResponseStatus ( HttpStatus . CREATED ) ĊĠĠĠ Ġfun Ġsave (@ RequestBody Ġemployee : ĠAn ime DTO ) Ġ= Ġrepo . save ( employee . to Model ()) ĊĊĠĠĠ Ġ@ Delete Mapping ("/ { id }") ĊĠĠĠ Ġ@ ResponseStatus ( HttpStatus . NO _ CONTENT ) ĊĠĠĠ Ġfun Ġdelete (@ PathVariable Ġid : ĠLong ) Ġ= Ġrepo . delete ById ( id ) Ċ Ċ }