|
|
|
@@ -14,6 +14,13 @@ import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import javax.servlet.ServletOutputStream; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.io.ByteArrayOutputStream; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.nio.charset.Charset; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
@Api(description = "数据塔台") |
|
|
|
@@ -119,12 +126,31 @@ public class DataTowerController extends BaseController { |
|
|
|
@ApiOperation("调取图片") |
|
|
|
@GetMapping("/getWiWidePic") |
|
|
|
@SystemControllerLog(description = "数据塔台-获取图片") |
|
|
|
public byte[] getWiWidePic(String type,String id) { |
|
|
|
public byte[] getWiWidePic(String type, String id, HttpServletRequest request, HttpServletResponse response) { |
|
|
|
logger.debug("[" + getIpAddr() + "] DataTowerController::getWiWidePic"); |
|
|
|
if(StringUtils.isBlank(type) || StringUtils.isBlank(id)){ |
|
|
|
return null; |
|
|
|
byte[] wiWidePic = null; |
|
|
|
if(StringUtils.isNotBlank(type) || StringUtils.isNotBlank(id)){ |
|
|
|
wiWidePic = dataTowerService.getWiWidePic(getTenantInfo(), type, id); |
|
|
|
} |
|
|
|
return dataTowerService.getWiWidePic(getTenantInfo(),type,id); |
|
|
|
if(wiWidePic == null){ |
|
|
|
wiWidePic = new byte[1024]; |
|
|
|
} |
|
|
|
|
|
|
|
return wiWidePic; |
|
|
|
|
|
|
|
// try { |
|
|
|
// ServletOutputStream sos = response.getOutputStream(); |
|
|
|
// sos.write(wiWidePic, 0, wiWidePic.length); |
|
|
|
// sos.close(); |
|
|
|
// |
|
|
|
// response.setHeader("Pragma", "no-cache"); |
|
|
|
// response.setHeader("Cache-Control", "no-cache"); |
|
|
|
// response.setDateHeader("Expires", 0); |
|
|
|
// response.setContentType("image/jpeg, image/jpg, image/png, image/gif"); |
|
|
|
// } catch (IOException e) { |
|
|
|
// e.printStackTrace(); |
|
|
|
// } |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |