Skip to content

fix:修复购票v2接口可能出现的死锁问题和简化 takeoutStation 方法的相关代码#12

Open
binaryyang wants to merge 1 commit intonageoffer:mainfrom
binaryyang:dev-sheephappy
Open

fix:修复购票v2接口可能出现的死锁问题和简化 takeoutStation 方法的相关代码#12
binaryyang wants to merge 1 commit intonageoffer:mainfrom
binaryyang:dev-sheephappy

Conversation

@binaryyang
Copy link
Copy Markdown

@binaryyang binaryyang commented Mar 2, 2025

  1. 修复购票v2接口可能出现的死锁问题
Map<Integer, List<PurchaseTicketPassengerDetailDTO>> seatTypeMap = requestParam.getPassengers().stream()
        .collect(Collectors.groupingBy(PurchaseTicketPassengerDetailDTO::getSeatType));

不一定会按照 SeatType 升序排序。所以为了实现顺序加锁,可以先对 key 排序
2.takeoutStation 方法有很多冗余的代码使得可读性较差,所以简化了一些代码

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant