Skip to content

Commit

Permalink
[Feat]: 챌린지 그룹 누적 참여자수 계산 로직 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonssshyeon committed Oct 19, 2024
1 parent 75910cf commit 017680a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,14 @@ private void updateChallenges(List<ChallengeGroupCommand.UpdateChallenge> comman
this.challenges.removeAll(removeChallenges);
}

public void addParticipants() {
if (cumulativeCount == null) {
this.cumulativeCount = 1;
}
else {
this.cumulativeCount += 1;
}
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public void participateChallenge(Long userId, Long challengeId) {
.create(challenge.getChallengeGroup(), user);
challengeGroupUserExpStore.store(entity);

// TODO: 챌린지 그룹 누적 참여자수 증가 로직 추가
// 챌린지 그룹 누적 참여자수 증가
challenge.getChallengeGroup().addParticipants();
}

/**
Expand Down

0 comments on commit 017680a

Please sign in to comment.