Search in sources :

Example 1 with SeckillResponseDTO

use of com.goodskill.api.dto.SeckillResponseDTO in project goodsKill by techa03.

the class SeckillController method showQRcode.

/**
 * 显示二维码
 *
 * @param filename
 * @param response
 * @throws IOException
 */
@GetMapping(value = "/Qrcode/{QRfilePath}")
@Deprecated
public void showQRcode(@PathVariable("QRfilePath") String filename, HttpServletResponse response) throws IOException {
    response.setContentType("img/*");
    SeckillResponseDTO responseDto = seckillService.getQrcode(filename);
    try (OutputStream os = response.getOutputStream()) {
        os.write(responseDto.getData());
    } catch (FileNotFoundException e) {
        logger.error("the error is :", e);
    }
}
Also used : OutputStream(java.io.OutputStream) SeckillResponseDTO(com.goodskill.api.dto.SeckillResponseDTO) FileNotFoundException(java.io.FileNotFoundException)

Aggregations

SeckillResponseDTO (com.goodskill.api.dto.SeckillResponseDTO)1 FileNotFoundException (java.io.FileNotFoundException)1 OutputStream (java.io.OutputStream)1