Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a58f8df
[style] 개행 수정
zyovn Aug 12, 2025
94ad68e
[feat] 관리자 페이지 웨이블존 상세 조회 화면에서 이전, 다음 웨이블존으로 이동하는 버튼 생성
KiSeungMin Aug 14, 2025
7210a3c
Merge branch 'develop' into feature/seungmin
KiSeungMin Aug 14, 2025
4fecb99
[test] 웨이블존 상세 조회 페이지 이전, 다음 버튼 배포 테스트
KiSeungMin Aug 14, 2025
ef5546d
[feat] 공덕 지역 웨이블존 데이터 추가
KiSeungMin Aug 14, 2025
866bec0
[feat] 공덕 지역 웨이블존 데이터를 배포 환경에 반영하도록 profile 수정
KiSeungMin Aug 14, 2025
696f629
[chore] workflow 및 csv importer 프로필 원복
KiSeungMin Aug 14, 2025
253f65a
[feat] 공덕 지역 웨이블존 데이터 추가
KiSeungMin Aug 14, 2025
0a4629b
Merge remote-tracking branch 'origin/main' into feature/hyoin
hyoinYang Aug 15, 2025
d6801b1
[fix] kric api 응답 수정
hyoinYang Aug 15, 2025
3bf982f
[fix] 휠체어 정보를 좌표 말고 string 형식으로 변환
hyoinYang Aug 15, 2025
cab23c1
[feat] 공덕 도보 관련 데이터 추가
zyovn Aug 15, 2025
f537438
[fix] 환승 횟수 변경, 환승 카운트 로직 수정
hyoinYang Aug 15, 2025
efb4106
[refactor] api 관련 로깅을 자세하게 변경
hyoinYang Aug 15, 2025
8553ffa
[fix] kric api에 타임아웃 추가
hyoinYang Aug 15, 2025
11774c5
[fix] moveInfo에 도보 이동 거리 반영, 환승 로직 변경
hyoinYang Aug 15, 2025
6ee135d
Merge remote-tracking branch 'origin/develop' into feature/hyoin
hyoinYang Aug 15, 2025
1ccdb70
Merge pull request #149 from Wayble-Project/feature/jeongbin
zyovn Aug 15, 2025
b7085b4
Merge remote-tracking branch 'origin/develop' into feature/hyoin
hyoinYang Aug 15, 2025
cfbf03f
Merge pull request #151 from Wayble-Project/feature/hyoin
hyoinYang Aug 15, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.wayble.server.admin.dto.wayblezone.AdminWaybleZoneCreateDto;
import com.wayble.server.admin.dto.wayblezone.AdminWaybleZoneDetailDto;
import com.wayble.server.admin.dto.wayblezone.AdminWaybleZoneNavigationDto;
import com.wayble.server.admin.dto.wayblezone.AdminWaybleZonePageDto;
import com.wayble.server.admin.dto.wayblezone.AdminWaybleZoneUpdateDto;
import com.wayble.server.admin.service.AdminWaybleZoneService;
Expand Down Expand Up @@ -58,10 +59,14 @@ public String getWaybleZoneDetail(HttpSession session, Model model, @PathVariabl
return "redirect:/admin/wayblezone/wayble-zones?error=notfound";
}

// 이전/다음 네비게이션 정보 추가
AdminWaybleZoneNavigationDto navigation = adminWaybleZoneService.getNavigationInfo(id);

model.addAttribute("waybleZone", waybleZoneOpt.get());
model.addAttribute("navigation", navigation);
model.addAttribute("adminUsername", session.getAttribute("adminUsername"));

log.debug("웨이블존 상세 조회 - ID: {}", id);
log.debug("웨이블존 상세 조회 - ID: {}, 이전ID: {}, 다음ID: {}", id, navigation.previousId(), navigation.nextId());

return "admin/wayblezone/wayble-zone-detail";
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.wayble.server.admin.dto.wayblezone;

