Skip to content

Commit

Permalink
[fix] image 반환 contetn-type 변경 #36
Browse files Browse the repository at this point in the history
[fix] image 반환 contetn-type 변경
  • Loading branch information
yangchef1 authored May 14, 2024
2 parents e2e901f + f3f7b98 commit d8cc681
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,21 @@

import com.sanbosillok.sanbosillokserver.api.image.service.ImageService;
import lombok.RequiredArgsConstructor;
import org.apache.tomcat.util.http.fileupload.IOUtils;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

@RestController
@RequiredArgsConstructor
public class ImageController {

private final ImageService imageService;

@GetMapping("/image/{fileName}")
@GetMapping(value = "/image/{fileName}", produces = MediaType.IMAGE_JPEG_VALUE)
public byte[] getImage(@PathVariable String fileName){
return imageService.getImage(fileName);
}
Expand Down

0 comments on commit d8cc681

Please sign in to comment.