use of com.furyviewer.domain.enumeration.ArtistTypeEnum in project FuryViewer by TheDoctor-95.
the class ArtistResource method findArtistByArtistType.
@GetMapping("/artist-types-name/{artistTypeStr}")
@Timed
public ResponseEntity<List<Artist>> findArtistByArtistType(@PathVariable String artistTypeStr) {
log.debug("REST request to get ArtistType : {}", artistTypeStr);
try {
ArtistTypeEnum ate = ArtistTypeEnum.valueOf(artistTypeStr.toUpperCase());
ArtistType artistType = artistTypeRepository.findByName(ate);
List<Artist> artists = artistRepository.findArtistByArtistType(artistType);
return ResponseUtil.wrapOrNotFound(Optional.ofNullable(artists));
} catch (IllegalArgumentException e) {
throw new BadRequestAlertException(e.getMessage(), ENTITY_NAME, e.getLocalizedMessage());
}
}
Aggregations