Compare commits
No commits in common. "6dcff347245d6aa40d2e2fc6b48575c2ca24a41e" and "2b0aa0563036c4d65d856fdf7287e941a15ebffa" have entirely different histories.
6dcff34724
...
2b0aa05630
@ -1427,31 +1427,15 @@ public class EstimateService {
|
||||
|
||||
// 각도 매핑 함수 호출
|
||||
String mappedDegree = excelUtil.mapCompassDegree(degreeValue);
|
||||
// String compasDegImgUrl = frontUrl + "/static/images/canvas/deg/" + mappedDegree + ".png";
|
||||
String compasDegImgUrl = frontUrl + "/static/images/canvas/deg/" + mappedDegree + ".png";
|
||||
|
||||
// URL url = new URL(compasDegImgUrl);
|
||||
// URLConnection con = url.openConnection();
|
||||
// HttpURLConnection exitCode = (HttpURLConnection)con;
|
||||
// if (exitCode.getResponseCode() == 200) {
|
||||
// InputStream imageInputStream = new URL(compasDegImgUrl).openStream();
|
||||
// byte[] degImg = Util.toByteArray(imageInputStream);
|
||||
// roofInfoResponse.setCompasDegImg(degImg);
|
||||
// }
|
||||
|
||||
try {
|
||||
// classpath에서 리소스 파일을 읽어옵니다
|
||||
String imagePath = "/img/compass/" + mappedDegree + ".png";
|
||||
InputStream imageInputStream = getClass().getResourceAsStream(imagePath);
|
||||
|
||||
if (imageInputStream != null) {
|
||||
URL url = new URL(compasDegImgUrl);
|
||||
URLConnection con = url.openConnection();
|
||||
HttpURLConnection exitCode = (HttpURLConnection)con;
|
||||
if (exitCode.getResponseCode() == 200) {
|
||||
InputStream imageInputStream = new URL(compasDegImgUrl).openStream();
|
||||
byte[] degImg = Util.toByteArray(imageInputStream);
|
||||
roofInfoResponse.setCompasDegImg(degImg);
|
||||
imageInputStream.close();
|
||||
} else {
|
||||
log.warn("Compass image not found: {}", imagePath);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error("Error reading compass image: {}", e.getMessage(), e);
|
||||
}
|
||||
|
||||
roofInfoResponse.setCompasDeg(compasDeg);
|
||||
|
||||
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |