Browse Source

path properties yml에서 관리하게 변경 , util @value 추가하기 위해 컴포넌트 어노테이션 사용

pull/12/head
박재우 11 months ago
parent
commit
0cb72deaa9
  1. 2
      pav-server/src/main/java/com/palnet/biz/api/comn/file/service/ComnFileService.java
  2. 15
      pav-server/src/main/java/com/palnet/comn/utils/FlightUtils.java
  3. 2
      pav-server/src/main/java/com/palnet/comn/utils/PdfUtils.java
  4. 20
      pav-server/src/main/resources/application.yml

2
pav-server/src/main/java/com/palnet/biz/api/comn/file/service/ComnFileService.java

@ -50,7 +50,7 @@ public class ComnFileService {
private final HttpServletResponse response;
@Value("${base-url}")
@Value("${url.base.file}")
private String BASE_PATH;
private final String DOWNLOAD_URL = "/api/comn/file/download";
private final String NORMAL_FORDER_PATH = "normal/";

15
pav-server/src/main/java/com/palnet/comn/utils/FlightUtils.java

@ -27,12 +27,23 @@ import org.locationtech.proj4j.BasicCoordinateTransform;
import org.locationtech.proj4j.CRSFactory;
import org.locationtech.proj4j.CoordinateReferenceSystem;
import org.locationtech.proj4j.ProjCoordinate;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import lombok.extern.log4j.Log4j2;
@Log4j2
@Component
public class FlightUtils {
//기본좌표를 받아 버퍼좌표를 생성하는 유틸
private static String basePath;
@Value("${url.base.coord}")
public void setPath(String value) {
basePath = value;
}
public static Coordinate[] createBuffer(Coordinate[] lineCoords, Integer bufval) {
GeometryFactory geometryFactory = new GeometryFactory();
LineString line = new GeometryFactory().createLineString(lineCoords);
@ -149,12 +160,12 @@ public class FlightUtils {
public static JSONObject getCoordinateGis(Coordinate coordinate) throws IOException, ParseException {
String path = "C:\\Users\\Jaewoo\\Downloads\\pal\\pav\\kac\\coordinate\\CoordinateFolder\\";
String baseFileName = "all_location.geojson";
JSONObject obj = new JSONObject();
String path = basePath;
while(true) {
File file = new File(path+baseFileName);

2
pav-server/src/main/java/com/palnet/comn/utils/PdfUtils.java

@ -32,7 +32,7 @@ public class PdfUtils {
private final TemplateEngine templateEngine;
@Value("${base-url}")
@Value("${url.base.file}")
private String BASE_PATH;
private final String PDF_FORDER_PATH = "od/";

20
pav-server/src/main/resources/application.yml

@ -63,7 +63,10 @@ api:
client-secret-key: Q4K4OtUYol
search-url : https://openapi.naver.com/v1/search/local.json
base-url: files/
url:
base:
file: files/
coord: C:\\Users\\Jaewoo\\Downloads\\pal\\pav\\kac\\coordinate\\CoordinateFolder\\
---
@ -110,7 +113,10 @@ api:
client-secret-key: Q4K4OtUYol
search-url : https://openapi.naver.com/v1/search/local.json
base-url: /data/server/files/
url:
base:
file: /data/server/files/
coord: /data/coord/coordinateFolder
---
@ -166,7 +172,10 @@ api:
client-secret-key: Q4K4OtUYol
search-url : https://openapi.naver.com/v1/search/local.json
base-url: /data/server/files/
url:
base:
file: /data/server/files/
coord: /data/coord/coordinateFolder
---
@ -218,4 +227,7 @@ api:
client-secret-key: Q4K4OtUYol
search-url : https://openapi.naver.com/v1/search/local.json
base-url: /data/server/files/
url:
base:
file: /data/server/files/
coord: /data/coord/coordinateFolder

Loading…
Cancel
Save