produces

Solutions on MaxInterview for produces by the best coders in the world

showing results for - "produces"
Daphné
22 Sep 2017
1@RequestMapping(value = "api/images")
2public class ImageController {
3
4    @Autowired
5    public ImageService imageService;
6    @PostMapping(value ="upload")
7    public ResponseEntity uploadImage(@RequestParam MultipartFile     file){
8        return this.imageService.uploadToLocalFileSystem(file);
9    }
10    @GetMapping(
11            value = "getImage/{imageName:.+}",
12            produces = {MediaType.IMAGE_JPEG_VALUE,MediaType.IMAGE_GIF_VALUE,MediaType.IMAGE_PNG_VALUE}
13    )
14    public @ResponseBody byte[] getImageWithMediaType(@PathVariable(name = "imageName") String fileName) throws IOException {
15        return this.imageService.getImageWithMediaType(fileName);
16    }
17}
18
similar questions
queries leading to this page
produces