Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
ac36f55
[test] 테스트코드에서 리뷰 등록 시 리뷰 카운트 증가 타입 변경
seung-in-Yoo Aug 17, 2025
d022f97
[feat] 웨이블존 일치 여부 검증 알고리즘 성능 개선
KiSeungMin Aug 18, 2025
e6ce328
[feat] 웨이블존 일치 여부 검증 알고리즘 성능 개선
KiSeungMin Aug 18, 2025
1073d2f
[refactor] 디렉토리 변경
hyoinYang Aug 18, 2025
06d3484
[feat] 엘리베이터 정보 반영
hyoinYang Aug 18, 2025
6759d72
Merge remote-tracking branch 'origin/develop' into feature/hyoin
hyoinYang Aug 18, 2025
a2a98e2
[fix] 출구 번호 출력시 정렬 추가
hyoinYang Aug 18, 2025
0d51d0a
[fix] 함수 파라미터 수젖ㅇ
hyoinYang Aug 18, 2025
d897d30
Revert "[fix] 함수 파라미터 수젖ㅇ"
hyoinYang Aug 18, 2025
d8dc03c
[fix] 함수 파라미터 수정
hyoinYang Aug 18, 2025
bf997fc
Merge pull request #166 from Wayble-Project/feature/hyoin
hyoinYang Aug 19, 2025
ce61e36
[refactor] 리졸버에서 토큰으로 꺼내도록 변경
seung-in-Yoo Aug 19, 2025
b44069f
[refactor] swagger에서 필수 파라미터 userId 입력 삭제
seung-in-Yoo Aug 19, 2025
47b3255
[feat] Auth (리졸버) 관련 에러케이스 추가
seung-in-Yoo Aug 19, 2025
3faefa3
[refactor] 리졸버 관련 예외처리 변경
seung-in-Yoo Aug 19, 2025
67a5faa
[refactor] 코드리뷰 반영
seung-in-Yoo Aug 19, 2025
cba4d8e
Merge pull request #169 from Wayble-Project/feature/seungin
seung-in-Yoo Aug 19, 2025
8503d61
[refactor] Auth errorCode 숫자 변경
seung-in-Yoo Aug 19, 2025
3e37fa9
[feat] 웨이블존 저장할 리스트 생성 관련 요청 Dto 생성
seung-in-Yoo Aug 19, 2025
6bcd32b
[feat] 웨이블존 저장할 리스트 생성 관련 응답 Dto 생성
seung-in-Yoo Aug 19, 2025
a9b7c9a
[feat] 리스트에 웨이블존 추가 요청 DTO 생성
seung-in-Yoo Aug 19, 2025
aec33b8
[refactor] 웨이블존 추가 리스트 관련 에러 케이스 추가
seung-in-Yoo Aug 19, 2025
c288b5b
[refactor] 웨이블존 저장 관련 서비스 로직 변경
seung-in-Yoo Aug 19, 2025
2fbb794
[refactor] 웨이블존 저장 관련 Dto 필드명 변경
seung-in-Yoo Aug 19, 2025
9700c53
[fix] 웨이블존 저장 관련 컨트롤러 로직 변경
seung-in-Yoo Aug 19, 2025
823d51b
Merge pull request #171 from Wayble-Project/feature/seungin
seung-in-Yoo Aug 19, 2025
4798b27
[fix] 오프바이원 버그 관련 수정
seung-in-Yoo Aug 19, 2025
e11cbca
[refactor] 코드리뷰 반영
seung-in-Yoo Aug 19, 2025
fc63e8f
[refactor] 페이징 관련 서비스 로직에 따라 컨트롤러도 정규화한 값으로 사용
seung-in-Yoo Aug 19, 2025
697aaa5
[refactor] UserPlaceController에 @validated 추가
seung-in-Yoo Aug 19, 2025
15b9363
Merge pull request #172 from Wayble-Project/feature/seungin
seung-in-Yoo Aug 19, 2025
f725de5
[refactor] 웨이블존 저장 및 조회 관련 swagger 이름 변경
seung-in-Yoo Aug 20, 2025
b1df4ea
[fix] 하나의 웨이블존에 여러개의 리스트를 저장하도록 로직 변경
seung-in-Yoo Aug 20, 2025
76198c7
[refactor] 핸들러 메서드명 의미에 맞게 변경
seung-in-Yoo Aug 20, 2025
89b5995
[refactor] 코드리뷰 반영
seung-in-Yoo Aug 20, 2025
fa9f0f8
[fix] 페이지 관련 0 -> 1 로 변경
seung-in-Yoo Aug 20, 2025
3fe1ea9
Merge pull request #173 from Wayble-Project/feature/seungin
seung-in-Yoo Aug 20, 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
15 changes: 15 additions & 0 deletions src/main/java/com/wayble/server/auth/exception/AuthErrorCase.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.wayble.server.auth.exception;

