Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/main/java/com/wayble/server/ServerApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.wayble.server.common.client.tmap.TMapProperties;
import com.wayble.server.direction.external.kric.KricProperties;
import com.wayble.server.direction.external.opendata.OpenDataProperties;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.elasticsearch.ReactiveElasticsearchRepositoriesAutoConfiguration;
Expand All @@ -16,7 +17,7 @@
)
@EnableJpaAuditing
@EnableScheduling
@EnableConfigurationProperties({TMapProperties.class, KricProperties.class})
@EnableConfigurationProperties({TMapProperties.class, KricProperties.class, OpenDataProperties.class})
@EnableElasticsearchRepositories(basePackages = {"com.wayble.server.explore.repository", "com.wayble.server.logging.repository", "com.wayble.server.direction.repository"})
@EntityScan(basePackages = "com.wayble.server")
public class ServerApplication {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.wayble.server.common.config;

import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.net.http.HttpClient;
import java.time.Duration;

@Configuration
@RequiredArgsConstructor
public class HttpClientConfig {

@Value("${http.client.connect-timeout:10}")
private int connectTimeout;

@Value("${http.client.request-timeout:30}")
private int requestTimeout;

@Bean
public HttpClient httpClient() {
return HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(connectTimeout))
.build();
}

@Bean
public Duration httpRequestTimeout() {
return Duration.ofSeconds(requestTimeout);
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.wayble.server.direction.controller;

import com.wayble.server.common.response.CommonResponse;
import com.wayble.server.direction.dto.TransportationRequestDto;
import com.wayble.server.direction.dto.TransportationResponseDto;
import com.wayble.server.direction.dto.request.TransportationRequestDto;
import com.wayble.server.direction.dto.response.TransportationResponseDto;
Comment on lines +4 to +5
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

레거시 패키지 참조 잔재 여부 확인 권장

다른 코드에 기존 패키지(com.wayble.server.direction.dto.*)를 참조하는 부분이 남아있지 않은지 점검해주세요.

다음 스크립트로 레거시 import를 검색할 수 있습니다:


🏁 Script executed:

#!/bin/bash
# 레거시 DTO 패키지 참조 검색
rg -n "com\.wayble\.server\.direction\.dto\.Transportation(Request|Response)Dto"

Length of output: 82


추가 검증을 위해 레거시 DTO 패키지에 대한 모든 import 참조를 검색해 주세요.


🏁 Script executed:

#!/bin/bash
# 레거시 DTO 패키지 모든 import 참조 검색
rg -n '^import com\.wayble\.server\.direction\.dto'

Length of output: 3572


레거시 DTO 패키지 참조 업데이트 필요

아래 파일들에 아직 com.wayble.server.direction.dto.* 패키지 import가 남아있습니다. 모두 새로운 DTO 패키지 경로로 변경해주세요.

  • src/main/java/com/wayble/server/direction/service/TransportationService.java
  • src/main/java/com/wayble/server/direction/service/WaybleDijkstraService.java
  • src/main/java/com/wayble/server/direction/service/FacilityService.java
  • src/main/java/com/wayble/server/direction/service/BusInfoService.java
  • src/main/java/com/wayble/server/direction/service/WalkingService.java
  • src/main/java/com/wayble/server/direction/controller/TransportationController.java
  • src/main/java/com/wayble/server/direction/controller/swagger/WalkingSwagger.java
  • src/main/java/com/wayble/server/direction/controller/swagger/DirectionSwagger.java
  • src/main/java/com/wayble/server/direction/controller/WalkingController.java
  • src/main/java/com/wayble/server/direction/controller/DirectionController.java
  • src/main/java/com/wayble/server/direction/repository/DirectionElasticSearchCustomRepository.java
  • src/main/java/com/wayble/server/direction/repository/DirectionElasticSearchCustomRepositoryImpl.java
  • src/main/java/com/wayble/server/direction/service/DirectionService.java
  • src/test/java/com/wayble/server/direction/service/WalkingServiceTest.java

위 파일들에서 import com.wayble.server.direction.dto.*를 삭제하고, 새로 정의된 DTO 패키지(import 경로)를 적용해 주세요.

🤖 Prompt for AI Agents
In
src/main/java/com/wayble/server/direction/controller/TransportationController.java
around lines 4-5, remove the legacy imports importing
com.wayble.server.direction.dto.request.TransportationRequestDto and
com.wayble.server.direction.dto.response.TransportationResponseDto and replace
them with imports from the new DTO package used in the project (update to the
project's newly defined DTO import path for TransportationRequestDto and
TransportationResponseDto); apply the exact same replacement across all files
listed in the review so no references to com.wayble.server.direction.dto.*
remain.

import com.wayble.server.direction.service.TransportationService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.wayble.server.direction.dto;

import com.wayble.server.direction.entity.transportation.Edge;
import org.springframework.data.util.Pair;

import java.util.List;
import java.util.Map;

public record TransportationGraphDto( // 노드별 연결 정보와 엣지별 가중치를 함께 관리하기 위한 dto
Map<Long, List<Edge>> graph, // 노드별 연결 정보
Map<Pair<Long, Long>, Integer> weightMap // 엣지별 가중치
) {}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.wayble.server.direction.dto;
package com.wayble.server.direction.dto.request;

import io.swagger.v3.oas.annotations.media.Schema;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.wayble.server.direction.dto.response;

import java.util.List;

public record BusInfo(List<BusArrival> buses, String stationName) {
public record BusArrival(
String busNumber,
String arrival1,
String arrival2
) {}
}
Comment on lines +1 to +11
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

동일 명칭 DTO 중복/혼선 위험: TransportationResponseDto.BusInfo와 충돌 가능

본 파일의 BusInfo와 TransportationResponseDto.BusInfo가 공존하면 import 충돌·오용 위험이 큽니다. 실제 서비스는 TransportationResponseDto.BusInfo를 반환하는 것으로 보이며, 이 파일이 미사용이라면 제거하거나 명확히 목적을 구분해 리네이밍(예: StationArrivalsResponse)하는 것을 권장합니다. 사용 중이라면 컨트롤러/서비스 반환 타입 정합성을 재검토해 주세요.

아래 스크립트로 본 BusInfo의 실제 사용 여부와 이름 충돌 가능성을 점검하세요.

API로 노출할 DTO가 둘 필요가 없다면 하나로 통일해 주세요. 둘 다 필요하면 명칭을 분리하고 @Schema 문서화를 추가해 혼선을 줄이는 것을 권장합니다.


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "본 BusInfo(패키지 dto.response) 사용처:"
rg -n $'com\\.wayble\\.server\\.direction\\.dto\\.response\\.BusInfo' || true
rg -n $'\\bBusInfo\\b' | rg -n -v 'TransportationResponseDto' || true

echo
echo "TransportationResponseDto.BusInfo 사용처:"
rg -n $'TransportationResponseDto\\.BusInfo'

Length of output: 1694


미사용 BusInfo DTO 제거 또는 명칭 변경 필요

com.wayble.server.direction.dto.response.BusInfo는 정의된 곳 외에 코드베이스 어디에서도 참조되지 않습니다. 반면 실제 서비스 로직에서는 TransportationResponseDto.BusInfo만 사용 중이므로, 중복된 DTO를 유지할 이유가 없습니다. 아래 조치 중 하나를 선택해 반영해 주세요:

  • 불필요한 파일 삭제
    src/main/java/com/wayble/server/direction/dto/response/BusInfo.java
  • 동일 역할이 필요하다면 명칭을 명확히 구분하고 문서화
    • 예: StationArrivalsResponse 등으로 리네이밍 후 @Schema 어노테이션 추가
🤖 Prompt for AI Agents
src/main/java/com/wayble/server/direction/dto/response/BusInfo.java (lines
1-11): 이 DTO는 코드베이스에서 사용되지 않으므로 파일을 삭제하거나, 동일한 역할이 필요하면 명확한 명칭으로 리네임하고 문서화해야
합니다; 선택 1 — 불필요하면 파일을
삭제(src/main/java/com/wayble/server/direction/dto/response/BusInfo.java)하고 관련
import/참조가 없는지 확인해 커밋하세요; 선택 2 — 필요하면 클래스명을 예: StationArrivalsResponse로 변경하고 적절한
@Schema 주석과 설명을 추가한 뒤 프로젝트 전반에서 새로운 이름으로 참조를 업데이트하고 테스트를 실행해 변경 영향이 없는지 검증하세요.

Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package com.wayble.server.direction.dto.response;

import com.wayble.server.direction.entity.DirectionType;
import org.springframework.lang.Nullable;
import io.swagger.v3.oas.annotations.media.Schema;

import java.util.List;

@Schema(description = "대중교통 길찾기 응답 DTO")
public record TransportationResponseDto(
List<Step> routes,
PageInfo pageInfo
) {
public record Step(
DirectionType mode, // 예: START, WALK, SUBWAY, BUS, FINISH
@Nullable List<MoveInfo> moveInfo, // 같은 Step으로 이동한 정류장(Node) 정보 (중간 정류장만)
@Nullable String routeName,
Integer moveNumber, // 같은 Step(route)로 이동한 횟수
@Nullable BusInfo busInfo, // 버스일 경우에만 생성, 이외의 경우 null
@Nullable SubwayInfo subwayInfo, // 지하철일 경우에만 생성, 이외의 경우 null
String from,
String to
) {}

public record PageInfo(
Integer nextCursor,
boolean hasNext
) {}

public record MoveInfo(
String nodeName // 정류장(Node)의 stationName
){}

public record BusInfo(
boolean isShuttleBus, // routeName에 "마포" 포함시 true
@Nullable List<Boolean> isLowFloor, // Open API(busType1,busType2) 기반 저상 여부 리스트
@Nullable Integer dispatchInterval // Open API(term) 기반 배차간격
){}

public record SubwayInfo(
List<LocationInfo> wheelchair,
List<LocationInfo> elevator,
Boolean accessibleRestroom
) {}

public record LocationInfo(
Double latitude,
Double longitude
) {}

// 지하철 시설 정보 묶음 (서비스 내부에서 사용)
public record NodeInfo(
List<LocationInfo> wheelchair,
List<LocationInfo> elevator,
Boolean accessibleRestroom
) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ public class Edge {
private DirectionType edgeType;

// 출발 노드
@ManyToOne
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "start_node_id")
private Node startNode;

// 도착 노드
@ManyToOne
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "end_node_id")
private Node endNode;

// 해당 연결이 속한 노선
@ManyToOne
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "route_id")
private Route route;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class Facility {
@OneToMany(mappedBy = "facility", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<Elevator> elevators;

@OneToOne
@OneToOne(fetch = FetchType.LAZY)
@MapsId
@JoinColumn(name = "id")
private Node node;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import java.util.List;
import java.util.Objects;

import org.hibernate.annotations.BatchSize;

import com.wayble.server.direction.entity.DirectionType;

@Entity
Expand All @@ -32,23 +34,24 @@ public class Node {
private Double longitude;

// 출발 edge 리스트 (정류장에서 출발)
@OneToMany(mappedBy = "startNode")
@OneToMany(mappedBy = "startNode", fetch = FetchType.LAZY)
@BatchSize(size = 100)
private List<Edge> outgoingEdges;

// 도착 Edge 리스트 (정류장으로 도착)
@OneToMany(mappedBy = "endNode")
@OneToMany(mappedBy = "endNode", fetch = FetchType.LAZY)
@BatchSize(size = 100)
private List<Edge> incomingEdges;

// 이 정류장이 기점/종점인 노선
@OneToMany(mappedBy = "startNode")
@OneToMany(mappedBy = "startNode", fetch = FetchType.LAZY)
@BatchSize(size = 100)
private List<Route> startRoutes;

@OneToMany(mappedBy = "endNode")
@OneToMany(mappedBy = "endNode", fetch = FetchType.LAZY)
@BatchSize(size = 100)
private List<Route> endRoutes;

@OneToOne(mappedBy = "node")
private Facility facility_id;

public Node(Long id, String stationName, DirectionType nodeType, double latitude, double longitude) {
this.id = id;
this.stationName = stationName;
Expand All @@ -57,6 +60,10 @@ public Node(Long id, String stationName, DirectionType nodeType, double latitude
this.longitude = longitude;
}

public static Node createNode(Long id, String stationName, DirectionType nodeType, double latitude, double longitude) {
return new Node(id, stationName, nodeType, latitude, longitude);
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.wayble.server.direction.external.opendata;

import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(prefix = "opendata.api")
public record OpenDataProperties(
String key,
String baseUrl,
String encodedKey,
Endpoints endpoints,
int timeout,
String userAgent,
String accept
) {
public record Endpoints(String arrivals, String stationByName) {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.wayble.server.direction.external.opendata.dto;

public record Arrival (
Integer busType1, // 1이면 저상
Integer busType2, // 1이면 저상
Integer term // 배차 간격
) {}
Comment on lines +3 to +7
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

OpenDataResponse.Item과 타입 정합성 확인 및 정렬

BusInfoService가 busType1/busType2를 문자열 "1"과 비교하는 흐름이 보입니다. Arrival은 Integer로 선언되어 있어 매핑/파싱 불일치 가능성이 있습니다. OpenDataResponse.Item의 필드 타입과 일치시키는 게 안전합니다. 불일치 시 런타임 변환/비교 버그가 날 수 있습니다.

아래 스크립트로 OpenDataResponse.Item의 선언 타입과 BusInfoService 비교 로직을 확인하세요. String이라면 Arrival도 String으로 맞추는 것을 권장합니다.

String으로 확인되면 다음과 같이 정렬을 권장합니다:

-public record Arrival (    
-    Integer busType1, // 1이면 저상
-    Integer busType2, // 1이면 저상
-    Integer term     // 배차 간격
-) {}
+public record Arrival (
+    String busType1, // "1"이면 저상
+    String busType2, // "1"이면 저상
+    String term      // 배차 간격(분), 문자열로 수신되므로 파싱 필요
+) {}

또는 Item이 Integer라면 BusInfoService의 비교 로직을 정수 비교로 정렬해 주세요.


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "OpenDataResponse.Item 선언부 인근:"
rg -n -A 8 -B 2 $'record\\s+Item\\s*\\(' src/main/java/com/wayble/server/direction/external/opendata/dto/OpenDataResponse.java

echo
echo "BusInfoService에서 busType/term 사용부:"
rg -n -A 2 -B 2 'busType1|busType2|term\\(' src/main/java/com/wayble/server/direction/service/BusInfoService.java

Length of output: 831


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "BusInfoService에서 busType1/busType2 및 term 사용 내역:"
rg -n -C 4 'busType1|busType2|term' src/main/java/com/wayble/server/direction/service/BusInfoService.java

Length of output: 911


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Arrival 생성 위치 확인:"
rg -n -C 3 'new Arrival' -n src

Length of output: 98


Arrival 필드 타입을 OpenDataResponse.Item과 일치시키세요

OpenDataResponse.Item의 busType1, busType2, term이 모두 String으로 선언되어 있는데, Arrival은 Integer로 선언되어 있어 매핑/파싱 불일치 가능성이 있습니다. 런타임 변환/비교 버그를 방지하려면 두 레코드의 필드 타입을 일치시키십시오. 예를 들어, Arrival을 다음과 같이 수정하세요:

-public record Arrival(
-    Integer busType1, // 1이면 저상
-    Integer busType2, // 1이면 저상
-    Integer term      // 배차 간격
-) {}
+public record Arrival(
+    String busType1, // "1"이면 저상
+    String busType2, // "1"이면 저상
+    String term      // 배차 간격(분), 문자열로 수신되므로 파싱 필요
+) {}

만약 OpenDataResponse.Item이 Integer 타입으로 변경된다면, BusInfoService에서 "1".equals(item.busType1()) 비교와 Integer.parseInt(item.term()) 호출을 Integer 비교/처리로 모두 일치시켜 주세요.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public record Arrival (
Integer busType1, // 1이면 저상
Integer busType2, // 1이면 저상
Integer term // 배차 간격
) {}
public record Arrival(
String busType1, // "1"이면 저상
String busType2, // "1"이면 저상
String term // 배차 간격(분), 문자열로 수신되므로 파싱 필요
) {}
🤖 Prompt for AI Agents
In src/main/java/com/wayble/server/direction/external/opendata/dto/Arrival.java
around lines 3 to 7, the Arrival record uses Integer for busType1, busType2, and
term while OpenDataResponse.Item declares these fields as String; change
Arrival's field types to String to match OpenDataResponse.Item so
mapping/parsing is consistent, and if OpenDataResponse.Item later changes to
Integer, update BusInfoService comparisons (replace
`"1".equals(item.busType1())` with Integer equality) and parses
(`Integer.parseInt(item.term())`) to use Integer values consistently.

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.wayble.server.direction.external.opendata.dto;

import java.util.List;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@JsonIgnoreProperties(ignoreUnknown = true)
public record OpenDataResponse ( // 버스 정류장 id를 기반으로 배차시간, 저상버스 여부를 확인하는 엔드포인트
@JsonProperty("comMsgHeader") ComMsgHeader comMsgHeader,
@JsonProperty("msgHeader") MsgHeader msgHeader,
@JsonProperty("msgBody") MsgBody msgBody
) {
public record ComMsgHeader(
@JsonProperty("errMsg") String errMsg,
@JsonProperty("responseTime") String responseTime,
@JsonProperty("requestMsgID") String requestMsgID,
@JsonProperty("responseMsgID") String responseMsgID,
@JsonProperty("successYN") String successYN,
@JsonProperty("returnCode") String returnCode
) {}
public record MsgHeader(
@JsonProperty("headerMsg") String headerMsg,
@JsonProperty("headerCd") String headerCd,
@JsonProperty("itemCount") Integer itemCount
) {}

public record MsgBody(
@JsonProperty("itemList") List<Item> itemList
) {}

@JsonIgnoreProperties(ignoreUnknown = true)
public record Item(
@JsonProperty("busType1") String busType1,
@JsonProperty("busType2") String busType2,
@JsonProperty("term") String term,
@JsonProperty("busRouteId") String busRouteId
) {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.wayble.server.direction.external.opendata.dto;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.util.List;

@JsonIgnoreProperties(ignoreUnknown = true)
public record StationSearchResponse( // 버스 정류장 id를 검색하는 엔드포인트
StationSearchMsgBody msgBody
) {
public record StationSearchMsgBody(
List<StationItem> itemList
) {}

@JsonIgnoreProperties(ignoreUnknown = true)
public record StationItem(
String stId,
String stNm,
String tmX,
String tmY
) {}
Comment on lines +16 to +20
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

좌표 타입 및 좌표계 변환 확인 필요

tmX/tmY가 문자열로 선언되어 있습니다. TM 좌표를 사용하는 경우, 서비스 레이어에서 WGS84(lat/lon)로 변환하는 경로가 있는지 확인 부탁드립니다. 가능하다면 숫자형(double/BigDecimal) 매핑이 후처리에 유리합니다.

TM→WGS84 변환 로직 또는 사용 위치를 점검하려면 다음을 실행해 주세요:


🏁 Script executed:

#!/bin/bash
# tmX/tmY 사용 및 변환 여부 탐색
rg -n "tmX|tmY|StationSearchResponse" -A 5

Length of output: 8946


dto 및 서비스 레이어에서 TM 좌표 취급/변환 검토 필요

  • DTO 매핑

    • src/main/java/com/wayble/server/direction/external/opendata/dto/StationSearchResponse.java:16–20
    • tmX/tmY가 현재 String으로 선언되어 있어 파싱 시 Null/포맷 오류 발생 가능
    • 가급적 double 또는 BigDecimal로 매핑해 입력 단계에서 타입 안전성 확보를 권장
  • 좌표계 변환 로직

    • src/main/java/com/wayble/server/direction/service/BusInfoService.java:174–186 (findClosestStation 메서드)
    • 현재 String→double 파싱 후 TM 좌표계 상에서 거리만 계산하고, WGS84(lat/lon) 변환은 미구현
    • 이후 위경도 기반 로직(지도 렌더링, 클라이언트 전송 등)이 있다면 TM→WGS84 변환이 반드시 필요
    • Proj4j 또는 GeoTools 같은 라이브러리 도입을 검토하여 변환 로직을 추가할 것
🤖 Prompt for AI Agents
In
src/main/java/com/wayble/server/direction/external/opendata/dto/StationSearchResponse.java
around lines 16–20, tmX/tmY are declared as String which risks null/format
errors; change them to a numeric type (double or BigDecimal), ensure
Jackson/mapper will deserialize accordingly and add null/format validation. In
src/main/java/com/wayble/server/direction/service/BusInfoService.java around
lines 174–186 (findClosestStation), stop parsing Strings to double inline and
consume the numeric DTO values instead, then add TM→WGS84 conversion (using
Proj4j or GeoTools) before any distance calculations or before returning
coordinates to clients, update method signatures as needed, and add unit tests
to cover null/invalid inputs and coordinate conversion correctness.

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

import com.wayble.server.direction.entity.transportation.Edge;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface EdgeRepository extends JpaRepository<Edge, Long> {
@Query("SELECT DISTINCT e FROM Edge e " +
"JOIN FETCH e.startNode " +
"JOIN FETCH e.endNode " +
"LEFT JOIN FETCH e.route")
List<Edge> findAllWithNodesAndRoute();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.wayble.server.direction.repository;

import org.springframework.data.jpa.repository.JpaRepository;

import com.wayble.server.direction.entity.transportation.Route;

public interface RouteRepository extends JpaRepository<Route, Long>{

}
Loading
Loading