From d31cb67d3b9e564db8002363446aecfc0bb01600 Mon Sep 17 00:00:00 2001 From: changha Date: Wed, 1 May 2024 15:34:16 +0900 Subject: [PATCH] =?UTF-8?q?bugfix:=20=EA=B2=8C=EC=8B=9C=EA=B8=80=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=EC=9D=B4=EC=95=88=EB=90=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sanEseo/public_api/PublicDataService.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/seoultech/sanEseo/public_api/PublicDataService.java b/src/main/java/com/seoultech/sanEseo/public_api/PublicDataService.java index 2cfab7f..cfc3700 100644 --- a/src/main/java/com/seoultech/sanEseo/public_api/PublicDataService.java +++ b/src/main/java/com/seoultech/sanEseo/public_api/PublicDataService.java @@ -32,7 +32,6 @@ public class PublicDataService { private final RestTemplate restTemplate; private final ObjectMapper mapper; private final PostService postService; - private final CoordinateService coordinateService; private final DistrictPort districtPort; public List getLinearResponses(int dataIndex) { @@ -107,9 +106,6 @@ public List parsingCoordinate(int dataIndex) { ObjectMapper mapper = new ObjectMapper(); List responses = new ArrayList<>(); try { -// Path geoJsonPath = new ClassPathResource(geoJsonPathString).getFile().toPath(); -// String jsonContent = Files.readString(geoJsonPath); -// FeatureCollection featureCollection = mapper.readValue(jsonContent, FeatureCollection.class); InputStream inputStream = new ClassPathResource(geoJsonPathString).getInputStream(); String jsonContent = new String(inputStream.readAllBytes(), StandardCharsets.UTF_8); FeatureCollection featureCollection = mapper.readValue(jsonContent, FeatureCollection.class); @@ -155,7 +151,8 @@ public void addPublicData(int dataIndex){ String district = getCourseResponse.getDistrict(); int commaIndex = district.indexOf(','); // 쉼표 위치 찾기 - + System.out.println("dataIndex" + dataIndex); + System.out.println(getLinearResponse.getName()); if (commaIndex != -1) { district = district.substring(0, commaIndex); // 쉼표 이전까지 문자열 자르기 } @@ -164,16 +161,14 @@ public void addPublicData(int dataIndex){ Long id = byName.getId(); // District ID 가져오기 // 데이터베이스에 Post 추가 - Post post = postService.addPost(new AddPostRequest( + postService.addPost(new AddPostRequest( Category.DODREAM, getGeometryResponse.getName(), getCourseResponse.getSubTitle(), safeSubstring(getCourseResponse.getDescription(), 0, 255), getCourseResponse.getLevel(), getCourseResponse.getTime(), getCourseResponse.getDistance(), safeSubstring(getCourseResponse.getCourseDetail(), 0 ,255), getCourseResponse.getTransportation(), id, getGeometryResponse)); -// if (post != null){ -// coordinateService.saveCoordinate(getGeometryResponse, post); -// } + } } }