import com.wayble.server.common.exception.ErrorCase;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor
public enum AuthErrorCase implements ErrorCase {
UNAUTHORIZED(401, 7001, "인증 정보가 없거나 userId를 추출할 수 없습니다.");

private final Integer httpStatusCode;
private final Integer errorCode;
private final String message;
}
Original file line number Diff line number Diff line change
@@ -1,45 +1,65 @@
package com.wayble.server.auth.resolver;

import com.wayble.server.auth.exception.AuthErrorCase;
import com.wayble.server.common.config.security.jwt.JwtTokenProvider;
import com.wayble.server.common.exception.ApplicationException;
import jakarta.servlet.http.HttpServletRequest;
import lombok.RequiredArgsConstructor;
import org.springframework.core.MethodParameter;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.support.WebDataBinderFactory;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.method.support.ModelAndViewContainer;

@Component
@RequiredArgsConstructor
public class CurrentUserArgumentResolver implements HandlerMethodArgumentResolver {

private final JwtTokenProvider jwtTokenProvider;

@Override
public boolean supportsParameter(MethodParameter parameter) {
return parameter.hasParameterAnnotation(CurrentUser.class)
&& Long.class.equals(parameter.getParameterType());
}

@Override
public Object resolveArgument(MethodParameter parameter,
ModelAndViewContainer mav,
NativeWebRequest webRequest,
WebDataBinderFactory binderFactory) {
public Object resolveArgument(
MethodParameter parameter,
ModelAndViewContainer mav,
NativeWebRequest webRequest,
WebDataBinderFactory binderFactory
) {
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
if (auth == null) {
throw new IllegalStateException("인증 정보가 없습니다.");
if (auth != null) {
Object principal = auth.getPrincipal();
if (principal instanceof Long l) { return l; }
if (principal instanceof Integer i) { return i.longValue(); }
if (principal instanceof String s && s.chars().allMatch(Character::isDigit)) {
return Long.parseLong(s);
}
String name = auth.getName();
if (name != null && name.chars().allMatch(Character::isDigit)) {
return Long.parseLong(name);
}
}

Object principal = auth.getPrincipal();
if (principal instanceof Long l) return l;
if (principal instanceof Integer i) return i.longValue();
if (principal instanceof String s) {
HttpServletRequest request = webRequest.getNativeRequest(HttpServletRequest.class);
String authz = request != null ? request.getHeader("Authorization") : null;
if (StringUtils.hasText(authz) && authz.startsWith("Bearer ")) {
String token = authz.substring(7);
try {
return Long.parseLong(s);
} catch (NumberFormatException ignored) {}
}
try {
return Long.parseLong(auth.getName());
} catch (Exception e) {
throw new IllegalStateException("userId를 추출할 수 없습니다.", e);
Long userId = jwtTokenProvider.getUserId(token);
if (userId != null) { return userId; }
} catch (IllegalArgumentException e) {
throw new ApplicationException(AuthErrorCase.UNAUTHORIZED);
}
}

throw new ApplicationException(AuthErrorCase.UNAUTHORIZED);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.wayble.server.direction.dto.response;

import com.wayble.server.direction.entity.DirectionType;
import org.springframework.lang.Nullable;

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

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

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.wayble.server.direction.entity.transportation;

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

import jakarta.persistence.*;
import lombok.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ public class Elevator {
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Column(name = "latitude", columnDefinition = "DECIMAL(10,7)", nullable = false)
private Double latitude;

@Column(name = "longitude", columnDefinition = "DECIMAL(10,7)", nullable = false)
private Double longitude;
@Column(name = "location", nullable = false)
private String location;
Comment on lines +17 to +18
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

위치 스키마 변경(DB 마이그레이션/레거시 사용처 점검 필요)

latitude/longitude → location 문자열 변경에 따라:

  • DB 마이그레이션(컬럼 추가/변경, 기존 lat/lon 제거 또는 비활성화)이 포함되었는지 확인 필요
  • 기존 코드에서 elevator.getLatitude()/getLongitude() 참조가 남아있지 않은지 점검 필요

확인을 위해 아래 스크립트로 레거시 사용처와 마이그레이션 흔적을 점검해 주세요. 결과 공유해 주시면 후속 지원하겠습니다.


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Searching for legacy Elevator latitude/longitude usages in Java code..."
rg -nP --type=java -C2 '\.getLatitude\s*\(|\.getLongitude\s*\(' || true
rg -nP --type=java -C2 '\bElevator\b.*(latitude|longitude)' || true
rg -nP --type=java -C2 '(latitude|longitude).*Elevator' || true

echo
echo "Searching for DB migration files mentioning elevator latitude/longitude..."
fd -a -t f -i '.*(migration|migrations|flyway|liquibase|changelog).*' || true
rg -nP -C2 '(?i)elevator.*(latitude|longitude|location)' || true

Length of output: 22107


DB 스키마 변경(엘리베이터 location 전환) 마이그레이션 및 레거시 호출 점검 필요

아래 사항을 반드시 반영/확인해주세요:

  • src/main/java/com/wayble/server/direction/entity/transportation/Elevator.java
    • latitude/longitudelocation 문자열 전환을 위한 Flyway/Liquibase 마이그레이션 스크립트 추가
      • 기존 lat/lon 컬럼에 저장된 값을 location으로 이관(migrate)
      • 값 이관 완료 후 lat/lon 컬럼 제거 또는 비활성화
  • 코드베이스 전역에서 elevator.getLatitude()elevator.getLongitude() 호출이 남아있지 않은지 재차 검증
    • 첫 검색 결과 해당 호출은 발견되지 않았으나, 커스텀 유틸이나 스크립트 등 예외 경로 점검 필요
  • 마이그레이션 스크립트는 src/main/resources/db/migration(또는 프로젝트 설정된 폴더)에 위치시키고, 자동 배포 파이프라인에 포함

위 작업 완료 후 결과(스크립트·검증 로그)를 공유해주시면 최종 승인 및 후속 지원을 진행하겠습니다.

🤖 Prompt for AI Agents
In src/main/java/com/wayble/server/direction/entity/transportation/Elevator.java
around lines 17-18, the entity was changed from latitude/longitude fields to a
single location string but the DB migration and legacy-call cleanup are missing:
add a Flyway/Liquibase migration in src/main/resources/db/migration that (1)
adds the new location column if not present, (2) migrates existing
latitude/longitude values into the new location string format used by the
entity, and (3) drops or deprecates the old latitude/longitude columns after
verification; then search the entire codebase (including custom utils, scripts,
and tests) for any remaining elevator.getLatitude()/getLongitude() calls and
update them to use the new location accessor or parsing logic; ensure the
migration file is included in the automated deployment pipeline and provide
migration run logs and verification results.


@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "facility_id", nullable = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import org.hibernate.annotations.BatchSize;

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

@Entity
@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.wayble.server.direction.entity.transportation;

import com.wayble.server.direction.entity.DirectionType;
import com.wayble.server.direction.entity.transportation.*;
import com.wayble.server.direction.entity.type.DirectionType;

import jakarta.persistence.*;
import lombok.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.wayble.server.direction.entity;
package com.wayble.server.direction.entity.type;

public enum DirectionType {
BUS, SUBWAY, WALK,
Expand Down
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.Elevator;
import com.wayble.server.direction.entity.transportation.Facility;
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;

public interface ElevatorRepository extends JpaRepository<Elevator, Long> {
@Query("SELECT e FROM Elevator e WHERE e.facility = :facility")
List<Elevator> findByFacility(@Param("facility") Facility facility);
}

Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
import com.wayble.server.direction.entity.transportation.Facility;
import com.wayble.server.direction.entity.transportation.Node;
import com.wayble.server.direction.entity.transportation.Wheelchair;
import com.wayble.server.direction.entity.transportation.Elevator;

import com.wayble.server.direction.external.kric.dto.KricToiletRawItem;
import com.wayble.server.direction.external.kric.dto.KricToiletRawResponse;

import com.wayble.server.direction.repository.ElevatorRepository;
import com.wayble.server.direction.repository.FacilityRepository;
import com.wayble.server.direction.repository.NodeRepository;
import com.wayble.server.direction.repository.RouteRepository;
import com.wayble.server.direction.repository.WheelchairInfoRepository;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand All @@ -28,6 +33,7 @@
@Slf4j
@RequiredArgsConstructor
public class FacilityService {
private final ElevatorRepository elevatorRepository;
private final FacilityRepository facilityRepository;
private final NodeRepository nodeRepository;
private final WheelchairInfoRepository wheelchairInfoRepository;
Expand All @@ -54,8 +60,6 @@ public TransportationResponseDto.NodeInfo getNodeInfo(Long nodeId, Long routeId)
}
}

elevator = new ArrayList<>();

Facility facility = facilityRepository.findByNodeId(nodeId).orElse(null);
if (facility != null) {
String stinCd = facility.getStinCd();
Expand All @@ -65,6 +69,8 @@ public TransportationResponseDto.NodeInfo getNodeInfo(Long nodeId, Long routeId)
if (stinCd != null && railOprLsttCd != null && lnCd != null) {
Map<String, Boolean> toiletInfo = getToiletInfo(facility);
accessibleRestroom = toiletInfo.getOrDefault(stinCd, false);

elevator = getElevatorInfo(facility, routeId);
} else {
log.error("Facility 정보 누락 - nodeId: {}, stinCd: {}, railOprLsttCd: {}, lnCd: {}",
nodeId, stinCd, railOprLsttCd, lnCd);
Expand Down Expand Up @@ -132,4 +138,29 @@ private Map<String, Boolean> getToiletInfo(Facility facility) {

return stationToiletMap;
}
}

private List<String> getElevatorInfo(Facility facility, Long routeId) {
List<String> elevatorLocations = new ArrayList<>();

try {
List<Elevator> elevators = elevatorRepository.findByFacility(facility);

for (Elevator elevator : elevators) {
String location = elevator.getLocation();
if (location != null && !location.trim().isEmpty()) {
elevatorLocations.add(location.trim());
}
}

elevatorLocations.sort(String::compareTo);

} catch(Exception e) {
log.error("엘리베이터 정보 조회 실패 - facilityId: {}, error: {}",
facility.getId(), e.getMessage(), e);
}

return elevatorLocations;
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import com.wayble.server.direction.dto.TransportationGraphDto;
import com.wayble.server.direction.dto.request.TransportationRequestDto;
import com.wayble.server.direction.dto.response.TransportationResponseDto;
import com.wayble.server.direction.entity.DirectionType;
import com.wayble.server.direction.entity.transportation.Edge;
import com.wayble.server.direction.entity.transportation.Node;
import com.wayble.server.direction.entity.transportation.Route;
import com.wayble.server.direction.entity.type.DirectionType;
import com.wayble.server.direction.repository.EdgeRepository;
import com.wayble.server.direction.repository.NodeRepository;
import lombok.RequiredArgsConstructor;
Expand Down
Loading
Loading