public record AdminWaybleZoneNavigationDto(
Long previousId,
Long nextId
) {
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.wayble.server.admin.repository;

import com.wayble.server.admin.dto.wayblezone.AdminWaybleZoneDetailDto;
import com.wayble.server.admin.dto.wayblezone.AdminWaybleZoneNavigationDto;
import com.wayble.server.admin.dto.wayblezone.AdminWaybleZoneThumbnailDto;

import java.util.List;
Expand All @@ -13,4 +14,7 @@ public interface AdminWaybleZoneRepositoryCustom {

// 상세 조회 메서드 (관리자용)
Optional<AdminWaybleZoneDetailDto> findAdminWaybleZoneDetailById(Long zoneId);

// 이전/다음 웨이블존 ID 조회 (ID순)
AdminWaybleZoneNavigationDto getNavigationInfo(Long currentId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.querydsl.core.types.Projections;
import com.querydsl.jpa.impl.JPAQueryFactory;
import com.wayble.server.admin.dto.wayblezone.AdminWaybleZoneDetailDto;
import com.wayble.server.admin.dto.wayblezone.AdminWaybleZoneNavigationDto;
import com.wayble.server.admin.dto.wayblezone.AdminWaybleZoneThumbnailDto;
import com.wayble.server.common.entity.Address;
import com.wayble.server.wayblezone.entity.WaybleZone;
Expand Down Expand Up @@ -102,4 +103,23 @@ public Optional<AdminWaybleZoneDetailDto> findAdminWaybleZoneDetailById(Long zon

return Optional.of(detailDto);
}

@Override
public AdminWaybleZoneNavigationDto getNavigationInfo(Long currentId) {
// 이전 ID 조회 (현재 ID보다 작은 ID 중 가장 큰 값)
Long previousId = queryFactory
.select(waybleZone.id.max())
.from(waybleZone)
.where(waybleZone.id.lt(currentId))
.fetchOne();

// 다음 ID 조회 (현재 ID보다 큰 ID 중 가장 작은 값)
Long nextId = queryFactory
.select(waybleZone.id.min())
.from(waybleZone)
.where(waybleZone.id.gt(currentId))
.fetchOne();

return new AdminWaybleZoneNavigationDto(previousId, nextId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.wayble.server.admin.dto.wayblezone.AdminWaybleZoneCreateDto;
import com.wayble.server.admin.dto.wayblezone.AdminWaybleZoneDetailDto;
import com.wayble.server.admin.dto.wayblezone.AdminWaybleZoneNavigationDto;
import com.wayble.server.admin.dto.wayblezone.AdminWaybleZonePageDto;
import com.wayble.server.admin.dto.wayblezone.AdminWaybleZoneThumbnailDto;
import com.wayble.server.admin.dto.wayblezone.AdminWaybleZoneUpdateDto;
Expand Down Expand Up @@ -59,6 +60,10 @@ public Optional<AdminWaybleZoneDetailDto> findWaybleZoneById(Long waybleZoneId)
return adminWaybleZoneRepository.findAdminWaybleZoneDetailById(waybleZoneId);
}

public AdminWaybleZoneNavigationDto getNavigationInfo(Long currentId) {
return adminWaybleZoneRepository.getNavigationInfo(currentId);
}

@Transactional
public Long createWaybleZone(AdminWaybleZoneCreateDto adminWaybleZoneCreateDto) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ public WebClient tMapWebClient() {
public WebClient kricWebClient() {
return WebClient.builder()
.baseUrl(kricProperties.baseUrl())
.codecs(configurer -> configurer.defaultCodecs().maxInMemorySize(2 * 1024 * 1024))
.filter((request, next) -> next.exchange(request)
.timeout(java.time.Duration.ofSeconds(15))
.retryWhen(reactor.util.retry.Retry.backoff(3, java.time.Duration.ofSeconds(1))
.filter(throwable -> throwable instanceof org.springframework.web.reactive.function.client.WebClientRequestException)))
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public record Step(
DirectionType mode, // 예: START, WALK, SUBWAY, BUS, FINISH
@Nullable List<MoveInfo> moveInfo, // 같은 Step으로 이동한 정류장(Node) 정보 (중간 정류장만)
@Nullable String routeName,
Integer moveNumber, // 같은 Step(route)로 이동한 횟수
Integer moveNumber, // 같은 Step(route)로 이동한 횟수 또는 WALK step의 경우 거리(미터 단위)
@Nullable BusInfo busInfo, // 버스일 경우에만 생성, 이외의 경우 null
@Nullable SubwayInfo subwayInfo, // 지하철일 경우에만 생성, 이외의 경우 null
String from,
Expand All @@ -43,8 +43,8 @@ public record BusInfo(
){}

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

Expand All @@ -55,8 +55,8 @@ public record LocationInfo(

// 지하철 시설 정보 묶음 (서비스 내부에서 사용)
public record NodeInfo(
List<LocationInfo> wheelchair,
List<LocationInfo> elevator,
List<String> wheelchair,
List<String> elevator,
Boolean accessibleRestroom
) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
@Table(name = "facility")
public class Facility {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Column(name="stationName")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import jakarta.persistence.*;
import lombok.*;

import java.util.List;

@Entity
@Getter
@Builder(access = AccessLevel.PRIVATE)
Expand Down Expand Up @@ -33,4 +35,8 @@ public class Route {
@ManyToOne
@JoinColumn(name = "end_node_id")
private Node endNode;

// 휠체어 정보
@OneToMany(mappedBy = "route", fetch = FetchType.LAZY)
private List<Wheelchair> wheelchairs;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.wayble.server.direction.entity.transportation;

import jakarta.persistence.*;
import lombok.*;

@Entity
@Getter
@Builder
@AllArgsConstructor(access = AccessLevel.PROTECTED)
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Table(name = "wheelchair")
public class Wheelchair {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "route_id", nullable = false)
private Route route;

@Column(name = "wheelchair_location", nullable = false)
private String wheelchairLocation; // 1-4 등

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
import lombok.Getter;

public record KricToiletRawItem(
String railOprIsttCd,
String lnCd,
String stinCd,
String toltNum
String grndDvNm,
String stinFlor,
String gateInotDvNm,
String exitNo,
String dtlLoc,
String mlFmlDvNm,
String toltNum,
String diapExchNum
) {}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import java.util.List;

public record KricToiletRawResponse(
KricToiletRawBody body
List<KricToiletRawItem> body
) {}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void init() {

try {
// 그래프
try (InputStream graphStream = getClass().getResourceAsStream("/seocho_pedestrian.json")) {
try (InputStream graphStream = getClass().getResourceAsStream("/seocho_gongdeok_pedestrian.json")) {
if (graphStream == null) {
throw new ApplicationException(WalkingErrorCase.GRAPH_FILE_NOT_FOUND);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
import java.util.Optional;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface FacilityRepository extends JpaRepository<Facility, Long> {
Optional<Facility> findByNodeId(Long nodeId);
@Query("SELECT f FROM Facility f " +
"LEFT JOIN FETCH f.lifts " +
"WHERE f.id = :nodeId")
Optional<Facility> findByNodeId(@Param("nodeId") Long nodeId);
Comment on lines +13 to +16
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

FETCH JOIN + 단건 조회에서 DISTINCT 누락 시 NonUniqueResultException 위험

LEFT JOIN FETCH f.lifts로 다대일 확대 후 단건 반환 시 중복 로우가 생길 수 있습니다. SELECT DISTINCT를 붙여 중복을 제거하지 않으면 JPA가 단건 결과를 집계하지 못해 NonUniqueResultException이 발생할 수 있습니다.

다음과 같이 DISTINCT를 추가해주세요.

-    @Query("SELECT f FROM Facility f " +
+    @Query("SELECT DISTINCT f FROM Facility f " +
            "LEFT JOIN FETCH f.lifts " +
            "WHERE f.id = :nodeId")
     Optional<Facility> findByNodeId(@Param("nodeId") Long nodeId);
📝 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
@Query("SELECT f FROM Facility f " +
"LEFT JOIN FETCH f.lifts " +
"WHERE f.id = :nodeId")
Optional<Facility> findByNodeId(@Param("nodeId") Long nodeId);
@Query("SELECT DISTINCT f FROM Facility f " +
"LEFT JOIN FETCH f.lifts " +
"WHERE f.id = :nodeId")
Optional<Facility> findByNodeId(@Param("nodeId") Long nodeId);
🤖 Prompt for AI Agents
In src/main/java/com/wayble/server/direction/repository/FacilityRepository.java
around lines 13 to 16, the JPQL uses LEFT JOIN FETCH f.lifts which can produce
duplicate rows for a single Facility and cause NonUniqueResultException on a
single-result query; update the query to use SELECT DISTINCT f (i.e., prefix the
select with DISTINCT) so duplicates are eliminated and the Optional<Facility>
single-result retrieval is safe.

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.wayble.server.direction.repository;

import com.wayble.server.direction.entity.transportation.Wheelchair;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;
import java.util.Optional;

public interface WheelchairInfoRepository extends JpaRepository<Wheelchair, Long> {

@Query("SELECT w FROM Wheelchair w WHERE w.route.routeId = :routeId")
List<Wheelchair> findByRouteId(@Param("routeId") Long routeId);
}
Loading
Loading