Skip to content

Commit

Permalink
Merge pull request #72 from SanE-Seo/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Changha-dev authored May 1, 2024
2 parents 78165c5 + 61474ec commit 47fd45d
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<GetLinearResponse> getLinearResponses(int dataIndex) {
Expand Down Expand Up @@ -107,9 +106,6 @@ public List<GetGeometryResponse> parsingCoordinate(int dataIndex) {
ObjectMapper mapper = new ObjectMapper();
List<GetGeometryResponse> 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);
Expand Down Expand Up @@ -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); // 쉼표 이전까지 문자열 자르기
}
Expand All @@ -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);
// }

}
}
}
Expand Down

0 comments on commit 47fd45d

Please sign in to comment.