Skip to content

Commit

Permalink
_reserve 시 "netfunnelKey" 파라미터 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
dryrain39 committed Dec 26, 2024
1 parent a678c38 commit f748e96
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions SRT/srt.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ def reserve(
passengers,
special_seat,
window_seat=window_seat,
use_netfunnel_cache=True,
)

def reserve_standby(
Expand Down Expand Up @@ -383,6 +384,7 @@ def _reserve(
special_seat: SeatType = SeatType.GENERAL_FIRST,
mblPhone: str | None = None,
window_seat: bool | None = None,
use_netfunnel_cache: bool = True,
) -> SRTReservation:
"""예약 신청 요청 공통 함수
Expand All @@ -392,6 +394,7 @@ def _reserve(
special_seat (:class:`SeatType`): 일반실/특실 선택 유형 (default: 일반실 우선)
mblPhone (str, optional): 휴대폰 번호 | jobid가 RESERVE_JOBID["STANDBY"]일 경우에만 사용
window_seat (bool, optional): 창가 자리 우선 예약 여부 | jobid가 RESERVE_JOBID["PERSONAL"]일 경우에만 사용
use_netfunnel_cache (bool, optional): netfunnel 캐시 사용 여부, 사용하지 않으면 요청 시마다 새로 netfunnel 키를 요청합니다 (default: True)
Returns:
:class:`SRTReservation`: 예약 내역
Expand Down Expand Up @@ -428,6 +431,8 @@ def _reserve(
else:
is_special_seat = False

netfunnelKey = self.netfunnel_helper.generate_netfunnel_key(use_netfunnel_cache)

url = constants.API_ENDPOINTS["reserve"]
data = {
"jobId": jobid,
Expand All @@ -454,6 +459,7 @@ def _reserve(
"dptStnRunOrdr1": train.dep_station_run_order, # 출발역운행순서1 (열차 목록 값)
"arvStnRunOrdr1": train.arr_station_run_order, # 도착역운행순서1 (열차 목록 값)
"mblPhone": mblPhone,
"netfunnelKey": netfunnelKey,
}

# jobid가 RESERVE_JOBID["PERSONAL"]일 경우, data에 reserveType 추가
Expand Down

0 comments on commit f748e96

Please sign in to comment.