[1219] 견적서 엑셀에 방위각도 추가 - 이미지 경로 변경
@ -1427,15 +1427,31 @@ 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);
|
||||
// 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) {
|
||||
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);
|
||||
|
||||
BIN
src/main/resources/img/compass/-105.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
src/main/resources/img/compass/-120.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
src/main/resources/img/compass/-135.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
src/main/resources/img/compass/-15.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
src/main/resources/img/compass/-150.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
src/main/resources/img/compass/-165.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
src/main/resources/img/compass/-30.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
src/main/resources/img/compass/-45.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
src/main/resources/img/compass/-60.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
src/main/resources/img/compass/-75.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
src/main/resources/img/compass/-90.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
src/main/resources/img/compass/0.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
src/main/resources/img/compass/105.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
src/main/resources/img/compass/120.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
src/main/resources/img/compass/135.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
src/main/resources/img/compass/15.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
src/main/resources/img/compass/150.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
src/main/resources/img/compass/165.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
src/main/resources/img/compass/180.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
src/main/resources/img/compass/30.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
src/main/resources/img/compass/45.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
src/main/resources/img/compass/60.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
src/main/resources/img/compass/75.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
src/main/resources/img/compass/90.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |