@@ -453,19 +453,25 @@ public void voteMiddleLocation(Schedule schedule, ScheduleMember scheduleMember,
453453 // νλΌλ―Έν°λ₯Ό idλ‘ λ°μΌλ©΄ λ μ’μ κ² κ°μ
454454 Location location = locationQueryRepository .findByIdWithPessimisticLock (lid .getId ())
455455 .orElseThrow (() -> new IllegalArgumentException ("μ₯μλ₯Ό μ°Ύμ μ μμ΅λλ€." ));
456+ // log.info("location = {}", location.toString());
457+
456458
457459 // λ½ μ΄ν voteCnt μ¦κ°μν€κΈ°
458460 location .setVoteCount (location .getVoteCount () + 1 );
459461
460462 List <Location > locationList = locationQueryRepository .findByScheduleId (schedule .getId ());
463+ // log.info("locationList = {}", locationList.toString());
464+
461465 int scheduleMemberNumber = scheduleMemberQueryRepository .findByScheduleId (schedule .getId ()).size ();
462- int voteCount = voteQueryRepository .findByScheduleId (schedule .getId ()).size ();
463466
464467 // vote μ μ₯ μμ μ λ€λ‘ λ―Έλ€μ, Location λ½κ³Όμ κ΅μ°©μ λ°©μ§
465468 VoteMiddleLocationDto dto = VoteMiddleLocationDto .toDto (scheduleMember , lid , schedule );
466469 Vote vote = VoteMiddleLocationDto .fromDto (dto );
467470 voteCommandRepository .save (vote );
468471
472+ int voteCount = voteQueryRepository .findByScheduleId (schedule .getId ()).size ();
473+ log .info ("voteCount = {}" , voteCount );
474+
469475
470476 if (scheduleMemberNumber - voteCount == 0 ) {
471477 Long winnerLocationId = 0L ;
@@ -479,6 +485,7 @@ public void voteMiddleLocation(Schedule schedule, ScheduleMember scheduleMember,
479485 }
480486
481487 Optional <Location > winnerLocation = locationQueryRepository .findById (winnerLocationId );
488+ log .info ("winnerLocation: {}" , winnerLocation );
482489 winnerLocation .get ().setStatus (VoteStatus .WINNER );
483490 }
484491 }
0 commit comments