File tree Expand file tree Collapse file tree 1 file changed +17
-12
lines changed
src/main/java/devut/buzzerbidder/domain/auctionroom/service Expand file tree Collapse file tree 1 file changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -247,18 +247,23 @@ public AuctionRoomResponse getAuctionRoom(Long auctionRoomId) {
247247 remainingMs = liveBidRedisService .getRemainingToStartMs (nextItem .getId ());
248248 }
249249
250- List <AuctionRoomItemDto > response = items .stream ()
251- .map (item -> new AuctionRoomItemDto (
252- item .getId (),
253- item .getName (),
254- item .getImages ().stream ()
255- .map (LiveItemImage ::getImageUrl )
256- .toList (),
257- item .getInitPrice (),
258- Long .parseLong ((String ) redisTemplate .opsForHash ().get ("liveItem:" + item .getId (), "maxBidPrice" )),
259- item .getAuctionStatus ()
260- ))
261- .toList ();
250+ List <AuctionRoomItemDto > response = items .stream ()
251+ .map (item -> {
252+ Object v = redisTemplate .opsForHash ().get ("liveItem:" + item .getId (), "maxBidPrice" );
253+ Long maxBidPrice = (v == null ) ? null : Long .parseLong (v .toString ());
254+
255+ return new AuctionRoomItemDto (
256+ item .getId (),
257+ item .getName (),
258+ item .getImages ().stream ()
259+ .map (LiveItemImage ::getImageUrl )
260+ .toList (),
261+ item .getInitPrice (),
262+ maxBidPrice ,
263+ item .getAuctionStatus ()
264+ );
265+ })
266+ .toList ();
262267
263268 return new AuctionRoomResponse (remainingMs , response );
264269
You can’t perform that action at this time.
0 commit comments